i915: Add support for reading output regs in the FS.
authorEric Anholt <eric@anholt.net>
Tue, 17 Aug 2010 22:51:34 +0000 (15:51 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 17 Aug 2010 23:39:18 +0000 (16:39 -0700)
Fixes glsl-unused-varying and many others, since we produce an output
reg read any time gl_FragColor is written inside an if statement.

src/mesa/drivers/dri/i915/i915_fragprog.c

index 2ba0d2c591e251c34249a96393442f2f0a5d851e..3101bd17001576cd5f3af5a56c3282d2b0ca6da9 100644 (file)
@@ -143,6 +143,20 @@ src_vector(struct i915_fragment_program *p,
       }
       break;
 
+   case PROGRAM_OUTPUT:
+      switch (source->Index) {
+      case FRAG_RESULT_COLOR:
+        src = UREG(REG_TYPE_OC, 0);
+        break;
+      case FRAG_RESULT_DEPTH:
+        src = UREG(REG_TYPE_OD, 0);
+        break;
+      default:
+        i915_program_error(p, "Bad source->Index: %d", source->Index);
+        return 0;
+      }
+      break;
+
       /* Various paramters and env values.  All emitted to
        * hardware as program constants.
        */