panvk: Preload FB attachments when required
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 6 Sep 2021 14:06:49 +0000 (16:06 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 21 Sep 2021 13:00:07 +0000 (15:00 +0200)
commit165c26b9e12745f39ba4c03b97b924a53ab308ef
treebd419f9b0e65d095dbd8f109ec85e0feaccc339c
parent3166f4ebea7d631d9776e6de4a3601be97a0db33
panvk: Preload FB attachments when required

There are at least three situations where we need to preload FBs:

1. The attachment is flagged VK_ATTACHMENT_LOAD_OP_LOAD and has not been
   accessed in previous subpasses

2. The batch is implicitly split (e.g. too many jobs queued to the
   batch, wait/set events queued, ...)

3. The attachment has been written by a previous subpass

With those changes, we can get rid of panvk_emit_fb() and call
pan_emit_fbd() directly (fb_info is initialized when starting a subpass
and updated when an implicit split happens).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
src/panfrost/vulkan/panvk_cmd_buffer.c
src/panfrost/vulkan/panvk_pass.c
src/panfrost/vulkan/panvk_private.h
src/panfrost/vulkan/panvk_vX_cmd_buffer.c
src/panfrost/vulkan/panvk_vX_cs.c
src/panfrost/vulkan/panvk_vX_cs.h