summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_to_hir.cpp4
-rw-r--r--src/glsl/ir.cpp3
-rw-r--r--src/glsl/ir.h4
3 files changed, 9 insertions, 2 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index d090d311da8..fa6206e5eb0 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1965,8 +1965,10 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
var->interpolation = INTERP_QUALIFIER_FLAT;
else if (qual->flags.q.noperspective)
var->interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
- else
+ else if (qual->flags.q.smooth)
var->interpolation = INTERP_QUALIFIER_SMOOTH;
+ else
+ var->interpolation = INTERP_QUALIFIER_NONE;
var->pixel_center_integer = qual->flags.q.pixel_center_integer;
var->origin_upper_left = qual->flags.q.origin_upper_left;
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 046ce25f90c..9aad0fcd42f 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1320,7 +1320,7 @@ ir_swizzle::variable_referenced() const
ir_variable::ir_variable(const struct glsl_type *type, const char *name,
ir_variable_mode mode)
: max_array_access(0), read_only(false), centroid(false), invariant(false),
- mode(mode), interpolation(INTERP_QUALIFIER_SMOOTH)
+ mode(mode), interpolation(INTERP_QUALIFIER_NONE)
{
this->ir_type = ir_type_variable;
this->type = type;
@@ -1343,6 +1343,7 @@ const char *
ir_variable::interpolation_string() const
{
switch (this->interpolation) {
+ case INTERP_QUALIFIER_NONE: return "no";
case INTERP_QUALIFIER_SMOOTH: return "smooth";
case INTERP_QUALIFIER_FLAT: return "flat";
case INTERP_QUALIFIER_NOPERSPECTIVE: return "noperspective";
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 4ea8764b68f..0c0cccbd034 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -283,6 +283,10 @@ public:
* \return The string that would be used in a shader to specify \c
* mode will be returned.
*
+ * This function is used to generate error messages of the form "shader
+ * uses %s interpolation qualifier", so in the case where there is no
+ * interpolation qualifier, it returns "no".
+ *
* This function should only be used on a shader input or output variable.
*/
const char *interpolation_string() const;