diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c index 1b8cb85d131..0defc197d70 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c @@ -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; } diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_zsa.h b/src/gallium/drivers/freedreno/a6xx/fd6_zsa.h index 15be91e1bfe..d7b6f61fedf 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_zsa.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_zsa.h @@ -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]; };