panfrost: Document MALI_WRITES_GLOBAL bit
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 2 Jun 2020 18:05:34 +0000 (14:05 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 20:48:24 +0000 (20:48 +0000)
We've been setting this unconditionally -- oops!

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

src/gallium/drivers/panfrost/pan_cmdstream.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c

index 14d013f08c9873067c49e9be374548d9cc39bd4f..6edc7a80ed7c0ed6936a02ef69eb67e16506d950 100644 (file)
@@ -353,7 +353,7 @@ panfrost_shader_meta_init(struct panfrost_context *ctx,
                 /* TODO: This is not conformant on ES3 */
                 meta->midgard1.flags_hi = MALI_SUPPRESS_INF_NAN;
 
-                meta->midgard1.flags_lo = 0x220;
+                meta->midgard1.flags_lo = MALI_WRITES_GLOBAL | 0x20;
                 meta->midgard1.uniform_buffer_count = panfrost_ubo_count(ctx, st);
         }
 }
index 66db429e3b9f99c18e493a4b0c809c6a1169415f..0829b9bfb5791bd1048fe0a1b441c319b8cee1ba 100644 (file)
@@ -408,6 +408,13 @@ enum mali_format {
  * it might read depth/stencil in particular, also set MALI_READS_ZS */
 
 #define MALI_READS_ZS (1 << 8)
+
+/* The shader might write to global memory (via OpenCL, SSBOs, or images).
+ * Reading is okay, as are ordinary writes to the tilebuffer/varyings. Setting
+ * incurs a performance penalty. On a fragment shader, this bit implies there
+ * are side effects, hence it interacts with early-z. */
+#define MALI_WRITES_GLOBAL (1 << 9)
+
 #define MALI_READS_TILEBUFFER (1 << 12)
 
 /* Applies to midgard1.flags_hi */
index f9bfa190fbf11fe81c84c5d0b5b91a9e58ed54c0..8358603feaf72435ebcef9a60ad62b8af2dbd00f 100644 (file)
@@ -274,6 +274,7 @@ static const struct pandecode_flag_info shader_midgard1_flag_lo_info [] = {
         FLAG_INFO(WRITES_Z),
         FLAG_INFO(EARLY_Z),
         FLAG_INFO(READS_TILEBUFFER),
+        FLAG_INFO(WRITES_GLOBAL),
         FLAG_INFO(READS_ZS),
         {}
 };