Mesa (master): panfrost: Pass is_blit flag around

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 12 12:45:34 UTC 2021


Module: Mesa
Branch: master
Commit: e279606232ea2e7d4eea746ce33a989935a9ef5d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e279606232ea2e7d4eea746ce33a989935a9ef5d

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Feb 11 21:32:39 2021 -0500

panfrost: Pass is_blit flag around

There are blit shader specific optimizations available.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9002>

---

 src/panfrost/bifrost/bifrost_compile.c | 1 +
 src/panfrost/bifrost/compiler.h        | 4 ++--
 src/panfrost/lib/pan_blit.c            | 1 +
 src/panfrost/util/pan_ir.h             | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 52b3232386d..e81f7757aa5 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -2445,6 +2445,7 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir,
         ctx->quirks = bifrost_get_quirks(inputs->gpu_id);
         ctx->arch = inputs->gpu_id >> 12;
         ctx->is_blend = inputs->is_blend;
+        ctx->is_blit = inputs->is_blit;
         ctx->blend_desc = inputs->blend.bifrost_blend_desc;
         ctx->push = &program->push;
         memcpy(ctx->blend_constants, inputs->blend.constants, sizeof(ctx->blend_constants));
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 0009d2c97d2..278006ad054 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -503,8 +503,8 @@ typedef struct {
        unsigned arch;
        unsigned tls_size;
 
-       /* Is internally a blend shader? Depends on stage == FRAGMENT */
-       bool is_blend;
+       /* Is internally a blend/blit shader? Depends on stage == FRAGMENT */
+       bool is_blend, is_blit;
 
        /* Blend constants */
        float blend_constants[4];
diff --git a/src/panfrost/lib/pan_blit.c b/src/panfrost/lib/pan_blit.c
index af6ff75706d..02d55663d53 100644
--- a/src/panfrost/lib/pan_blit.c
+++ b/src/panfrost/lib/pan_blit.c
@@ -104,6 +104,7 @@ panfrost_build_blit_shader(struct panfrost_device *dev,
 
         struct panfrost_compile_inputs inputs = {
                 .gpu_id = dev->gpu_id,
+                .is_blit = true,
         };
 
         panfrost_program *program =
diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h
index 9622a4bc890..c5132754299 100644
--- a/src/panfrost/util/pan_ir.h
+++ b/src/panfrost/util/pan_ir.h
@@ -145,7 +145,7 @@ typedef struct {
 
 struct panfrost_compile_inputs {
         unsigned gpu_id;
-        bool is_blend;
+        bool is_blend, is_blit;
         struct {
                 unsigned rt;
                 unsigned nr_samples;



More information about the mesa-commit mailing list