glsl: count attributes for vertex inputs properly.
authorDave Airlie <airlied@redhat.com>
Mon, 12 Oct 2015 03:23:29 +0000 (13:23 +1000)
committerDave Airlie <airlied@redhat.com>
Sat, 19 Dec 2015 07:57:43 +0000 (17:57 +1000)
This function deals with vertex inputs and fragment
outputs, so we should count the attribute locations
correctly for the vertex inputs.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/glsl/linker.cpp

index ff22b3df713b08fbfd75ef419366702e446c5213..c7e69765335bce18dc487a829634a1a3da356cce 100644 (file)
@@ -2466,7 +2466,7 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
          return false;
       }
 
-      const unsigned slots = var->type->count_attribute_slots(false);
+      const unsigned slots = var->type->count_attribute_slots(target_index == MESA_SHADER_VERTEX ? true : false);
 
       /* If the variable is not a built-in and has a location statically
        * assigned in the shader (presumably via a layout qualifier), make sure