summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_descriptors.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-06-03 15:27:09 +0200
committerNicolai Hähnle <[email protected]>2016-06-07 15:17:59 +0200
commitba4a2840c7fb52169400420fd94c655b2b229f7e (patch)
treeac8fbab435346df48cddb41c65f656bc72e1c7ad /src/gallium/drivers/radeonsi/si_descriptors.c
parentc615a055f4e6e6fcd6d53d8dadfac48f27358699 (diff)
radeonsi: add si_set_rw_buffer to be used for internal descriptors
So that callers outside of si_descriptors.c need to worry less about the details of descriptor handling. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index bea751557d3..24fccbf29bc 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -872,9 +872,9 @@ void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuf
util_memcpy_cpu_to_le32(tmp, ptr, size);
}
-void si_set_constant_buffer(struct si_context *sctx,
- struct si_buffer_resources *buffers,
- uint slot, struct pipe_constant_buffer *input)
+static 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);
@@ -934,6 +934,12 @@ void si_set_constant_buffer(struct si_context *sctx,
buffers->desc.dirty_mask |= 1u << slot;
}
+void si_set_rw_buffer(struct si_context *sctx,
+ uint slot, struct pipe_constant_buffer *input)
+{
+ si_set_constant_buffer(sctx, &sctx->rw_buffers, slot, input);
+}
+
static void si_pipe_set_constant_buffer(struct pipe_context *ctx,
uint shader, uint slot,
struct pipe_constant_buffer *input)
@@ -1230,8 +1236,7 @@ static void si_set_polygon_stipple(struct pipe_context *ctx,
cb.user_buffer = stipple;
cb.buffer_size = sizeof(stipple);
- si_set_constant_buffer(sctx, &sctx->rw_buffers,
- SI_PS_CONST_POLY_STIPPLE, &cb);
+ si_set_rw_buffer(sctx, SI_PS_CONST_POLY_STIPPLE, &cb);
}
/* TEXTURE METADATA ENABLE/DISABLE */