Skip to content

tu,freedreno: Implement LRZ feedback

Danylo Piliaiev requested to merge Danil/mesa:turnip/feature/lrz-feedback into main

What does this MR do and why?

Some draws do write depth but cannot contribute to LRZ during the BINNING pass e.g. when fragment shader has "discard" in it, however they can contribute to LRZ during the RENDERING pass via LRZ feedback mechanism. This may allow the draws that follow to depth test against the updated LRZ, this is especially important if such "bad" draws were at the start of the renderpass.

LRZ feedback happens during the RENDERING pass when LRZ_FEEDBACK_ZMODE_MASK is set, if draw has a6xx_ztest_mode that has corresponding flag set in LRZ_FEEDBACK_ZMODE_MASK - its depth values would be used for feedback.

LRZ feedback alongside with LRZ testing also works during sysmem rendering.

That LRZ feedback is working could be seen via perf counters PERF_LRZ_FEEDBACK_ACCEPT, PERF_LRZ_FEEDBACK_ACCEPT, and PERF_LRZ_TILE_KILLED (if testing in non-binning case).


  • For Turnip I enabled LRZ feedback in gmem+hwbinning, gmem+nobinning, sysmem.
  • On Freedreno for gmem+hwbinning, gmem+nobinning. To enable in in sysmem a bit more changes should be done.

Performance benefits are to be seen. I followed what I saw in the decoded traces from the latest blob @690.

Merge request reports