summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-02-16 11:03:56 +1100
committerTimothy Arceri <[email protected]>2016-02-17 07:23:49 +1100
commit07e6a37332d2d3908ee1f1160ee25ed9c127b770 (patch)
treea7cdcb5b9e336b4fc239b14c5e317c96ff5a55fd /src/compiler/glsl
parentf63851289077714509e30b70cd922848cbe06499 (diff)
glsl: set user defined varyings to smooth by default in ES
This is usually handled by the backends in order to handle the various interactions with the gl_*Color built-ins. The problem is this means linking will fail if one side on the interface adds the smooth qualifier to the varying and the other side just uses the default even though they match. This fixes various deqp tests. The spec is not clear what to for desktop GL so leave it as is for now. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92743
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b63937899cb..0bb2ba2a5e9 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2750,6 +2750,17 @@ interpret_interpolation_qualifier(const struct ast_type_qualifier *qual,
"vertex shader inputs or fragment shader outputs",
interpolation_string(interpolation));
}
+ } else if (state->es_shader &&
+ ((mode == ir_var_shader_in &&
+ state->stage != MESA_SHADER_VERTEX) ||
+ (mode == ir_var_shader_out &&
+ state->stage != MESA_SHADER_FRAGMENT))) {
+ /* Section 4.3.9 (Interpolation) of the GLSL ES 3.00 spec says:
+ *
+ * "When no interpolation qualifier is present, smooth interpolation
+ * is used."
+ */
+ interpolation = INTERP_QUALIFIER_SMOOTH;
}
return interpolation;