From 275ebde06d51704790a7b7137a1b43fb1f6360e4 Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Thu, 18 Sep 2025 07:50:20 -0700 Subject: [PATCH] pan/va: fix bi_is_imm_desc_handle early return In the bi_emit_load_attr call site, we can use the imm_index value even if the function returns false. The bifrost path handles this correctly. Fixes: 652e1c2e139 ("pan/bi: Rework indices for attributes on Valhall") Signed-off-by: Olivia Lee Reviewed-by: Mary Guillemard Part-of: --- src/panfrost/compiler/bifrost_compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 8990f2154ed..9d3af5188b8 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -458,10 +458,11 @@ bi_is_imm_desc_handle(bi_builder *b, nir_intrinsic_instr *instr, uint32_t table_index = pan_res_handle_get_table(res_handle); uint32_t res_index = pan_res_handle_get_index(res_handle); + *immediate = res_handle; + if (!va_is_valid_const_table(table_index) || res_index >= max) return false; - *immediate = res_handle; return true; }