Fix fragment program color output mapping (0=depth, 1=color)
authorBrian <brian.paul@tungstengraphics.com>
Sat, 25 Aug 2007 00:26:42 +0000 (18:26 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Sat, 25 Aug 2007 00:26:42 +0000 (18:26 -0600)
src/mesa/pipe/i915simple/i915_fpc_translate.c
src/mesa/pipe/softpipe/sp_quad_fs.c
src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c

index 6fcba719ae4e0882441e589e8489d4f4268f2111..c2ad80c5d033dd69689b296906ddd0304bfe3765 100644 (file)
@@ -237,10 +237,10 @@ get_result_vector(struct i915_fp_compile *p,
    switch (dest->DstRegister.File) {
    case TGSI_FILE_OUTPUT:
       switch (dest->DstRegister.Index) {
-      case TGSI_ATTRIB_COLOR0:
-         return UREG(REG_TYPE_OC, 0);
-      case TGSI_ATTRIB_POS:
+      case 0:  /**TGSI_ATTRIB_POS:**/
          return UREG(REG_TYPE_OD, 0);
+      case 1:  /**TGSI_ATTRIB_COLOR0:**/
+         return UREG(REG_TYPE_OC, 0);
       default:
          i915_program_error(p, "Bad inst->DstReg.Index");
          return 0;
index bfc31f94a61d704063909a4a8ada20ed05eea0a0..cb0b6d8a77f1ab070f636dd9cc8f94f47d1927ee 100755 (executable)
@@ -136,10 +136,10 @@ shade_quad(
    /* run shader */
    tgsi_exec_machine_run( &machine );
 
-   /* store result color */
+   /* store result color (always in output[1]) */
    memcpy(
       quad->outputs.color,
-      &machine.Outputs[TGSI_ATTRIB_COLOR0].xyzw[0].f[0],
+      &machine.Outputs[1].xyzw[0].f[0],
       sizeof( quad->outputs.color ) );
 
 #if 0
index 78390767df9a8fb1982900b46ecda4a51f041153..182a7eff055b79ddf7e6a26c62f4b264dcbdfabf 100644 (file)
@@ -356,11 +356,11 @@ map_register_file_index(
           * color results -> index 1, 2, ...\r
           */\r
         if( index == FRAG_RESULT_DEPR ) {\r
-            mapped_index = TGSI_ATTRIB_POS;\r
+            mapped_index = 0; /**TGSI_ATTRIB_POS;**/\r
          }\r
          else {\r
             assert( index == FRAG_RESULT_COLR );\r
-            mapped_index = TGSI_ATTRIB_COLOR0;\r
+            mapped_index = 1; /**TGSI_ATTRIB_COLOR0;**/\r
          }\r
       }\r
       else {\r