nir: fix uniform cloning helper again
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

UBOs in different stages can have the same instance name for
different UBOs so here we make sure to also check that types match
before deciding we have a match.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13254
Fixes: b47b8d16d9 ("nir: expose reusable linking helpers for cloning uniform loads")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37428>
This commit is contained in:
Timothy Arceri 2025-09-17 13:30:19 +10:00 committed by Marge Bot
parent b9a1bcd3a1
commit 870ce22754

View file

@ -1173,6 +1173,7 @@ nir_clone_uniform_variable(nir_shader *nir, nir_variable *uniform, bool spirv)
v->data.binding == uniform->data.binding) ||
(!spirv &&
(!strcmp(uniform->name, v->name) &&
glsl_type_compare_no_precision(uniform->type, v->type) &&
uniform->data.explicit_binding == v->data.explicit_binding &&
uniform->data.binding == v->data.binding))) {
new_var = v;