From 0766a4ca0d617c0c22b7ff7ad0daf8e723f2a248 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Tue, 16 Aug 2022 16:45:39 +0300 Subject: [PATCH] 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 Part-of: (cherry picked from commit c45fded26b8c858d1974a8b4017200b1cbe92d31) --- .pick_status.json | 2 +- src/freedreno/vulkan/tu_pipeline.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0c4df1b7144..1bdf20b32b6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 }, diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index e436d037fec..73d90cebc12 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -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) {