Module: Mesa
Branch: main
Commit: d157cd7442a57569f4c1e3a6d4d1ce56380126ff
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d157cd7442a57569f4c1e3a6d4d1ce56380126ff

Author: Jesse Natalie <[email protected]>
Date:   Wed Dec  6 14:05:39 2023 -0800

microsoft/clc: One more image lowering fix

Bindings are not necessarily globally unique, and even the location
where we were trying to read the binding value out of is a union, so
we could be trying to compare binding values against data for other
arg types.

Instead, use the arg metadata offset, which is globally unique and
outside of the union.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26555>

---

 src/microsoft/clc/clc_compiler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/microsoft/clc/clc_compiler.c b/src/microsoft/clc/clc_compiler.c
index 3635fb960eb..29561e4aa02 100644
--- a/src/microsoft/clc/clc_compiler.c
+++ b/src/microsoft/clc/clc_compiler.c
@@ -136,7 +136,7 @@ clc_lower_input_image_deref(nir_builder *b, struct 
clc_image_lower_context *cont
    nir_variable *in_var = nir_deref_instr_get_variable(context->deref);
 
    context->metadata_index = 0;
-   while (context->metadata->args[context->metadata_index].image.buf_ids[0] != 
in_var->data.binding)
+   while (context->metadata->args[context->metadata_index].offset != 
in_var->data.driver_location)
       context->metadata_index++;
 
    context->num_buf_ids = 
context->metadata->args[context->metadata_index].image.num_buf_ids;

Reply via email to