summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-10-21 07:55:48 -0700
committerPaul Berry <[email protected]>2011-10-27 15:31:32 -0700
commitbaf7f99fd7a092a1390b7a145e09caa5325a8116 (patch)
treefc8bea32687da29cacf8ec581e69446bf67bfcfd /src/glsl/ir.h
parentc488150dea083a9677429b4185c6b20d7facd52b (diff)
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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 0c0cccbd034..404d4cffa91 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -292,6 +292,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
*/
const char *name;