From 95f11b74f5583cb7def49c505b9cc0b05a24b57b Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 28 Nov 2025 19:45:13 -0500 Subject: [PATCH] pan/bi: Fix LD_VAR_BUF indirect offset calculations We multiply by 16 correctly but then drop that in the case where vbase is non-zero. We typically lower FS input indirects so we don't see this often but there are a few cases where they still sneak through. Fixes: 0fcddd4d2c40 ("pan/bi: Rework varying linking on Valhall") Reviewed-by: Boris Brezillon Part-of: (cherry picked from commit 83f90b0760bd355cd77316711da73f7c7ec33567) --- .pick_status.json | 2 +- src/panfrost/compiler/bifrost_compile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 30038db0a2d..9c7032bf6d0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -244,7 +244,7 @@ "description": "pan/bi: Fix LD_VAR_BUF indirect offset calculations", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0fcddd4d2c401a7678139456702cbe15288eebf1", "notes": null diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 9d3af5188b8..98a33b3784d 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -692,7 +692,7 @@ bi_emit_load_vary(bi_builder *b, nir_intrinsic_instr *instr) unsigned vbase = bi_varying_base_bytes(b->shader, instr); if (vbase != 0) - idx_bytes = bi_iadd_u32(b, idx, bi_imm_u32(vbase), false); + idx_bytes = bi_iadd_u32(b, idx_bytes, bi_imm_u32(vbase), false); bi_ld_var_buf_to(b, sz, dest, src0, idx_bytes, regfmt, sample, source_format, update, vecsize);