[Mesa-dev] [PATCH 1/6] panfrost/decode: Add flags for tilebuffer readback

Alyssa Rosenzweig alyssa at rosenzweig.io
Fri Apr 5 05:56:22 UTC 2019


These flags are set when reading back the tilebuffer from a fragment
shader via various mechanisms (including ARM_shader_framebuffer_fetch
and EXT_pixel_local_storage).

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 .../drivers/panfrost/include/panfrost-job.h     |  7 +++++++
 src/gallium/drivers/panfrost/pandecode/decode.c | 17 ++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index f0a4de73085..2f739bf22ba 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -408,6 +408,13 @@ enum mali_format {
 /* Applies to unknown1 */
 #define MALI_NO_ALPHA_TO_COVERAGE (1 << 10)
 
+/* Flags denoting the fragment shader's use of tilebuffer readback. If the
+ * shader might read any part of the tilebuffer, set MALI_READS_TILEBUFFER. If
+ * it might read depth/stencil in particular, also set MALI_READS_ZS */
+
+#define MALI_READS_ZS (1 << 12)
+#define MALI_READS_TILEBUFFER (1 << 16)
+
 struct mali_blend_meta {
 #ifndef BIFROST
         /* Base value of 0x200.
diff --git a/src/gallium/drivers/panfrost/pandecode/decode.c b/src/gallium/drivers/panfrost/pandecode/decode.c
index 20f789dc9f8..bb6f4b19711 100644
--- a/src/gallium/drivers/panfrost/pandecode/decode.c
+++ b/src/gallium/drivers/panfrost/pandecode/decode.c
@@ -218,6 +218,15 @@ static const struct pandecode_flag_info mfbd_extra_flag_info[] = {
 };
 #undef FLAG_INFO
 
+#define FLAG_INFO(flag) { MALI_##flag, "MALI_" #flag }
+static const struct pandecode_flag_info shader_unknown1_flag_info [] = {
+        FLAG_INFO(NO_ALPHA_TO_COVERAGE),
+        FLAG_INFO(READS_TILEBUFFER),
+        FLAG_INFO(READS_ZS),
+        {}
+};
+#undef FLAG_INFO
+
 extern char *replace_fragment;
 extern char *replace_vertex;
 
@@ -1163,9 +1172,11 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
 
                         pandecode_prop("uniform_count = %" PRId16, s->midgard1.uniform_count);
                         pandecode_prop("work_count = %" PRId16, s->midgard1.work_count);
-                        pandecode_prop("unknown1 = %s0x%" PRIx32,
-                                     s->midgard1.unknown1 & MALI_NO_ALPHA_TO_COVERAGE ? "MALI_NO_ALPHA_TO_COVERAGE | " : "",
-                                     s->midgard1.unknown1 & ~MALI_NO_ALPHA_TO_COVERAGE);
+
+                        pandecode_log(".unknown1 = ");
+                        pandecode_log_decoded_flags(shader_unknown1_flag_info, s->midgard1.unknown1);
+                        pandecode_log_cont(",\n");
+
                         pandecode_prop("unknown2 = 0x%" PRIx32, s->midgard1.unknown2);
 
                         pandecode_indent--;
-- 
2.20.1



More information about the mesa-dev mailing list