tu: Support GMEM with layered rendering and multiview
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 2 Nov 2022 16:22:21 +0000 (17:22 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 8 Nov 2022 16:35:02 +0000 (16:35 +0000)
commitdef56b531c86f529bc32d1834ccb479457717db7
treef0b18cc7e0d57c122a52047517c7ae750a4fe1df
parenta9ab53fbe227acee971a5fb67d4ca91526100ec4
tu: Support GMEM with layered rendering and multiview

It turns out that this actually is supported. GMEM can hold multiple
layers which are cleared, loaded, and resolved separately. The stride
between layers seems to be implicitly calculated based on the tile size,
and we have to match it when blitting to/from GMEM. One tricky thing is
that now we may realize that we don't have enough space for GMEM only
when computing the tiling config, because we may not know the number of
framebuffer layers until we have the framebuffer and too many
framebuffer layers will exhaust GMEM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19505>
src/freedreno/vulkan/tu_clear_blit.c
src/freedreno/vulkan/tu_clear_blit.h
src/freedreno/vulkan/tu_cmd_buffer.c
src/freedreno/vulkan/tu_cmd_buffer.h
src/freedreno/vulkan/tu_device.h
src/freedreno/vulkan/tu_pass.c
src/freedreno/vulkan/tu_pass.h
src/freedreno/vulkan/tu_util.c