From d7dd80b62fc4f4a18b0fa79f264741d03d8a7e9f Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 12 Oct 2024 09:19:13 +0200 Subject: [PATCH] [dxvk] Use new barrier helpers in copyBufferToImageHw --- src/dxvk/dxvk_context.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index f8dc1e11..84fb3a41 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -2828,9 +2828,8 @@ namespace dxvk { auto dstSubresourceRange = vk::makeSubresourceRange(imageSubresource); dstSubresourceRange.aspectMask = dstFormatInfo->aspectMask; - if (m_execBarriers.isImageDirty(image, dstSubresourceRange, DxvkAccess::Write) - || m_execBarriers.isBufferDirty(bufferSlice, DxvkAccess::Read)) - m_execBarriers.recordCommands(m_cmd); + flushPendingAccesses(*image, dstSubresourceRange, DxvkAccess::Write); + flushPendingAccesses(*buffer, bufferOffset, dataSize, DxvkAccess::Read); // Initialize the image if the entire subresource is covered VkImageLayout dstImageLayoutTransfer = image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); @@ -2844,20 +2843,12 @@ namespace dxvk { image, imageSubresource, imageOffset, imageExtent, dstImageLayoutTransfer, bufferSlice, bufferRowAlignment, bufferSliceAlignment); - m_execBarriers.accessImage( - image, dstSubresourceRange, - dstImageLayoutTransfer, - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_ACCESS_TRANSFER_WRITE_BIT, - image->info().layout, - image->info().stages, - image->info().access); + accessImage(DxvkCmdBuffer::ExecBuffer, + *image, dstSubresourceRange, dstImageLayoutTransfer, + VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_WRITE_BIT); - m_execBarriers.accessBuffer(bufferSlice, - VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_ACCESS_TRANSFER_READ_BIT, - buffer->info().stages, - buffer->info().access); + accessBuffer(DxvkCmdBuffer::ExecBuffer, *buffer, bufferOffset, dataSize, + VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT); m_cmd->trackResource(image); m_cmd->trackResource(buffer);