diff options
author | Dave Airlie <[email protected]> | 2016-05-06 11:37:06 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-05-23 16:19:56 +1000 |
commit | 18b0a13e803d740e52f1205b690e30cd119bcf87 (patch) | |
tree | 6cefcd2b8688f3015aea65eb986033ac3b8f07ae /src/compiler | |
parent | b572b599efb29f1d28ab0595b762e2d24012d9ed (diff) |
glsl: produce a linker error for a subroutine uniform with no functions.
If a subroutine uniform is declared with no functions backing it,
that isn't legal, so we should fail to link.
Fixes:
GL43-CTS.shader_subroutine.subroutine_uniform_wo_matching_subroutines
Reviewed-by: Chris Forbes <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 4 |
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++) { |