diff options
author | Brian Paul <[email protected]> | 2012-08-04 08:46:41 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-08-06 08:33:17 -0600 |
commit | d6c3e6d8f34fc39dcbe9395c3a5953af726443f1 (patch) | |
tree | c75b41c48ae99d213633019150a348c3026a259c /src/gallium/drivers/softpipe/sp_flush.c | |
parent | 0a14e9f09fc1cf9d5c277bb239f349203d3bed79 (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_flush.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_flush.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/drivers/softpipe/sp_flush.c b/src/gallium/drivers/softpipe/sp_flush.c index 4651e8bb56b..9b8d492cde1 100644 --- a/src/gallium/drivers/softpipe/sp_flush.c +++ b/src/gallium/drivers/softpipe/sp_flush.c @@ -52,14 +52,12 @@ softpipe_flush( struct pipe_context *pipe, draw_flush(softpipe->draw); if (flags & SP_FLUSH_TEXTURE_CACHE) { - for (i = 0; i < softpipe->num_fragment_sampler_views; i++) { - sp_flush_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_FRAGMENT][i]); - } - for (i = 0; i < softpipe->num_vertex_sampler_views; i++) { - sp_flush_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_VERTEX][i]); - } - for (i = 0; i < softpipe->num_geometry_sampler_views; i++) { - sp_flush_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_GEOMETRY][i]); + unsigned sh; + + for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) { + for (i = 0; i < softpipe->num_sampler_views[sh]; i++) { + sp_flush_tex_tile_cache(softpipe->tex_cache[sh][i]); + } } } |