tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Mon, 16 May 2022 10:41:02 +0000 (13:41 +0300)
committerMarge Bot <emma+marge@anholt.net>
Tue, 28 Jun 2022 17:23:16 +0000 (17:23 +0000)
commit4b5f0d98fd57cbcd253b85291b7491aa5754a2eb
tree6cad857d2bf62a51f027892103121890ace6dc97
parent70f1d70ddd785361d989fcc565a675df173a1d82
tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear

On-GPU LRZ direction tracking allows LRZ to support secondary cmdbufs,
reusing LRZ between renderpasses, and in future to support LRZ when
VK_KHR_dynamic_rendering is used.

With on-gpu tracking we have to be careful keeping LRZ state in sync
with underlying depth image, which means we should invalidate LRZ
when underlying image is changed or the view of image is different
from previous renderpass.

All of this resulted in LRZ logic being thinly spread through the code,
making it hard to understand. So most of it was moved to tu_lrz.c.

For more details on past and new LRZ features see comment at the
top of tu_lrz.c.

Note about blob:
- Blob is much more happy to do LRZ_FLUSH, it flushes at the start
  of the renderpass, after binning, and at the end of the renderpass.
- Blob seem not to care about changes in depth image done via
  vkCmdCopyImage.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6347

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16251>
12 files changed:
src/freedreno/common/freedreno_dev_info.h
src/freedreno/common/freedreno_devices.py
src/freedreno/fdl/fd6_view.c
src/freedreno/fdl/freedreno_layout.h
src/freedreno/registers/adreno/a6xx.xml
src/freedreno/vulkan/meson.build
src/freedreno/vulkan/tu_clear_blit.c
src/freedreno/vulkan/tu_cmd_buffer.c
src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_image.c
src/freedreno/vulkan/tu_lrz.c [new file with mode: 0644]
src/freedreno/vulkan/tu_private.h