panfrost: Determine classes for stores
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 13 May 2020 16:23:53 +0000 (12:23 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Jun 2020 15:46:23 +0000 (15:46 +0000)
Fewer special cases here, thankfully.

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

src/panfrost/util/pan_lower_framebuffer.c
src/panfrost/util/pan_lower_framebuffer.h

index 33c1d5af75dca30db67589cc470c7a11184f05b8..6ceb2e47a8ac09fcc916c6e22a577ac8a729632e 100644 (file)
@@ -113,3 +113,15 @@ pan_format_class_load(const struct util_format_description *desc, unsigned quirk
         /* Otherwise, we can do native */
         return PAN_FORMAT_NATIVE;
 }
+
+enum pan_format_class
+pan_format_class_store(const struct util_format_description *desc, unsigned quirks)
+{
+        /* Check if we can do anything better than software architecturally */
+        if (quirks & MIDGARD_NO_TYPED_BLEND_STORES) {
+                return (quirks & NO_BLEND_PACKS)
+                        ? PAN_FORMAT_SOFTWARE : PAN_FORMAT_PACK;
+        }
+
+        return PAN_FORMAT_NATIVE;
+}
index 7bca12f561a8e7ebfeaba590655e9da2a8cd8c06..3804ff4beb9bf6e60a8854ec25812fc090e993c4 100644 (file)
@@ -41,5 +41,6 @@ enum pan_format_class {
 
 nir_alu_type pan_unpacked_type_for_format(const struct util_format_description *desc);
 enum pan_format_class pan_format_class_load(const struct util_format_description *desc, unsigned quirks);
+enum pan_format_class pan_format_class_store(const struct util_format_description *desc, unsigned quirks);
 
 #endif