diff options
author | Marek Olšák <[email protected]> | 2013-08-17 19:19:30 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-08-31 01:34:30 +0200 |
commit | aa5c40f97cf5d0609dfb8c0792eca5f6d5108579 (patch) | |
tree | 24dd4409aa82a30ab7574381b314e5764228cf7c /src/gallium/drivers/radeonsi/si_state.c | |
parent | a81c3e00fee0626e63b1fb8ebb4c2cef3fb23367 (diff) |
radeonsi: convert constant buffers to si_descriptors
There is a new "class" si_buffer_resources, which should be good enough for
implementing any kind of buffer bindings (constant buffers, vertex buffers,
streamout buffers, shader storage buffers, etc.)
I don't even keep a copy of pipe_constant_buffer - we don't need it.
The main motivation behind this is to have a well-tested infrastrusture
for setting up streamout buffers.
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Christian König <[email protected]>
Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index b4370dad1f8..5ac55f22a5b 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3017,46 +3017,6 @@ static void si_delete_sampler_state(struct pipe_context *ctx, void *state) } /* - * Constants - */ -static void si_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index, - struct pipe_constant_buffer *input) -{ - struct r600_context *rctx = (struct r600_context *)ctx; - struct r600_constbuf_state *state = &rctx->constbuf_state[shader]; - struct pipe_constant_buffer *cb; - const uint8_t *ptr; - - /* Note that the state tracker can unbind constant buffers by - * passing NULL here. - */ - if (unlikely(!input || (!input->buffer && !input->user_buffer))) { - state->enabled_mask &= ~(1 << index); - state->dirty_mask &= ~(1 << index); - pipe_resource_reference(&state->cb[index].buffer, NULL); - return; - } - - cb = &state->cb[index]; - cb->buffer_size = input->buffer_size; - - ptr = input->user_buffer; - - if (ptr) { - r600_upload_const_buffer(rctx, - (struct r600_resource**)&cb->buffer, ptr, - cb->buffer_size, &cb->buffer_offset); - } else { - /* Setup the hw buffer. */ - cb->buffer_offset = input->buffer_offset; - pipe_resource_reference(&cb->buffer, input->buffer); - } - - state->enabled_mask |= 1 << index; - state->dirty_mask |= 1 << index; -} - -/* * Vertex elements & buffers */ @@ -3241,8 +3201,6 @@ void si_init_state_functions(struct r600_context *rctx) rctx->b.b.set_sample_mask = si_set_sample_mask; - rctx->b.b.set_constant_buffer = si_set_constant_buffer; - rctx->b.b.create_vertex_elements_state = si_create_vertex_elements; rctx->b.b.bind_vertex_elements_state = si_bind_vertex_elements; rctx->b.b.delete_vertex_elements_state = si_delete_vertex_element; |