zink: fix OpenCL read_write images

With OpenCL read_write images enabled we can actually hit image_loads.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30242>
This commit is contained in:
Karol Herbst
2024-07-18 23:06:56 +02:00
committed by Marge Bot
parent 52cf610975
commit 3d0ec53275

View File

@@ -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));