From 3121484a8bde7af053fb627bd716be957fcef18c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 16 Jul 2009 14:14:32 +0100 Subject: llvmpipe: remove backwards dependency from tilecache to llvmpipe The tile cache is a utility, it shouldn't know anything about the entity which is making use of it (ie llvmpipe). Remove llvmpipe parameter to all the tilecache function calls, and also remove the need to keep a llvmpipe pointer in the sampler structs. --- src/gallium/drivers/llvmpipe/lp_state_derived.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/gallium/drivers/llvmpipe/lp_state_derived.c') diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index 05a3a0495b..16ae435d3a 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -184,11 +184,33 @@ compute_cliprect(struct llvmpipe_context *lp) } +static void +update_tgsi_samplers( struct llvmpipe_context *llvmpipe ) +{ + unsigned i; + + /* vertex shader samplers */ + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + llvmpipe->tgsi.vert_samplers[i].sampler = llvmpipe->sampler[i]; + llvmpipe->tgsi.vert_samplers[i].texture = llvmpipe->texture[i]; + } + + /* fragment shader samplers */ + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + llvmpipe->tgsi.frag_samplers[i].sampler = llvmpipe->sampler[i]; + llvmpipe->tgsi.frag_samplers[i].texture = llvmpipe->texture[i]; + } +} + /* Hopefully this will remain quite simple, otherwise need to pull in * something like the state tracker mechanism. */ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe ) { + if (llvmpipe->dirty & (LP_NEW_SAMPLER | + LP_NEW_TEXTURE)) + update_tgsi_samplers( llvmpipe ); + if (llvmpipe->dirty & (LP_NEW_RASTERIZER | LP_NEW_FS | LP_NEW_VS)) -- cgit v1.2.3