mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 12:50:10 +01:00
nir: check shader type before writing to shaderinfo.tess union
If the shader is not a tesselation shader, then writing to the tess
member of the shaderinfo union will overwrite other members and crash.
Closes: #2722
Fixes: f1dd81ae10 ("nir: Collect if shader uses cross-invocation or indirect I/O.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4408>
This commit is contained in:
parent
e47bf7dadf
commit
90a8b458ac
1 changed files with 2 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ set_io_mask(nir_shader *shader, nir_variable *var, int offset, int len,
|
|||
shader->info.inputs_read_indirectly |= bitfield;
|
||||
}
|
||||
|
||||
if (cross_invocation)
|
||||
if (cross_invocation && shader->info.stage == MESA_SHADER_TESS_CTRL)
|
||||
shader->info.tess.tcs_cross_invocation_inputs_read |= bitfield;
|
||||
|
||||
if (shader->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
|
|
@ -125,7 +125,7 @@ set_io_mask(nir_shader *shader, nir_variable *var, int offset, int len,
|
|||
shader->info.outputs_accessed_indirectly |= bitfield;
|
||||
}
|
||||
|
||||
if (cross_invocation)
|
||||
if (cross_invocation && shader->info.stage == MESA_SHADER_TESS_CTRL)
|
||||
shader->info.tess.tcs_cross_invocation_outputs_read |= bitfield;
|
||||
} else {
|
||||
if (is_patch_generic) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue