diff options
author | Paul Berry <[email protected]> | 2014-01-08 11:40:23 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-02-05 09:05:01 -0800 |
commit | 1fe274b3d7a8e70dc605e6076d29e00add292508 (patch) | |
tree | cf24d9bdfa7913e1d6cf1d6f24525c9fd21dfe70 | |
parent | 5a79bdab3008a19a770b8b84fdf5582e72db72c9 (diff) |
glsl/cs: Prohibit mixing of compute and non-compute shaders.
Fixes piglit test:
spec/ARB_compute_shader/linker/mix_compute_and_non_compute
Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r-- | src/glsl/linker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 6a07e4ab0d1..bcd7394768f 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2109,6 +2109,13 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } + /* Compute shaders have additional restrictions. */ + if (num_shaders[MESA_SHADER_COMPUTE] > 0 && + num_shaders[MESA_SHADER_COMPUTE] != prog->NumShaders) { + linker_error(prog, "Compute shaders may not be linked with any other " + "type of shader\n"); + } + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] != NULL) ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]); |