summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2020-10-12 15:00:02 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2020-10-15 08:05:23 +0200
commit111cf7f0e82ec28aad9a3211cd252e9cc04f6dc1 (patch)
treebd8eda56991dbb243cd9b5f2c2dfb6bdf49228bb
parent6c61f0b8e5d1c37192fef9de83201653cc998de5 (diff)
pan/bi: Copy blend shader info from compile_inputs
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7151>
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c3
-rw-r--r--src/panfrost/bifrost/compiler.h9
2 files changed, 12 insertions, 0 deletions
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;