diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-07-17 10:44:22 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-08-29 09:21:16 +0100 |
commit | 0f55a95b2faa16cc008143c53a8b82b19c5d750a (patch) | |
tree | 69bb35652d7adddcec043c0d742c2a8e32898378 /src/gallium/drivers/llvmpipe/lp_state_derived.c | |
parent | 3121484a8bde7af053fb627bd716be957fcef18c (diff) |
llvmpipe: 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/llvmpipe/lp_state_derived.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_derived.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index 16ae435d3a..59b06f5336 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -32,6 +32,7 @@ #include "draw/draw_vertex.h" #include "draw/draw_private.h" #include "lp_context.h" +#include "lp_screen.h" #include "lp_state.h" @@ -200,6 +201,10 @@ update_tgsi_samplers( struct llvmpipe_context *llvmpipe ) llvmpipe->tgsi.frag_samplers[i].sampler = llvmpipe->sampler[i]; llvmpipe->tgsi.frag_samplers[i].texture = llvmpipe->texture[i]; } + + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + lp_tile_cache_validate_texture( llvmpipe->tex_cache[i] ); + } } /* Hopefully this will remain quite simple, otherwise need to pull in @@ -207,6 +212,15 @@ update_tgsi_samplers( struct llvmpipe_context *llvmpipe ) */ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe ) { + struct llvmpipe_screen *lp_screen = llvmpipe_screen(llvmpipe->pipe.screen); + + /* Check for updated textures. + */ + if (llvmpipe->tex_timestamp != lp_screen->timestamp) { + llvmpipe->tex_timestamp = lp_screen->timestamp; + llvmpipe->dirty |= LP_NEW_TEXTURE; + } + if (llvmpipe->dirty & (LP_NEW_SAMPLER | LP_NEW_TEXTURE)) update_tgsi_samplers( llvmpipe ); |