softpipe: fix using optimized filter function
authorRoland Scheidegger <sroland@vmware.com>
Wed, 6 Feb 2013 17:29:55 +0000 (09:29 -0800)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 9 Feb 2013 00:32:30 +0000 (16:32 -0800)
This optimized filter (when using repeat wrap modes,
linear min/mag/mip filters, pot textures) only applies to 2d textures,
but nothing prevented it from being used for other textures (likely
leading to very bogus sample results).

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/softpipe/sp_tex_sample.c

index ab032902aeceda34274bdab730ec101c57e7da8f..7f7e5aa3b9e20dc2a946c532bc46c3d61e8f14ab 100644 (file)
@@ -2963,6 +2963,7 @@ sp_create_sampler_variant( const struct pipe_sampler_state *sampler,
 
    case PIPE_TEX_MIPFILTER_LINEAR:
       if (key.bits.is_pot &&
+          key.bits.target == PIPE_TEXTURE_2D &&
           sampler->min_img_filter == sampler->mag_img_filter &&
           sampler->normalized_coords &&
           sampler->wrap_s == PIPE_TEX_WRAP_REPEAT &&