From 3d0ec53275a3553d86ea251038960fd2dc540f48 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 18 Jul 2024 23:06:56 +0200 Subject: [PATCH] zink: fix OpenCL read_write images With OpenCL read_write images enabled we can actually hit image_loads. Reviewed-by: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 2fb0b8098c4..3e2099fbc4f 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -5049,7 +5049,13 @@ type_image(nir_shader *nir, nir_variable *var) nir_variable *img = nir_deref_instr_get_variable(deref); if (img != var) continue; - nir_alu_type alu_type = nir_intrinsic_src_type(intr); + + nir_alu_type alu_type; + if (nir_intrinsic_has_src_type(intr)) + alu_type = nir_intrinsic_src_type(intr); + else + alu_type = nir_intrinsic_dest_type(intr); + const struct glsl_type *type = glsl_without_array(var->type); if (glsl_get_sampler_result_type(type) != GLSL_TYPE_VOID) { assert(glsl_get_sampler_result_type(type) == nir_get_glsl_base_type_for_nir_type(alu_type));