summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_derived.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-07-17 10:44:22 +0100
committerKeith Whitwell <keithw@vmware.com>2009-07-22 12:48:00 +0100
commitb5d583efeff5f195bff48c95125a225c273189e2 (patch)
treeb3c68989829923586642d60c6b1287d5469acf4d /src/gallium/drivers/softpipe/sp_state_derived.c
parent07bb026900a6c01226217ceee1d4d1426c040d6e (diff)
softpipe: make some small steps to flush texture cache less frequently
No performance gain yet, but the code is a bit cleaner.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_derived.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_derived.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c
index 75be99768c..629a1f8e29 100644
--- a/src/gallium/drivers/softpipe/sp_state_derived.c
+++ b/src/gallium/drivers/softpipe/sp_state_derived.c
@@ -32,6 +32,7 @@
#include "draw/draw_vertex.h"
#include "draw/draw_private.h"
#include "sp_context.h"
+#include "sp_screen.h"
#include "sp_state.h"
@@ -200,6 +201,10 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
softpipe->tgsi.frag_samplers[i].sampler = softpipe->sampler[i];
softpipe->tgsi.frag_samplers[i].texture = softpipe->texture[i];
}
+
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+ sp_tile_cache_validate_texture( softpipe->tex_cache[i] );
+ }
}
/* Hopefully this will remain quite simple, otherwise need to pull in
@@ -207,6 +212,15 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
*/
void softpipe_update_derived( struct softpipe_context *softpipe )
{
+ struct softpipe_screen *sp_screen = softpipe_screen(softpipe->pipe.screen);
+
+ /* Check for updated textures.
+ */
+ if (softpipe->tex_timestamp != sp_screen->timestamp) {
+ softpipe->tex_timestamp = sp_screen->timestamp;
+ softpipe->dirty |= SP_NEW_TEXTURE;
+ }
+
if (softpipe->dirty & (SP_NEW_SAMPLER |
SP_NEW_TEXTURE))
update_tgsi_samplers( softpipe );