summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_flush.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-08-04 08:46:41 -0600
committerBrian Paul <brianp@vmware.com>2012-08-06 08:33:17 -0600
commitd6c3e6d8f34fc39dcbe9395c3a5953af726443f1 (patch)
treec75b41c48ae99d213633019150a348c3026a259c /src/gallium/drivers/softpipe/sp_flush.c
parent0a14e9f09fc1cf9d5c277bb239f349203d3bed79 (diff)
downloadexternal_mesa3d-d6c3e6d8f34fc39dcbe9395c3a5953af726443f1.zip
external_mesa3d-d6c3e6d8f34fc39dcbe9395c3a5953af726443f1.tar.gz
external_mesa3d-d6c3e6d8f34fc39dcbe9395c3a5953af726443f1.tar.bz2
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 <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_flush.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_flush.c14
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 4651e8b..9b8d492 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]);
+ }
}
}