summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_derived.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-08-21 17:13:11 +0100
committerKeith Whitwell <keithw@vmware.com>2009-08-21 18:14:19 +0100
commit4fc7d0345a18042a79686940fb7cc4e698cc9192 (patch)
treeb039e7d5e5e673a8677926050df0648c17bfd0fc /src/gallium/drivers/softpipe/sp_state_derived.c
parentb1cc196e6d18494348c2974aad5d85d1b8281ce0 (diff)
softpipe: rework texture sampling code
Split into component pieces, stitch together at runtime using function pointers. Make it possible to utilize the existing fastpaths as image-level filters for generic mip-filtering routines. Remove special case for rectangle filtering, as it can now be handled by the 2d path. As most of the mesa demo texturing was already covered by fast paths, its harder to find examples of speedups, but tunnel gets a boost as mip-nearest filtering is now able to access the img_2d_linear_wrap_POT functions for sampling within a mipmap level.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_derived.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_derived.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c
index 1f6e2ccb83..5310928332 100644
--- a/src/gallium/drivers/softpipe/sp_state_derived.c
+++ b/src/gallium/drivers/softpipe/sp_state_derived.c
@@ -198,19 +198,7 @@ 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];
- softpipe->tgsi.frag_samplers[i].base.get_samples = sp_get_samples;
- }
-
- /* 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];
- softpipe->tgsi.frag_samplers[i].base.get_samples = sp_get_samples;
- }
+ softpipe_reset_sampler_varients( softpipe );
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
sp_tile_cache_validate_texture( softpipe->tex_cache[i] );
@@ -232,7 +220,9 @@ void softpipe_update_derived( struct softpipe_context *softpipe )
}
if (softpipe->dirty & (SP_NEW_SAMPLER |
- SP_NEW_TEXTURE))
+ SP_NEW_TEXTURE |
+ SP_NEW_FS |
+ SP_NEW_VS))
update_tgsi_samplers( softpipe );
if (softpipe->dirty & (SP_NEW_RASTERIZER |