glsl: Fix location bias for patch variables.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 24 Jun 2016 07:09:00 +0000 (00:09 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 8 Aug 2016 06:53:42 +0000 (23:53 -0700)
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@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/linker.cpp

index 2271676181e94d88d002fe2cad7594dae8830b1b..1c8860ece2539dd9ccc153ec9889c51f0dcfaa6f 100644 (file)
@@ -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.
        */