From fcae1a64ec0ef96bf90e473893849213ab9c14dd Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Mon, 11 Sep 2017 16:40:37 +0200 Subject: glsl: do not set the 'smooth' qualifier by default on ES shaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Dieter Nützel --- src/mesa/main/shader_query.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mesa') 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; } -- cgit v1.2.3