From 56233d338bd6dc77445c99800f2e292d3d54ed92 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Thu, 30 Jan 2025 13:08:13 +0000 Subject: [PATCH] pan/bi: Use 2D dimension with TEX_FETCH with CUBE on Valhall TEX_FETCH doesn't have the CUBE dimension, this was working on v9 and v10 but this fails on Avalon. Signed-off-by: Mary Guillemard Fixes: ce52b6d35975 ("pan/bi: Rework indices for tex on Valhall") Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Boris Brezillon Reviewed-by: Erik Faye-Lund Part-of: (cherry picked from commit 135aeddc9b697f8b6a4f89358107b865799bdbc7) --- .pick_status.json | 2 +- src/panfrost/compiler/bifrost_compile.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 1bd8cdaa456..f3e7637db95 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -124,7 +124,7 @@ "description": "pan/bi: Use 2D dimension with TEX_FETCH with CUBE on Valhall", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ce52b6d35975c82077d5d2efe8430063fa2a4abc", "notes": null diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index d4559440e83..8f12fd9a837 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -4128,10 +4128,16 @@ bi_emit_tex_valhall(bi_builder *b, nir_tex_instr *instr) !narrow_indices, mask, sr_count); break; case nir_texop_txf: - case nir_texop_txf_ms: + case nir_texop_txf_ms: { + /* On Valhall, TEX_FETCH doesn't have CUBE support. This is not a problem + * as a cube is just a 2D array in any cases. */ + if (dim == BI_DIMENSION_CUBE) + dim = BI_DIMENSION_2D; + bi_tex_fetch_to(b, dest, idx, src0, src1, instr->is_array, dim, regfmt, explicit_offset, !narrow_indices, mask, sr_count); break; + } case nir_texop_tg4: bi_tex_gather_to(b, dest, idx, src0, src1, instr->is_array, dim, instr->component, false, regfmt, instr->is_shadow,