diff options
author | Marek Olšák <marek.olsak@amd.com> | 2016-04-19 01:48:39 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2016-04-22 01:14:13 +0200 |
commit | 860b658b97f859ee7d0dd076a8ac0332601ffa65 (patch) | |
tree | 6598b102fa6a4bfd50d2d7110b5a79bb085b9887 | |
parent | 698821bda32eb9958e105c38087b49b6f307128d (diff) |
radeonsi: move clip plane constant buffer to RW buffers
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 4 |
4 files changed, 12 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index 034794467a..7be735a0a6 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -783,9 +783,9 @@ void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuf util_memcpy_cpu_to_le32(tmp, ptr, size); } -static void si_set_constant_buffer(struct si_context *sctx, - struct si_buffer_resources *buffers, - uint slot, struct pipe_constant_buffer *input) +void si_set_constant_buffer(struct si_context *sctx, + struct si_buffer_resources *buffers, + uint slot, struct pipe_constant_buffer *input) { assert(slot < buffers->desc.num_elements); pipe_resource_reference(&buffers->buffers[slot], NULL); @@ -1413,14 +1413,6 @@ void si_emit_graphics_shader_userdata(struct si_context *sctx, unsigned i; uint32_t *sh_base = sctx->shader_userdata.sh_base; - if (sctx->gs_shader.cso) { - /* The VS copy shader needs this for clipping. */ - unsigned vs_base = R_00B130_SPI_SHADER_USER_DATA_VS_0; - unsigned i = PIPE_SHADER_VERTEX; - - si_emit_shader_pointer(sctx, &sctx->const_buffers[i].desc, vs_base, true); - } - if (sctx->rw_buffers.desc.pointer_dirty) { si_emit_shader_pointer(sctx, &sctx->rw_buffers.desc, R_00B030_SPI_SHADER_USER_DATA_PS_0, true); diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index f698c63539..fc3e5c0d92 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -1690,8 +1690,9 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context *bld_base, unsigned chan; unsigned const_chan; LLVMValueRef base_elt; - LLVMValueRef ptr = LLVMGetParam(ctx->radeon_bld.main_fn, SI_PARAM_CONST_BUFFERS); - LLVMValueRef constbuf_index = lp_build_const_int32(base->gallivm, SI_DRIVER_STATE_CONST_BUF); + LLVMValueRef ptr = LLVMGetParam(ctx->radeon_bld.main_fn, SI_PARAM_RW_BUFFERS); + LLVMValueRef constbuf_index = lp_build_const_int32(base->gallivm, + SI_VS_CONST_CLIP_PLANES); LLVMValueRef const_resource = build_indexed_load_const(ctx, ptr, constbuf_index); for (reg_index = 0; reg_index < 2; reg_index ++) { diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index e726196d07..74af14c217 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -771,7 +771,8 @@ static void si_set_clip_state(struct pipe_context *ctx, cb.user_buffer = state->ucp; cb.buffer_offset = 0; cb.buffer_size = 4*4*8; - ctx->set_constant_buffer(ctx, PIPE_SHADER_VERTEX, SI_DRIVER_STATE_CONST_BUF, &cb); + si_set_constant_buffer(sctx, &sctx->rw_buffers, + SI_VS_CONST_CLIP_PLANES, &cb); pipe_resource_reference(&cb.buffer, NULL); } diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 9a2a7fd213..b7b00f00ec 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -178,6 +178,7 @@ enum { SI_VS_STREAMOUT_BUF2, SI_VS_STREAMOUT_BUF3, + SI_VS_CONST_CLIP_PLANES, SI_PS_CONST_POLY_STIPPLE, SI_NUM_RW_BUFFERS, @@ -273,6 +274,9 @@ void si_update_compressed_colortex_masks(struct si_context *sctx); void si_emit_graphics_shader_userdata(struct si_context *sctx, struct r600_atom *atom); void si_emit_compute_shader_userdata(struct si_context *sctx); +void si_set_constant_buffer(struct si_context *sctx, + struct si_buffer_resources *buffers, + uint slot, struct pipe_constant_buffer *input); /* si_state.c */ struct si_shader_selector; |