diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-07-16 14:14:32 +0100 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-07-22 12:47:59 +0100 |
commit | aa5db684382bd8662a83ca09ed000e4a5a1013f9 (patch) | |
tree | d4ef507f02a680abbafd71ce02fd2924dc7664ea /src/gallium/drivers/softpipe/sp_state_derived.c | |
parent | ede9f3b52ecb27ada81fee06a943bb595c60eaee (diff) |
softpipe: remove backwards dependency from tilecache to softpipe
The tile cache is a utility, it shouldn't know anything about the
entity which is making use of it (ie softpipe).
Remove softpipe parameter to all the tilecache function calls, and
also remove the need to keep a softpipe pointer in the sampler structs.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_derived.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_derived.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c index 75551000c9..75be99768c 100644 --- a/src/gallium/drivers/softpipe/sp_state_derived.c +++ b/src/gallium/drivers/softpipe/sp_state_derived.c @@ -184,11 +184,33 @@ compute_cliprect(struct softpipe_context *sp) } +static void +update_tgsi_samplers( struct softpipe_context *softpipe ) +{ + unsigned i; + + /* vertex shader samplers */ + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + softpipe->tgsi.vert_samplers[i].sampler = softpipe->sampler[i]; + softpipe->tgsi.vert_samplers[i].texture = softpipe->texture[i]; + } + + /* fragment shader samplers */ + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + softpipe->tgsi.frag_samplers[i].sampler = softpipe->sampler[i]; + softpipe->tgsi.frag_samplers[i].texture = softpipe->texture[i]; + } +} + /* Hopefully this will remain quite simple, otherwise need to pull in * something like the state tracker mechanism. */ void softpipe_update_derived( struct softpipe_context *softpipe ) { + if (softpipe->dirty & (SP_NEW_SAMPLER | + SP_NEW_TEXTURE)) + update_tgsi_samplers( softpipe ); + if (softpipe->dirty & (SP_NEW_RASTERIZER | SP_NEW_FS | SP_NEW_VS)) |