diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 93335506d44..a5478a5c110 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -3830,6 +3830,10 @@ bifrost_compile_shader_nir(nir_shader *nir, /* Analyze after scheduling since we depend on instruction order. */ bi_analyze_helper_terminate(ctx); + /* A register is preloaded <==> it is live before the first block */ + bi_block *first_block = list_first_entry(&ctx->blocks, bi_block, link); + info->preload = first_block->reg_live_in; + if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal) bi_print_shader(ctx, stdout); diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 8d6bb1f95b3..a5b8b60efc6 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -204,6 +204,9 @@ struct pan_shader_info { unsigned tls_size; unsigned wls_size; + /* Bit mask of preloaded registers */ + uint64_t preload; + union { struct { bool reads_frag_coord;