summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/glsl/linker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index de569453ee4..ef8db563bb2 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3094,6 +3094,10 @@ link_calculate_subroutine_compat(struct gl_shader_program *prog)
continue;
count = 0;
+ if (sh->NumSubroutineFunctions == 0) {
+ linker_error(prog, "subroutine uniform %s defined but no valid functions found\n", uni->type->name);
+ continue;
+ }
for (unsigned f = 0; f < sh->NumSubroutineFunctions; f++) {
struct gl_subroutine_function *fn = &sh->SubroutineFunctions[f];
for (int k = 0; k < fn->num_compat_types; k++) {