From e9bc7c5cd1fde500c7d616769785ec32c597f270 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 1 Mar 2025 02:45:21 +0100 Subject: [PATCH] [dxvk] Use granular image access tracking in copyImageToBufferHw --- src/dxvk/dxvk_context.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 4fb44b48e..6e791f48c 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -3738,16 +3738,16 @@ namespace dxvk { // but pipeline barriers need to have all aspect bits set auto srcFormatInfo = image->formatInfo(); - auto srcSubresourceRange = vk::makeSubresourceRange(imageSubresource); - srcSubresourceRange.aspectMask = srcFormatInfo->aspectMask; + auto srcSubresource = imageSubresource; + srcSubresource.aspectMask = srcFormatInfo->aspectMask; - flushPendingAccesses(*image, srcSubresourceRange, DxvkAccess::Read); + flushPendingAccesses(*image, srcSubresource, imageOffset, imageExtent, DxvkAccess::Read); flushPendingAccesses(*buffer, bufferOffset, dataSize, DxvkAccess::Write); // Select a suitable image layout for the transfer op VkImageLayout srcImageLayoutTransfer = image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); - addImageLayoutTransition(*image, srcSubresourceRange, srcImageLayoutTransfer, + addImageLayoutTransition(*image, vk::makeSubresourceRange(srcSubresource), srcImageLayoutTransfer, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, false); flushImageLayoutTransitions(DxvkCmdBuffer::ExecBuffer); @@ -3755,7 +3755,7 @@ namespace dxvk { image, imageSubresource, imageOffset, imageExtent, srcImageLayoutTransfer, bufferSlice, bufferRowAlignment, bufferSliceAlignment); - accessImage(DxvkCmdBuffer::ExecBuffer, *image, srcSubresourceRange, srcImageLayoutTransfer, + accessImageRegion(DxvkCmdBuffer::ExecBuffer, *image, srcSubresource, imageOffset, imageExtent, srcImageLayoutTransfer, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, DxvkAccessOp::None); accessBuffer(DxvkCmdBuffer::ExecBuffer, *buffer, bufferOffset, dataSize,