mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
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 <jordan.l.justen@intel.com>
This commit is contained in:
parent
5a79bdab30
commit
1fe274b3d7
1 changed files with 7 additions and 0 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue