From 510d3ab93d2288bd03380b1f17909074ebed0a55 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 25 Feb 2023 23:02:17 -0500 Subject: [PATCH] pan/bi: Use lower_index_to_offset Instead of doing the add ourselves. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Reviewed-by: Emma Anholt Part-of: --- src/panfrost/compiler/bifrost_compile.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index daf8d160e9c..30ff3d6c2aa 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -3509,19 +3509,10 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr) break; case nir_tex_src_texture_offset: - if (instr->texture_index) - index = - bi_iadd_u32(b, index, bi_imm_u32(instr->texture_index), false); - dregs[BIFROST_TEX_DREG_TEXTURE] = index; - break; case nir_tex_src_sampler_offset: - if (instr->sampler_index) - index = - bi_iadd_u32(b, index, bi_imm_u32(instr->sampler_index), false); - dregs[BIFROST_TEX_DREG_SAMPLER] = index; break; @@ -3697,12 +3688,10 @@ bi_emit_tex_valhall(bi_builder *b, nir_tex_instr *instr) break; case nir_tex_src_texture_offset: - assert(instr->texture_index == 0); texture = index; break; case nir_tex_src_sampler_offset: - assert(instr->sampler_index == 0); sampler = index; break; @@ -4512,6 +4501,7 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, bool is_blend) .lower_tg4_broadcom_swizzle = true, .lower_txd = true, .lower_invalid_implicit_lod = true, + .lower_index_to_offset = true, }; NIR_PASS(progress, nir, pan_nir_lower_64bit_intrin);