From a1d5bf0a7a7b9422fe94920fe7eaa8fd68886005 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 24 Mar 2022 16:39:52 -0400 Subject: [PATCH] pan/bi: Track whether the malloc IDVS flow is used This affects what instructions the fragment shader uses. Will be used for the legacy geometry flow in blit shaders. Whether that is a good idea remains to be seen, admittedly. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 1 + src/panfrost/bifrost/compiler.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 9942ff6567b..8308ef633fc 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -4336,6 +4336,7 @@ bi_compile_variant_nir(nir_shader *nir, ctx->arch = inputs->gpu_id >> 12; ctx->info = info; ctx->idvs = idvs; + ctx->malloc_idvs = (ctx->arch >= 9) && !inputs->no_idvs; if (idvs != BI_IDVS_NONE) { /* Specializing shaders for IDVS is destructive, so we need to diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 920e18900f0..04a3838a4d7 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -728,6 +728,12 @@ typedef struct { unsigned arch; enum bi_idvs_mode idvs; + /* In any graphics shader, whether the "IDVS with memory + * allocation" flow is used. This affects how varyings are loaded and + * stored. Ignore for compute. + */ + bool malloc_idvs; + /* During NIR->BIR */ bi_block *current_block; bi_block *after_block;