From: Kenneth Graunke Date: Fri, 24 Jun 2016 07:09:00 +0000 (-0700) Subject: glsl: Fix location bias for patch variables. X-Git-Tag: android-x86-6.0-r1^2~83 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=fce2e3b493129ce865ee9dec5415604dc2422421;p=android-x86%2Fexternal-mesa.git 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-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke Reviewed-by: Timothy Arceri (cherry picked from commit 398428f40684addd0a1465cf268436e8b1865351) --- diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index a57ca5a0007..02b3e00ed28 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -3851,6 +3851,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. */