glsl: add ir_variable::determine_interpolation_mode() function.

This function determines how a variable should be interpolated based
both on interpolation qualifiers and the current shade model.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Paul Berry
2011-10-21 07:55:48 -07:00
parent c488150dea
commit baf7f99fd7
2 changed files with 26 additions and 0 deletions

View File

@@ -291,6 +291,17 @@ public:
*/
const char *interpolation_string() const;
/**
* Determine how this variable should be interpolated based on its
* interpolation qualifier (if present), whether it is gl_Color or
* gl_SecondaryColor, and whether flatshading is enabled in the current GL
* state.
*
* The return value will always be either INTERP_QUALIFIER_SMOOTH,
* INTERP_QUALIFIER_NOPERSPECTIVE, or INTERP_QUALIFIER_FLAT.
*/
glsl_interp_qualifier determine_interpolation_mode(bool flat_shade);
/**
* Delcared name of the variable
*/