From 870ce2275447dcf49096df35f81d974ce8e1fa5c Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 17 Sep 2025 13:30:19 +1000 Subject: [PATCH] nir: fix uniform cloning helper again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: b47b8d16d947 ("nir: expose reusable linking helpers for cloning uniform loads") Reviewed-by: Alejandro PiƱeiro Part-of: --- src/compiler/nir/nir_linking_helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 5d1e925e0f1..ef593544c35 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -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;