tu: Rewrite flushing to use barriers
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 2 Apr 2020 15:48:19 +0000 (17:48 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Jun 2020 14:40:52 +0000 (14:40 +0000)
commit487aa807bd1b70602fcb6fbdabd101d4cff7c07b
tree210462963e69703b0045671afa67d1eee294d840
parent29abf49886d6f3a0118e47dba97eb3abd84e7b82
tu: Rewrite flushing to use barriers

Replace the various ad-hoc flushes that we've inserted, copied from
freedreno, etc. with a unified system that uses the user-supplied
information via vkCmdPipelineBarrier() and subpass dependencies.

There are a few notable differences in behavior:

- We now move setting RB_CCU_CNTL up a little in the gmem case, but
hopefully that won't matter too much. This matches what the Vulkan blob
does.

- We properly implement delayed setting of events, completing our
implementaton of events.

- Finally, of course, we should be a lot less flush-happy. We won't emit
useless CCU/cache flushes with multiple copies, renderpasses, etc. that
don't depend on each other, and also won't flush/invalidate the cache
around renderpasses unless we actually need to.

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