Mesa (master): freedreno/a6xx: don't enable early-z/lrz if no z-test

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 14 23:41:18 UTC 2020


Module: Mesa
Branch: master
Commit: 2e4bab84fb6ee09d4b85a1ce722869e27858aec6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e4bab84fb6ee09d4b85a1ce722869e27858aec6

Author: Rob Clark <robdclark at chromium.org>
Date:   Mon Jul 13 14:49:01 2020 -0700

freedreno/a6xx: don't enable early-z/lrz if no z-test

But if shader explicitly asks for early-fragment-tests, obey it's
wishes.

Fixes a handful of skia (skqp) CTS fails (9.0_r12)

* gles_bug593049
* gles_circular_arcs_fill
* gles_circular_arcs_stroke_and_fill_square
* gles_clippedcubic2
* gles_complexclip2_path_bw
* gles_complexclip2_rrect_bw
* gles_complexclip3_complex
* gles_complexclip3_simple
* gles_crbug_691386
* gles_cubicclosepath
* gles_cubicpath
* gles_degeneratesegments
* gles_filltypespersp
* gles_innershapes_bw
* gles_inverse_paths
* gles_mixedtextblobs
* gles_onebadarc
* gles_quadclosepath
* gles_quadpath
* gles_rrect_clip_bw
* gles_scale-pixels
* gles_scaledstrokes
* gles_squarehair
* gles_strokes_zoomed
* gles_windowrectangles

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5907>

---

 src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
index dd52edcc35a..3187fb1e1c8 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
@@ -588,7 +588,10 @@ compute_ztest_mode(struct fd6_emit *emit, bool lrz_valid)
 	struct fd6_zsa_stateobj *zsa = fd6_zsa_stateobj(ctx->zsa);
 	const struct ir3_shader_variant *fs = emit->fs;
 
-	if (fs->no_earlyz || fs->writes_pos) {
+	if (fs->shader->nir->info.fs.early_fragment_tests)
+		return A6XX_EARLY_Z;
+
+	if (fs->no_earlyz || fs->writes_pos || !zsa->base.depth.enabled) {
 		return A6XX_LATE_Z;
 	} else if ((fs->has_kill || zsa->alpha_test) &&
 			(zsa->base.depth.writemask || !pfb->zsbuf)) {



More information about the mesa-commit mailing list