panfrost: Always use SOFTWARE for pure formats
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 10 Jul 2020 16:12:36 +0000 (12:12 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jul 2020 13:35:11 +0000 (13:35 +0000)
Otherwise we end up implicitly converting ints to floating point.
Likewise for floats which again have strange interactions.

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

src/panfrost/util/pan_lower_framebuffer.c

index a8bc759225e02e6ea6405745f169ba0249de2d17..3295d5697e08f93ff4081f0c025e2d5da510ea69 100644 (file)
@@ -89,6 +89,15 @@ 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)
 {
+        /* Pure integers can be loaded via EXT_framebuffer_fetch and should be
+         * handled as a raw load with a size conversion (it's cheap). Likewise,
+         * since float framebuffers are internally implemented as raw (i.e.
+         * integer) framebuffers with blend shaders to go back and forth, they
+         * should be s/w as well */
+
+        if (util_format_is_pure_integer(desc->format) || util_format_is_float(desc->format))
+                return PAN_FORMAT_SOFTWARE;
+
         /* Check if we can do anything better than software architecturally */
         if (quirks & MIDGARD_NO_TYPED_BLEND_LOADS) {
                 return (quirks & NO_BLEND_PACKS)