Mesa (master): glsl: count attributes for vertex inputs properly.

Dave Airlie airlied at kemper.freedesktop.org
Sat Dec 19 07:58:19 UTC 2015


Module: Mesa
Branch: master
Commit: 97eee905471d7426d23c8a4c48b9810c586f9dff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=97eee905471d7426d23c8a4c48b9810c586f9dff

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Oct 12 13:23:29 2015 +1000

glsl: count attributes for vertex inputs properly.

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 at collabora.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/glsl/linker.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index ff22b3d..c7e6976 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -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




More information about the mesa-commit mailing list