Mesa (main): pan/bi: Avoid masked writes for now

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 14:35:00 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Mar 23 12:21:12 2022 -0400

pan/bi: Avoid masked writes for now

Our swizzle lowering optimizations depend on replication of scalar fp16. This
holds on Bifrost (at least for now), but not on Valhall which has proper support
for write masks. For now, enforce Bifrost-compatible behaviour as we do not make
use of the write masks on Valhall yet.

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

---

 src/panfrost/bifrost/bi_lower_swizzle.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/panfrost/bifrost/bi_lower_swizzle.c b/src/panfrost/bifrost/bi_lower_swizzle.c
index 2d79fcf83ca..f96f9fb7961 100644
--- a/src/panfrost/bifrost/bi_lower_swizzle.c
+++ b/src/panfrost/bifrost/bi_lower_swizzle.c
@@ -259,6 +259,12 @@ bi_lower_swizzle(bi_context *ctx)
                         ins->op = BI_OPCODE_MOV_I32;
                         ins->src[0].swizzle = BI_SWIZZLE_H01;
                 }
+
+                /* The above passes rely on replicating destinations.  For
+                 * Valhall, we will want to optimize this. For now, default
+                 * to Bifrost compatible behaviour.
+                 */
+                ins->dest[0].swizzle = BI_SWIZZLE_H01;
         }
 
         free(replicates_16);



More information about the mesa-commit mailing list