[Mesa-stable] [PATCH 17/18] glsl: Fix location bias for patch variables.

Kenneth Graunke kenneth at whitecape.org
Mon Aug 1 17:29:44 UTC 2016


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-stable at lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 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 9c4a734..745637b 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.
        */
-- 
2.9.2



More information about the mesa-stable mailing list