mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
mesa/glspirv: Validate that compute shaders are not linked with other stages
The test is based on link_shaders(). For example, it allows the following test (when run on SPIR-V mode) to pass: spec/arb_compute_shader/linker/mix_compute_and_non_compute.shader_test Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
parent
022e9ddd1a
commit
8419621176
1 changed files with 10 additions and 0 deletions
|
|
@ -203,6 +203,16 @@ _mesa_spirv_link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute shaders have additional restrictions. */
|
||||
if ((prog->data->linked_stages & (1 << MESA_SHADER_COMPUTE)) &&
|
||||
(prog->data->linked_stages & ~(1 << MESA_SHADER_COMPUTE))) {
|
||||
ralloc_asprintf_append(&prog->data->InfoLog,
|
||||
"Compute shaders may not be linked with any other "
|
||||
"type of shader\n");
|
||||
prog->data->LinkStatus = LINKING_FAILURE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nir_shader *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue