Mesa (master): glsl: double-precision values don't support interpolation

Samuel Iglesias Gonsálvez samuelig at kemper.freedesktop.org
Thu Jan 28 10:36:11 UTC 2016


Module: Mesa
Branch: master
Commit: f9c43dd22f92cd631f7feffb362a4cd3dad06c87
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9c43dd22f92cd631f7feffb362a4cd3dad06c87

Author: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Date:   Tue Jan 26 12:47:26 2016 +0100

glsl: double-precision values don't support interpolation

ARB_gpu_shader_fp64 spec says:

  "This extension does not support interpolation of double-precision
  values; doubles used as fragment shader inputs must be qualified as
  "flat"."

Fixes the regressions added by commit 781d278:

arb_gpu_shader_fp64-double-gettransformfeedbackvarying
arb_gpu_shader_fp64-tf-interleaved
arb_gpu_shader_fp64-tf-interleaved-aligned
arb_gpu_shader_fp64-tf-separate

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93878
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/compiler/glsl/link_varyings.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 264b69c..a4c730f 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -967,11 +967,16 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
       return;
    }
 
-   if ((consumer_var == NULL && producer_var->type->contains_integer()) ||
+   bool needs_flat_qualifier = consumer_var == NULL &&
+      (producer_var->type->contains_integer() ||
+       producer_var->type->contains_double());
+
+   if (needs_flat_qualifier ||
        (consumer_stage != -1 && consumer_stage != MESA_SHADER_FRAGMENT)) {
       /* Since this varying is not being consumed by the fragment shader, its
        * interpolation type varying cannot possibly affect rendering.
-       * Also, this variable is non-flat and is (or contains) an integer.
+       * Also, this variable is non-flat and is (or contains) an integer
+       * or a double.
        * If the consumer stage is unknown, don't modify the interpolation
        * type as it could affect rendering later with separate shaders.
        *




More information about the mesa-commit mailing list