Mesa (main): panfrost: Pass through alpha_zero_nop/one_store

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 26 19:15:31 UTC 2021


Module: Mesa
Branch: main
Commit: 77928e45ebb7b1d298e67abb2446eee24a6d0d98
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=77928e45ebb7b1d298e67abb2446eee24a6d0d98

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Sun Oct 24 19:14:42 2021 -0400

panfrost: Pass through alpha_zero_nop/one_store

Compute whether these flags can be set when constructing the blend CSO
and pass them in the appropriate place in the Internal Blend Descriptor.

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

---

 src/gallium/drivers/panfrost/pan_blend_cso.h |  2 ++
 src/gallium/drivers/panfrost/pan_cmdstream.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_blend_cso.h b/src/gallium/drivers/panfrost/pan_blend_cso.h
index 6edcd9373cf..1d59df41d6a 100644
--- a/src/gallium/drivers/panfrost/pan_blend_cso.h
+++ b/src/gallium/drivers/panfrost/pan_blend_cso.h
@@ -40,6 +40,8 @@ struct pan_blend_info {
         bool no_colour : 1;
         bool load_dest : 1;
         bool opaque : 1;
+        bool alpha_zero_nop : 1;
+        bool alpha_one_store : 1;
 };
 
 struct panfrost_blend_state {
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index a2f2cbf6f35..92ca4fdb250 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -359,6 +359,11 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, mali_ptr *blend_sha
                                 cfg.fixed_function.conversion.register_format =
                                         fs->info.bifrost.blend[i].format;
                                 cfg.fixed_function.rt = i;
+
+                                if (!info.opaque) {
+                                        cfg.fixed_function.alpha_zero_nop = info.alpha_zero_nop;
+                                        cfg.fixed_function.alpha_one_store = info.alpha_one_store;
+                                }
                         }
                 }
 #endif
@@ -3468,7 +3473,10 @@ panfrost_create_blend_state(struct pipe_context *pipe,
                                 pan_blend_can_fixed_function(equation,
                                                              supports_2src) &&
                                 (!constant_mask ||
-                                 pan_blend_supports_constant(PAN_ARCH, c))
+                                 pan_blend_supports_constant(PAN_ARCH, c)),
+
+                        .alpha_zero_nop = pan_blend_alpha_zero_nop(equation),
+                        .alpha_one_store = pan_blend_alpha_one_store(equation),
                 };
 
                 so->pan.rts[c].equation = equation;



More information about the mesa-commit mailing list