From 111cf7f0e82ec28aad9a3211cd252e9cc04f6dc1 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 12 Oct 2020 15:00:02 +0200 Subject: [PATCH] pan/bi: Copy blend shader info from compile_inputs Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 3 +++ src/panfrost/bifrost/compiler.h | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 2e70eed58d0..0f466a6cd47 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1651,6 +1651,9 @@ bifrost_compile_shader_nir(nir_shader *nir, panfrost_program *program, ctx->nir = nir; ctx->stage = nir->info.stage; ctx->quirks = bifrost_get_quirks(inputs->gpu_id); + ctx->is_blend = inputs->is_blend; + ctx->blend_desc = inputs->blend.bifrost_blend_desc; + memcpy(ctx->blend_constants, inputs->blend.constants, sizeof(ctx->blend_constants)); list_inithead(&ctx->blocks); /* Lower gl_Position pre-optimisation, but after lowering vars to ssa diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 04858bd6731..7b58d092945 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -445,6 +445,15 @@ typedef struct { struct panfrost_sysvals sysvals; uint32_t quirks; + /* Is internally a blend shader? Depends on stage == FRAGMENT */ + bool is_blend; + + /* Blend constants */ + float blend_constants[4]; + + /* Blend tile buffer conversion desc */ + uint64_t blend_desc; + /* During NIR->BIR */ nir_function_impl *impl; bi_block *current_block;