From 89b49d479cbc25e4b37ac6ddee393619c267dbb5 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 28 Sep 2022 22:25:59 +0200 Subject: [PATCH] rusticl: make image format/order work on radeonsi Signed-off-by: Karol Herbst Part-of: --- src/gallium/frontends/rusticl/rusticl_nir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/frontends/rusticl/rusticl_nir.c b/src/gallium/frontends/rusticl/rusticl_nir.c index 71e131c..ae3ed2a 100644 --- a/src/gallium/frontends/rusticl/rusticl_nir.c +++ b/src/gallium/frontends/rusticl/rusticl_nir.c @@ -39,6 +39,14 @@ rusticl_lower_intrinsics_instr( } val = intrins->src[0].ssa; + + if (val->parent_instr->type == nir_instr_type_deref) { + nir_deref_instr *deref = nir_instr_as_deref(val->parent_instr); + nir_variable *var = nir_deref_instr_get_variable(deref); + assert(var); + val = nir_imm_intN_t(b, var->data.binding, val->bit_size); + } + // we put write images after read images if (glsl_type_is_image(var->type)) { val = nir_iadd_imm(b, val, b->shader->info.num_textures); -- 2.7.4