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; }