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.h | |
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.h')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 20ae4332c4c..82fac4a4c52 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -92,11 +92,9 @@ union si_state { struct si_pm4_state *vs; struct si_pm4_state *vs_sampler_views; struct si_pm4_state *vs_sampler; - struct si_pm4_state *vs_const; struct si_pm4_state *ps; struct si_pm4_state *ps_sampler_views; struct si_pm4_state *ps_sampler; - struct si_pm4_state *ps_const; struct si_pm4_state *spi; struct si_pm4_state *vertex_buffers; struct si_pm4_state *texture_barrier; @@ -114,6 +112,8 @@ union si_state { #define FMASK_TEX_OFFSET NUM_TEX_UNITS #define NUM_SAMPLER_VIEWS (FMASK_TEX_OFFSET+NUM_TEX_UNITS) +#define NUM_CONST_BUFFERS 2 + /* This represents resource descriptors in memory, such as buffer resources, * image resources, and sampler states. */ @@ -149,7 +149,16 @@ struct si_descriptors { struct si_sampler_views { struct si_descriptors desc; struct pipe_sampler_view *views[NUM_SAMPLER_VIEWS]; - const uint32_t *desc_data[NUM_SAMPLER_VIEWS]; + uint32_t *desc_data[NUM_SAMPLER_VIEWS]; +}; + +struct si_buffer_resources { + struct si_descriptors desc; + unsigned num_buffers; + enum radeon_bo_usage shader_usage; /* READ, WRITE, or READWRITE */ + struct pipe_resource **buffers; /* this has num_buffers elements */ + uint32_t *desc_storage; /* this has num_buffers*4 elements */ + uint32_t **desc_data; /* an array of pointers pointing to desc_storage */ }; #define si_pm4_block_idx(member) \ |