From 8f2b2bcff48b7c04fbd48a6f83249f4ed29cc449 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 14 May 2021 19:31:27 -0400 Subject: [PATCH] panfrost: Hoist part of shader_reads_tilebuffer 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 Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 3 +-- src/panfrost/lib/pan_shader.h | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 813fe899626..c23c2e7a9db 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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; } diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h index 732e0fc821e..c31c35dfc6d 100644 --- a/src/panfrost/lib/pan_shader.h +++ b/src/panfrost/lib/pan_shader.h @@ -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: