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@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17274>
This commit is contained in:

committed by
Marge Bot

parent
d2e769c1b6
commit
35356b1173
File diff suppressed because it is too large
Load Diff
@@ -572,6 +572,8 @@ struct dzn_cmd_buffer {
|
||||
struct dzn_descriptor_heap_pool pool;
|
||||
} rtvs, dsvs;
|
||||
|
||||
struct hash_table *transition_barriers;
|
||||
|
||||
struct dzn_descriptor_heap_pool cbv_srv_uav_pool, sampler_pool;
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE null_rtv;
|
||||
|
||||
|
Reference in New Issue
Block a user