tu: Disable LRZ write when alpha-to-coverage is enabled

Alpha-to-coverage acts like discard and happens after FS ends,
so like with discard LRZ write should be disabled.
With discard we don't know at the moment of binning whether
fragment would be not discarded, so we cannot write its depth to LRZ.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6876

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18083>
(cherry picked from commit c45fded26b)
This commit is contained in:
Danylo Piliaiev
2022-08-16 16:45:39 +03:00
committed by Dylan Baker
parent 2bb0d73816
commit 0766a4ca0d
2 changed files with 2 additions and 2 deletions

View File

@@ -733,7 +733,7 @@
"description": "tu: Disable LRZ write when alpha-to-coverage is enabled",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -3568,7 +3568,7 @@ tu_pipeline_builder_parse_depth_stencil(struct tu_pipeline_builder *builder,
if (builder->shaders->variants[MESA_SHADER_FRAGMENT]) {
const struct ir3_shader_variant *fs = builder->shaders->variants[MESA_SHADER_FRAGMENT];
if (fs->has_kill || fs->no_earlyz || fs->writes_pos) {
if (fs->has_kill || builder->alpha_to_coverage) {
pipeline->lrz.force_disable_mask |= TU_LRZ_FORCE_DISABLE_WRITE;
}
if (fs->no_earlyz || fs->writes_pos) {