summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-09-11 16:40:37 +0200
committerNicolai Hähnle <[email protected]>2017-10-02 15:07:42 +0200
commitfcae1a64ec0ef96bf90e473893849213ab9c14dd (patch)
treec6ff8fdcb4f32d8021295ad5be77de2551ebb0a9 /src/mesa
parentd304c467ba3cdda4ad85a31ca9981cb039e3c1f3 (diff)
glsl: do not set the 'smooth' qualifier by default on ES shaders
It leads to surprising states with integer inputs and outputs on vertex processing stages (e.g. geometry stages). Instead, rely on the driver to choose smooth interpolation by default. We still allow varyings to match when one stage declares it as smooth and the other declares it without interpolation qualifiers. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/shader_query.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 64e68b4a26d..6712bb45fb2 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -1634,7 +1634,13 @@ validate_io(struct gl_program *producer, struct gl_program *consumer)
* Note that location mismatches are detected by the loops above that
* find the producer variable that goes with the consumer variable.
*/
- if (producer_var->interpolation != consumer_var->interpolation) {
+ unsigned producer_interpolation = producer_var->interpolation;
+ unsigned consumer_interpolation = consumer_var->interpolation;
+ if (producer_interpolation == INTERP_MODE_NONE)
+ producer_interpolation = INTERP_MODE_SMOOTH;
+ if (consumer_interpolation == INTERP_MODE_NONE)
+ consumer_interpolation = INTERP_MODE_SMOOTH;
+ if (producer_interpolation != consumer_interpolation) {
valid = false;
goto out;
}