From f592483350dc49096e421f3cb11568cfc364d010 Mon Sep 17 00:00:00 2001 From: Mark Collins Date: Wed, 13 Mar 2024 12:31:15 +0000 Subject: [PATCH] tu/shader: Allow LRZ when write pos with explicit early frag test This is an exceptional case where any writes to gl_Depth should be ignored, it means we can use LRZ in this case and don't need to disable it. Signed-off-by: Mark Collins Part-of: --- src/freedreno/vulkan/tu_shader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc index 5e49e1db69d..7002940e831 100644 --- a/src/freedreno/vulkan/tu_shader.cc +++ b/src/freedreno/vulkan/tu_shader.cc @@ -2539,7 +2539,7 @@ tu_shader_create(struct tu_device *dev, shader->fs.has_fdm = key->fragment_density_map; if (fs->has_kill) shader->fs.lrz.status |= TU_LRZ_FORCE_DISABLE_WRITE; - if (fs->no_earlyz || fs->writes_pos) + if (fs->no_earlyz || (fs->writes_pos && !fs->fs.early_fragment_tests)) shader->fs.lrz.status = TU_LRZ_FORCE_DISABLE_LRZ; /* FDM isn't compatible with LRZ, because the LRZ image uses the original * resolution and we would need to use the low resolution.