Module: Mesa Branch: main Commit: e16b55d861399376a714a96f05b4cf9560d15c2b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e16b55d861399376a714a96f05b4cf9560d15c2b
Author: Jesse Natalie <[email protected]> Date: Fri Mar 31 13:43:48 2023 -0700 dzn: Don't do initial-layout barriers for simultaneous-access resources Fixes: 4daeac01 ("dzn: Enhanced barriers fixes/workarounds") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225> --- src/microsoft/vulkan/dzn_cmd_buffer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/microsoft/vulkan/dzn_cmd_buffer.c b/src/microsoft/vulkan/dzn_cmd_buffer.c index 1e5324ff0cb..90f00654724 100644 --- a/src/microsoft/vulkan/dzn_cmd_buffer.c +++ b/src/microsoft/vulkan/dzn_cmd_buffer.c @@ -4519,11 +4519,18 @@ dzn_rendering_attachment_initial_transition(struct dzn_cmd_buffer *cmdbuf, access_before = D3D12_BARRIER_ACCESS_NO_ACCESS; } + D3D12_BARRIER_LAYOUT layout_before = dzn_vk_layout_to_d3d_layout(initial_layout->initialLayout, cmdbuf->type, aspect); + D3D12_BARRIER_LAYOUT layout_after = dzn_vk_layout_to_d3d_layout(att->imageLayout, cmdbuf->type, aspect); + if (image->desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS) { + layout_before = D3D12_BARRIER_LAYOUT_UNDEFINED; + layout_after = D3D12_BARRIER_LAYOUT_UNDEFINED; + } + dzn_cmd_buffer_image_barrier(cmdbuf, image, sync_before, D3D12_BARRIER_SYNC_DRAW, access_before, D3D12_BARRIER_ACCESS_COMMON, - dzn_vk_layout_to_d3d_layout(initial_layout->initialLayout, cmdbuf->type, aspect), - dzn_vk_layout_to_d3d_layout(att->imageLayout, cmdbuf->type, aspect), + layout_before, + layout_after, &range); } else { dzn_cmd_buffer_queue_image_range_layout_transition(cmdbuf, image, &range,
