summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_context.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-08-04 08:46:41 -0600
committerBrian Paul <[email protected]>2012-08-06 08:33:17 -0600
commitd6c3e6d8f34fc39dcbe9395c3a5953af726443f1 (patch)
treec75b41c48ae99d213633019150a348c3026a259c /src/gallium/drivers/softpipe/sp_context.h
parent0a14e9f09fc1cf9d5c277bb239f349203d3bed79 (diff)
softpipe: consolidate sampler-related arrays
Combine separate arrays for vertex/fragment/geometry samplers, etc into one array indexed by PIPE_SHADER_x. This allows us to collapse separate code for vertex/fragment/geometry state into loops over the shader stage. More to come. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.h')
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 95f5b769a5a..2185fb85277 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -60,9 +60,7 @@ struct softpipe_context {
/** Constant state objects */
struct pipe_blend_state *blend;
- struct pipe_sampler_state *fragment_samplers[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_state *vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
- struct pipe_sampler_state *geometry_samplers[PIPE_MAX_GEOMETRY_SAMPLERS];
+ struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
struct pipe_depth_stencil_alpha_state *depth_stencil;
struct pipe_rasterizer_state *rasterizer;
struct sp_fragment_shader *fs;
@@ -81,9 +79,8 @@ struct softpipe_context {
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
- struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
- struct pipe_sampler_view *geometry_sampler_views[PIPE_MAX_GEOMETRY_SAMPLERS];
+ struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_GEOMETRY_SAMPLERS];
+
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
struct pipe_index_buffer index_buffer;
@@ -94,12 +91,9 @@ struct softpipe_context {
struct pipe_query_data_so_statistics so_stats;
unsigned num_primitives_generated;
- unsigned num_fragment_samplers;
- unsigned num_fragment_sampler_views;
- unsigned num_vertex_samplers;
- unsigned num_vertex_sampler_views;
- unsigned num_geometry_samplers;
- unsigned num_geometry_sampler_views;
+ unsigned num_samplers[PIPE_SHADER_TYPES];
+ unsigned num_sampler_views[PIPE_SHADER_TYPES];
+
unsigned num_vertex_buffers;
unsigned dirty; /**< Mask of SP_NEW_x flags */
@@ -164,9 +158,7 @@ struct softpipe_context {
/** TGSI exec things */
struct {
- struct sp_sampler_variant *geom_samplers_list[PIPE_MAX_GEOMETRY_SAMPLERS];
- struct sp_sampler_variant *vert_samplers_list[PIPE_MAX_VERTEX_SAMPLERS];
- struct sp_sampler_variant *frag_samplers_list[PIPE_MAX_SAMPLERS];
+ struct sp_sampler_variant *samplers_list[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
} tgsi;
struct tgsi_exec_machine *fs_machine;