diff options
author | Paul Berry <[email protected]> | 2011-10-21 07:40:37 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2011-10-27 15:31:20 -0700 |
commit | c488150dea083a9677429b4185c6b20d7facd52b (patch) | |
tree | 178b9c921d1408ad220d61b96276450104776472 /src/mesa/main | |
parent | cf45949d6a896651a5f3864d3b195e26d59eee74 (diff) |
glsl: Distinguish between no interpolation qualifier and 'smooth'
Previously, we treated the 'smooth' qualifier as equivalent to no
qualifier at all. However, this is incorrect for the built-in color
variables (gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and
gl_BackSecondaryColor). For those variables, if there is no qualifier
at all, interpolation should be flat if the shade model is GL_FLAT,
and smooth if the shade model is GL_SMOOTH.
To make this possible, I added a new value to the
glsl_interp_qualifier enum, INTERP_QUALIFIER_NONE.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/mtypes.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 9410e3ff67a..aa3fa6aecf0 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1793,9 +1793,13 @@ typedef enum /** * The possible interpolation qualifiers that can be applied to a fragment * shader input in GLSL. + * + * Note: INTERP_QUALIFIER_NONE must be 0 so that memsetting the + * gl_fragment_program data structure to 0 causes the default behavior. */ enum glsl_interp_qualifier { + INTERP_QUALIFIER_NONE = 0, INTERP_QUALIFIER_SMOOTH, INTERP_QUALIFIER_FLAT, INTERP_QUALIFIER_NOPERSPECTIVE @@ -1906,7 +1910,7 @@ struct gl_fragment_program /** * GLSL interpolation qualifier associated with each fragment shader input. * For inputs that do not have an interpolation qualifier specified in - * GLSL, the value is INTERP_QUALIFIER_SMOOTH. + * GLSL, the value is INTERP_QUALIFIER_NONE. */ enum glsl_interp_qualifier InterpQualifier[FRAG_ATTRIB_MAX]; }; |