[Mesa-dev] [PATCH 2/2] glsl: set user defined varyings to smooth by default

Timothy Arceri timothy.arceri at collabora.com
Mon Feb 15 07:38:30 UTC 2016


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 and should have no impact on
built-ins as they generate GLSL IR directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92743
---
 src/compiler/glsl/ast_to_hir.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b639378..47d52ee 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2750,6 +2750,11 @@ interpret_interpolation_qualifier(const struct ast_type_qualifier *qual,
                           "vertex shader inputs or fragment shader outputs",
                           interpolation_string(interpolation));
       }
+   } else if ((mode == ir_var_shader_in &&
+               state->stage != MESA_SHADER_VERTEX) ||
+              (mode == ir_var_shader_out &&
+               state->stage != MESA_SHADER_FRAGMENT)) {
+      interpolation = INTERP_QUALIFIER_SMOOTH;
    }
 
    return interpolation;
-- 
2.5.0



More information about the mesa-dev mailing list