Mesa (master): pan/bi: Workaround BLEND precolour with explicit moves

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 20:54:30 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Jan  7 09:28:11 2021 -0500

pan/bi: Workaround BLEND precolour with explicit moves

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

---

 src/panfrost/bifrost/bifrost_compile.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 17fd7f8d78d..cbb3bcdffa2 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -388,9 +388,21 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr)
 
                 unsigned rt = loc == FRAG_RESULT_COLOR ? 0 :
                         (loc - FRAG_RESULT_DATA0);
+                bi_index color = bi_src_index(&instr->src[0]);
+
+                /* Explicit copy since BLEND inputs are precoloured to R0-R3,
+                 * TODO: maybe schedule around this or implement in RA as a
+                 * spill */
+                if (rt > 0) {
+                        bi_index srcs[4] = { color, color, color, color };
+                        unsigned channels[4] = { 0, 1, 2, 3 };
+                        color = bi_temp(b->shader);
+                        bi_make_vec_to(b, color, srcs, channels,
+                                       nir_src_num_components(instr->src[0]),
+                                       nir_alu_type_get_type_size(nir_intrinsic_src_type(instr)));
+                }
 
-                bi_emit_blend_op(b, bi_src_index(&instr->src[0]),
-                                nir_intrinsic_src_type(instr), rt);
+                bi_emit_blend_op(b, color, nir_intrinsic_src_type(instr), rt);
         }
 
         if (b->shader->is_blend) {



More information about the mesa-commit mailing list