From c45fded26b8c858d1974a8b4017200b1cbe92d31 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: --- src/freedreno/vulkan/tu_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 412152d3858..699d8c7b922 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -3625,7 +3625,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) {