diff options
author | Brian Paul <brianp@vmware.com> | 2010-12-14 13:01:00 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-12-14 13:01:03 -0700 |
commit | c62bb90d6a864468fe1a717aebb9c1a9c43bf3c8 (patch) | |
tree | 22fef0c50d5e49f8dcf379b224ecf2c023c99492 /src/gallium/drivers/softpipe/sp_state_sampler.c | |
parent | be2aa81f5f8f44be8c9c8854098d29635352c4f8 (diff) | |
download | external_mesa3d-c62bb90d6a864468fe1a717aebb9c1a9c43bf3c8.zip external_mesa3d-c62bb90d6a864468fe1a717aebb9c1a9c43bf3c8.tar.gz external_mesa3d-c62bb90d6a864468fe1a717aebb9c1a9c43bf3c8.tar.bz2 |
softpipe: do texture swizzle during texture sampling
Instead of when we read texture tiles. Now swizzling happens after
the shadow depth compare step. This fixes the piglit glsl-fs-shadow2d*
tests (except for proj+bias because of a GLSL bug).
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_sampler.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_sampler.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c index b59fbc3..8972d62 100644 --- a/src/gallium/drivers/softpipe/sp_state_sampler.c +++ b/src/gallium/drivers/softpipe/sp_state_sampler.c @@ -289,6 +289,7 @@ softpipe_set_geometry_sampler_views(struct pipe_context *pipe, static struct sp_sampler_varient * get_sampler_varient( unsigned unit, struct sp_sampler *sampler, + struct pipe_sampler_view *view, struct pipe_resource *resource, unsigned processor ) { @@ -303,6 +304,10 @@ get_sampler_varient( unsigned unit, key.bits.is_pot = sp_texture->pot; key.bits.processor = processor; key.bits.unit = unit; + key.bits.swizzle_r = view->swizzle_r; + key.bits.swizzle_g = view->swizzle_g; + key.bits.swizzle_b = view->swizzle_b; + key.bits.swizzle_a = view->swizzle_a; key.bits.pad = 0; if (sampler->current && @@ -347,6 +352,7 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe) softpipe->tgsi.vert_samplers_list[i] = get_sampler_varient( i, sp_sampler(softpipe->vertex_samplers[i]), + softpipe->vertex_sampler_views[i], texture, TGSI_PROCESSOR_VERTEX ); @@ -369,6 +375,7 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe) get_sampler_varient( i, sp_sampler(softpipe->geometry_samplers[i]), + softpipe->geometry_sampler_views[i], texture, TGSI_PROCESSOR_GEOMETRY ); @@ -391,6 +398,7 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe) softpipe->tgsi.frag_samplers_list[i] = get_sampler_varient( i, sp_sampler(softpipe->sampler[i]), + softpipe->sampler_views[i], texture, TGSI_PROCESSOR_FRAGMENT ); |