mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 19:20:12 +01:00
glsl: fix compiler global temp collisions
glsl ir creates these temps to copy global initialiser values for example. To avoid collisions during linking due to 2 shaders in the same stage having temps with the same name we make sure to define these as function variables not shader globals. This will put the temps into the global instructions wrapper created in7c5b21c032. Fixes:cbfc225e2b("glsl: switch to a full nir based linker") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12136 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32202>
This commit is contained in:
parent
25d4943481
commit
e34357015c
1 changed files with 7 additions and 4 deletions
|
|
@ -481,11 +481,14 @@ nir_visitor::visit(ir_variable *ir)
|
|||
|
||||
switch(ir->data.mode) {
|
||||
case ir_var_auto:
|
||||
case ir_var_temporary:
|
||||
if (is_global)
|
||||
if (is_global) {
|
||||
var->data.mode = nir_var_shader_temp;
|
||||
else
|
||||
var->data.mode = nir_var_function_temp;
|
||||
break;
|
||||
}
|
||||
|
||||
FALLTHROUGH;
|
||||
case ir_var_temporary:
|
||||
var->data.mode = nir_var_function_temp;
|
||||
break;
|
||||
|
||||
case ir_var_function_in:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue