panfrost: Hoist part of shader_reads_tilebuffer
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 14 May 2021 23:31:27 +0000 (19:31 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 May 2021 22:51:56 +0000 (22:51 +0000)
The other part is |'d together. Do the happy path at compile time, and
reserve the draw time fixup for a v5 silicon issue.

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

src/gallium/drivers/panfrost/pan_cmdstream.c
src/panfrost/lib/pan_shader.h

index 813fe89..c23c2e7 100644 (file)
@@ -551,8 +551,7 @@ panfrost_prepare_midgard_fs_state(struct panfrost_context *ctx,
                  * lying to the hardware about the discard and setting the
                  * reads tilebuffer? flag to compensate */
                 state->properties.midgard.shader_reads_tilebuffer =
-                        fs->info.fs.outputs_read ||
-                        (!zsa->enabled && fs->info.fs.can_discard);
+                        !zsa->enabled && fs->info.fs.can_discard;
                 state->properties.midgard.shader_contains_discard =
                         zsa->enabled && fs->info.fs.can_discard;
         }
index 732e0fc..c31c35d 100644 (file)
@@ -55,8 +55,12 @@ pan_shader_prepare_midgard_rsd(const struct pan_shader_info *info,
 
         /* For fragment shaders, work register count, early-z, reads at draw-time */
 
-        if (info->stage != MESA_SHADER_FRAGMENT)
+        if (info->stage != MESA_SHADER_FRAGMENT) {
                 rsd->properties.midgard.work_register_count = info->work_reg_count;
+        } else {
+                rsd->properties.midgard.shader_reads_tilebuffer =
+                        info->fs.outputs_read;
+        }
 }
 
 /* Classify a shader into the following pixel kill categories: