check for divide by W flag when translating TGSI_OPCODE_TEX (fixes projected textures)
authorBrian <brian.paul@tungstengraphics.com>
Thu, 8 Nov 2007 18:39:42 +0000 (11:39 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 8 Nov 2007 18:39:42 +0000 (11:39 -0700)
src/mesa/pipe/i915simple/i915_fpc_translate.c

index 7838031c17ba378d9bf72676336b426a6c156129..b867b87e745a1f60aa82cec26e30de5b5b4d3451 100644 (file)
@@ -831,7 +831,13 @@ i915_translate_instruction(struct i915_fp_compile *p,
       break;
 
    case TGSI_OPCODE_TEX:
-      emit_tex(p, inst, T0_TEXLD);
+      if (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide
+          == TGSI_EXTSWIZZLE_W) {
+         emit_tex(p, inst, T0_TEXLDP);
+      }
+      else {
+         emit_tex(p, inst, T0_TEXLD);
+      }
       break;
 
    case TGSI_OPCODE_TXB: