summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_shader.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-10-22 15:36:25 -0600
committerBrian Paul <[email protected]>2015-10-22 17:19:20 -0600
commit1082735bb69e9f64cb3991a52f0e270902917855 (patch)
tree6d7be9330902c673435dc050545953e22b773846 /src/gallium/drivers/svga/svga_shader.h
parentdf0f817e311dbf9af110779086a27429905b1faf (diff)
svga: detect constant color writes in fragment shaders
Examine the fragment shader to try to detect TGSI shaders which use "MOV OUT[0], CONST[i]" to write a constant value for the fragment color. In this case, all fragments will have the same color (unless blending is enabled). This is a common case for OpenGL code such as: glColor(), glBegin(), glVertex(), ..., glEnd() when lighting/fog/etc are disabled. In this case, the Mesa/gallium state tracker actually generates a simple "MOV OUT[0], CONST[i]" fragment shader. This will be used by the next commit to avoid provoking vertex conversion (creating/rewriting an index buffer) when drawing flat-shaded primitives. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_shader.h')
-rw-r--r--src/gallium/drivers/svga/svga_shader.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_shader.h b/src/gallium/drivers/svga/svga_shader.h
index efcac408626..f49fdb46d0e 100644
--- a/src/gallium/drivers/svga/svga_shader.h
+++ b/src/gallium/drivers/svga/svga_shader.h
@@ -155,6 +155,9 @@ struct svga_shader_variant
* applied to any of the varyings.
*/
+ /** Is the color output just a constant value? (fragment shader only) */
+ boolean constant_color_output;
+
/** For FS-based polygon stipple */
unsigned pstipple_sampler_unit;