mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
nir: fix uniform cloning helper
glsl allows for ubos to have the same name but different bindings. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Fixes:b47b8d16d9("nir: expose reusable linking helpers for cloning uniform loads") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12852 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34138> (cherry picked from commit2b2132d2ac)
This commit is contained in:
parent
20e09c3081
commit
de5de2ec60
2 changed files with 4 additions and 2 deletions
|
|
@ -4034,7 +4034,7 @@
|
|||
"description": "nir: fix uniform cloning helper",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "b47b8d16d94792cc4694f350b4bad212e357e9f0",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1171,7 +1171,9 @@ nir_clone_uniform_variable(nir_shader *nir, nir_variable *uniform, bool spirv)
|
|||
nir_foreach_variable_with_modes(v, nir, uniform->data.mode) {
|
||||
if ((spirv && uniform->data.mode & nir_var_mem_ubo &&
|
||||
v->data.binding == uniform->data.binding) ||
|
||||
(!spirv && !strcmp(uniform->name, v->name))) {
|
||||
(!spirv &&
|
||||
((!strcmp(uniform->name, v->name) && !uniform->data.explicit_binding && !v->data.explicit_binding) ||
|
||||
(uniform->data.explicit_binding && v->data.explicit_binding && v->data.binding == uniform->data.binding)))) {
|
||||
new_var = v;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue