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 <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29453>
This commit is contained in:
Mark Collins
2024-03-13 12:31:15 +00:00
committed by Marge Bot
parent 84b74599cb
commit f592483350
+1 -1
View File
@@ -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.