freedreno/a6xx: Add LRZ perf warn for ztest direction changes

Add a perf warning when LRZ invalidate happens due to depth test
direction reversal.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
This commit is contained in:
Rob Clark
2023-01-14 10:16:36 -08:00
committed by Marge Bot
parent 65e5b8e413
commit c1b1b3e6ab
2 changed files with 13 additions and 3 deletions
@@ -186,6 +186,10 @@ compute_lrz_state(struct fd6_emit *emit) assert_dt
*/
if (zsa->base.depth_enabled && (rsc->lrz_direction != FD_LRZ_UNKNOWN) &&
(rsc->lrz_direction != lrz.direction)) {
if (!zsa->perf_warn_zdir && rsc->lrz_valid) {
perf_debug_ctx(ctx, "Invalidating LRZ due to depth test direction change");
zsa->perf_warn_zdir = true;
}
rsc->lrz_valid = false;
}
+9 -3
View File
@@ -48,9 +48,15 @@ struct fd6_zsa_stateobj {
uint32_t rb_stencilwrmask;
struct fd6_lrz_state lrz;
bool writes_zs; /* writes depth and/or stencil */
bool invalidate_lrz;
bool alpha_test;
bool writes_zs : 1; /* writes depth and/or stencil */
bool invalidate_lrz : 1;
bool alpha_test : 1;
/* Track whether we've alread generated perf warns so that
* we don't flood the user with LRZ disable warns which can
* only be detected at draw time.
*/
bool perf_warn_zdir : 1;
struct fd_ringbuffer *stateobj[4];
};