summaryrefslogtreecommitdiff
path: root/src/compiler/glsl/linker.cpp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-17 14:22:57 +1000
committerDave Airlie <airlied@redhat.com>2016-05-23 16:19:57 +1000
commit7fa0250f9446ec57caab581b8cac2c011c1cb497 (patch)
treea7f28af88db8317e1976ac53d23d37d4cecd10ac /src/compiler/glsl/linker.cpp
parent22db9b10ebd46c777a87da890f5089ad24686441 (diff)
mesa/subroutines: count number subroutines properly.
The code was implementing the ACTIVE_SUBROUTINE_UNIFORMS incorrectly, using the number of types not the number of uniforms. This is different than the locations as the locations may be sparsly allocated. This fixes: GL43-CTS.shader_subroutine.four_subroutines_with_two_uniforms Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r--src/compiler/glsl/linker.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 2374c013c1..a7b2a19a66 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3096,6 +3096,7 @@ link_calculate_subroutine_compat(struct gl_shader_program *prog)
if (!uni)
continue;
+ sh->NumSubroutineUniforms++;
count = 0;
if (sh->NumSubroutineFunctions == 0) {
linker_error(prog, "subroutine uniform %s defined but no valid functions found\n", uni->type->name);