i965: Enable texture lookups whose return type is 'float'
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 14 Mar 2011 18:32:24 +0000 (11:32 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 14 Mar 2011 20:03:50 +0000 (13:03 -0700)
This enables the new shadow texture functions in GLSL 1.30.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index ce7959b..24a3d37 100644 (file)
@@ -1452,7 +1452,10 @@ fs_visitor::visit(ir_texture *ir)
    if (ir->shadow_comparitor)
       inst->shadow_compare = true;
 
-   if (c->key.tex_swizzles[inst->sampler] != SWIZZLE_NOOP) {
+   if (ir->type == glsl_type::float_type) {
+      /* Ignore DEPTH_TEXTURE_MODE swizzling. */
+      assert(ir->sampler->type->sampler_shadow);
+   } else if (c->key.tex_swizzles[inst->sampler] != SWIZZLE_NOOP) {
       fs_reg swizzle_dst = fs_reg(this, glsl_type::vec4_type);
 
       for (int i = 0; i < 4; i++) {