st/mesa: simplify writemask for emitting fog result
authorBrian Paul <brianp@vmware.com>
Thu, 21 Nov 2013 22:07:25 +0000 (15:07 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 22 Nov 2013 16:01:13 +0000 (09:01 -0700)
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 74b3e5b58d9533e0238ba2480e9590d1db6e23af..ac95968d6f535f992db0ae230c10c3325ea36f9c 100644 (file)
@@ -4892,7 +4892,7 @@ st_translate_program(
          if (outputSemanticName[i] == TGSI_SEMANTIC_FOG) {
             /* force register to contain a fog coordinate in the form (F, 0, 0, 1). */
             ureg_MOV(ureg,
-                     ureg_writemask(t->outputs[i], TGSI_WRITEMASK_XYZW & ~TGSI_WRITEMASK_X),
+                     ureg_writemask(t->outputs[i], TGSI_WRITEMASK_YZW),
                      ureg_imm4f(ureg, 0.0f, 0.0f, 0.0f, 1.0f));
             t->outputs[i] = ureg_writemask(t->outputs[i], TGSI_WRITEMASK_X);
         }
index 7d79c62354074ec4477db6065bee08e6090875ec..1c2abc1224f5620884eca6dbbc182c0f828924f5 100644 (file)
@@ -1124,7 +1124,7 @@ st_translate_mesa_program(
          if (outputSemanticName[i] == TGSI_SEMANTIC_FOG) {
             /* force register to contain a fog coordinate in the form (F, 0, 0, 1). */
             ureg_MOV(ureg,
-                     ureg_writemask(t->outputs[i], TGSI_WRITEMASK_XYZW & ~TGSI_WRITEMASK_X),
+                     ureg_writemask(t->outputs[i], TGSI_WRITEMASK_YZW),
                      ureg_imm4f(ureg, 0.0f, 0.0f, 0.0f, 1.0f));
             t->outputs[i] = ureg_writemask(t->outputs[i], TGSI_WRITEMASK_X);
         }