glsl: Distinguish between no interpolation qualifier and 'smooth'
authorPaul Berry <stereotype441@gmail.com>
Fri, 21 Oct 2011 14:40:37 +0000 (07:40 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 27 Oct 2011 22:31:20 +0000 (15:31 -0700)
commitc488150dea083a9677429b4185c6b20d7facd52b
tree178b9c921d1408ad220d61b96276450104776472
parentcf45949d6a896651a5f3864d3b195e26d59eee74
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 <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/ast_to_hir.cpp
src/glsl/ir.cpp
src/glsl/ir.h
src/mesa/main/mtypes.h