OSDN Git Service

glsl: Fix location bias for patch variables.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 24 Jun 2016 07:09:00 +0000 (00:09 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 09:06:23 +0000 (10:06 +0100)
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>
(cherry picked from commit 398428f40684addd0a1465cf268436e8b1865351)

src/compiler/glsl/linker.cpp

index a57ca5a..02b3e00 100644 (file)
@@ -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.
        */