From 7fa0250f9446ec57caab581b8cac2c011c1cb497 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 17 May 2016 14:22:57 +1000 Subject: 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 Signed-off-by: Dave Airlie --- src/compiler/glsl/linker.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compiler/glsl') diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 2374c013c15..a7b2a19a66b 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); -- cgit v1.2.3