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 <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
This commit is contained in:
Alyssa Rosenzweig
2021-05-14 19:31:27 -04:00
committed by Marge Bot
parent 876de2831f
commit 8f2b2bcff4
2 changed files with 6 additions and 3 deletions

View 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;
}

View 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: