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

Author: Kenneth Graunke <kenn...@whitecape.org>
Date:   Fri Jun 24 00:09:00 2016 -0700

glsl: Fix location bias for patch variables.

We need to subtract VARYING_SLOT_PATCH0, not VARYING_SLOT_VAR0.

Since "patch" only applies to inputs and outputs, we can just handle
this once outside the switch statement, rather than replicating the
check twice and complicating the earlier conditions.

Cc: mesa-sta...@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arc...@collabora.com>

---

 src/compiler/glsl/linker.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 2271676..1c8860e 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3866,6 +3866,9 @@ add_interface_variables(struct gl_shader_program *shProg,
          continue;
       };
 
+      if (var->data.patch)
+         loc_bias = int(VARYING_SLOT_PATCH0);
+
       /* Skip packed varyings, packed varyings are handled separately
        * by add_packed_varyings.
        */

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to