aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-25 14:00:17 -0400
committerMarge Bot <[email protected]>2020-06-03 15:36:57 +0000
commitafc18c62d795cb29bdddebed0e5ccadc727ddbcb (patch)
tree137ac6e01b1c2cc2faa9d222cc9a88a385030b1f /src/panfrost
parent36af05bbdef4e91a1d0616752150ae00ad0dceb5 (diff)
panfrost: Passthrough NATIVE loads/stores
Now that we handle load_output directly, this works for e.g. RGB565 on Midgard. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5285>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/util/pan_lower_framebuffer.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c
index fe20be1c3f9..6e704f7763c 100644
--- a/src/panfrost/util/pan_lower_framebuffer.c
+++ b/src/panfrost/util/pan_lower_framebuffer.c
@@ -126,6 +126,17 @@ pan_format_class_store(const struct util_format_description *desc, unsigned quir
return PAN_FORMAT_NATIVE;
}
+/* Convenience method */
+
+static enum pan_format_class
+pan_format_class(const struct util_format_description *desc, unsigned quirks, bool is_store)
+{
+ if (is_store)
+ return pan_format_class_store(desc, quirks);
+ else
+ return pan_format_class_load(desc, quirks);
+}
+
/* Software packs/unpacks, by format class. Packs take in the pixel value typed
* as `pan_unpacked_type_for_format` of the format and return an i32vec4
* suitable for storing (with components replicated to fill). Unpacks do the
@@ -668,6 +679,13 @@ pan_lower_framebuffer(nir_shader *shader,
if (!(is_load || is_store))
continue;
+ enum pan_format_class fmt_class =
+ pan_format_class(desc, quirks, is_store);
+
+ /* Don't lower */
+ if (fmt_class == PAN_FORMAT_NATIVE)
+ continue;
+
/* Don't worry about MRT */
nir_variable *var = nir_intrinsic_get_var(intr, 0);