diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index b5869696791..3d28e15f661 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -384,6 +384,7 @@ bi_register_allocate(bi_context *ctx) assert(success); + ctx->tls_size = spill_count; bi_install_registers(ctx, l); lcra_free(l); diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index fc71e5c5786..99f4a1634bc 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1966,6 +1966,8 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir, if (bifrost_debug & BIFROST_DBG_SHADERS) disassemble_bifrost(stdout, program->compiled.data, program->compiled.size, true); + program->tls_size = ctx->tls_size; + ralloc_free(ctx); return program; diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 1fc0d03ff36..176f7fd858a 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -450,6 +450,7 @@ typedef struct { struct list_head blocks; /* list of bi_block */ struct panfrost_sysvals sysvals; uint32_t quirks; + unsigned tls_size; /* Is internally a blend shader? Depends on stage == FRAGMENT */ bool is_blend;