mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
nir: convert unused mesh outputs to shared memory
Otherwise reads from output in one subgroup may not see writes from other subgroups. Temp variables are later converted to scratch, so even within one subgroup we may not see correct values. Test case in https://gitlab.freedesktop.org/mesa/crucible/-/merge_requests/115 Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17517>
This commit is contained in:
parent
e3e43cebff
commit
5e14445430
1 changed files with 5 additions and 1 deletions
|
|
@ -161,8 +161,12 @@ nir_remove_unused_io_vars(nir_shader *shader,
|
|||
|
||||
if (!(other_stage & get_variable_io_mask(var, shader->info.stage))) {
|
||||
/* This one is invalid, make it a global variable instead */
|
||||
if (shader->info.stage == MESA_SHADER_MESH &&
|
||||
(shader->info.outputs_read & BITFIELD64_BIT(var->data.location)))
|
||||
var->data.mode = nir_var_mem_shared;
|
||||
else
|
||||
var->data.mode = nir_var_shader_temp;
|
||||
var->data.location = 0;
|
||||
var->data.mode = nir_var_shader_temp;
|
||||
|
||||
progress = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue