Mesa (master): glsl/linker: Reduce scope of non-flat integer varying fix.

Paul Berry stereotype441 at kemper.freedesktop.org
Tue Apr 9 17:43:45 UTC 2013


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

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Apr  9 10:37:16 2013 -0700

glsl/linker: Reduce scope of non-flat integer varying fix.

In the mailing list discussion of "glsl/linker: fix varying packing
for non-flat integer varyings." (commit 7862bde), we concluded that
since the bug only applies to integral variables, it is safer to just
apply the bug fix to integer varyings.  I forgot to make the change
before pushing the patch upstream.  (Note: we aren't aware of any bugs
in commit 7862bde; it just seems wise to be on the safe side).

This patch makes the change.  Assuming commit 7862bde gets
cherry-picked back to 9.1, this commit should be cherry-picked too.

NOTE: This is a candidate for the 9.1 release branch.

---

 src/glsl/link_varyings.cpp |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 7e90beb..f911f62 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -676,12 +676,11 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
       return;
    }
 
-   if (consumer_var == NULL || !consumer_is_fs) {
+   if ((consumer_var == NULL && producer_var->type->contains_integer()) ||
+       !consumer_is_fs) {
       /* Since this varying is not being consumed by the fragment shader, its
        * interpolation type varying cannot possibly affect rendering.  Also,
-       * since the GL spec only requires integer varyings to be "flat" when
-       * they are fragment shader inputs, it is possible that this variable is
-       * non-flat and is (or contains) an integer.
+       * this variable is non-flat and is (or contains) an integer.
        *
        * lower_packed_varyings requires all integer varyings to flat,
        * regardless of where they appear.  We can trivially satisfy that




More information about the mesa-commit mailing list