Mesa (main): dzn: Cache and pack transition barriers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 29 11:53:34 UTC 2022


Module: Mesa
Branch: main
Commit: 35356b1173ee62638d3b4c2397144f0e6c936fef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=35356b1173ee62638d3b4c2397144f0e6c936fef

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Mon Jun 27 07:39:49 2022 -0700

dzn: Cache and pack transition barriers

Some Vulkan -> D3D12 API mismatches force us to do behind-the-scene
transitions to get resources in the right state when executing
non-native operations. In this case, caching the transition until the
resource is actually used might save us unneeded transitions.

The packing aspect is mostly useful to limit the ExecuteBarriers()
call overhead. Right now we do per-resource packing, and any hole
in the subresource range will trigger several ExecuteBarriers()
calls. This can be improved by collecting barriers in a separate
array, and flushing the collected transition barriers just before
executing the operation using the subresources pointed by those
barriers. While not impossible, it'd be more verbose than what we
have right now, so I'm not entirely convinced it's worth it.

Caching could be improved to avoid any unnecessary flush when we do
blit or copy operations and transition the resources back to their
original state, since the user might decide to transition the image to
a new layout just after that. But doing that would require keeping
track of all resources used by dispatch/draw operations, which in turn
implies keeping info about which of the descriptor set resources are
used by the graphics/compute pipelines. Not sure the it's worth the
extra complexity given D3D12 enhanced barriers are just around the
corner, and those map pretty nicely to the vulkan barrier+image-layout
model.

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17274>

---

 src/microsoft/vulkan/dzn_cmd_buffer.c | 837 +++++++++++++++-------------------
 src/microsoft/vulkan/dzn_private.h    |   2 +
 2 files changed, 368 insertions(+), 471 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=35356b1173ee62638d3b4c2397144f0e6c936fef


More information about the mesa-commit mailing list