mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 09:10:11 +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>
This commit is contained in:
parent
786b8b2d34
commit
2b2132d2ac
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
nir_foreach_variable_with_modes(v, nir, uniform->data.mode) {
|
||||||
if ((spirv && uniform->data.mode & nir_var_mem_ubo &&
|
if ((spirv && uniform->data.mode & nir_var_mem_ubo &&
|
||||||
v->data.binding == uniform->data.binding) ||
|
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;
|
new_var = v;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue