vc4: Add some debug code for forcing fragment shader output color.
authorEric Anholt <eric@anholt.net>
Wed, 6 Aug 2014 18:52:57 +0000 (11:52 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 9 Aug 2014 01:59:47 +0000 (18:59 -0700)
src/gallium/drivers/vc4/vc4_program.c

index 0c821c8960da81a1888a2aa9209c50aef0a2b8b6..4e991148c407d88481effe7300f0d9dfbdc097bd 100644 (file)
@@ -562,6 +562,21 @@ emit_frag_end(struct tgsi_to_qir *trans)
         const struct util_format_description *format_desc =
                 util_format_description(trans->fs_key->color_format);
 
+        /* Debug: Sometimes you're getting a black output and just want to see
+         * if the FS is getting executed at all.  Spam magenta into the color
+         * output.
+         */
+        if (0) {
+                trans->outputs[format_desc->swizzle[0]] =
+                        qir_uniform_ui(trans, fui(1.0));
+                trans->outputs[format_desc->swizzle[1]] =
+                        qir_uniform_ui(trans, fui(0.0));
+                trans->outputs[format_desc->swizzle[2]] =
+                        qir_uniform_ui(trans, fui(1.0));
+                trans->outputs[format_desc->swizzle[3]] =
+                        qir_uniform_ui(trans, fui(0.5));
+        }
+
         struct qreg swizzled_outputs[4] = {
                 trans->outputs[format_desc->swizzle[0]],
                 trans->outputs[format_desc->swizzle[1]],