1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 22:24:13 +01:00

[dxvk] Use new barrier helpers in copyImageToBufferHw

This commit is contained in:
Philip Rebohle 2024-10-12 09:26:07 +02:00 committed by Philip Rebohle
parent e21c2977df
commit 59d37757b0

View File

@ -3109,9 +3109,8 @@ namespace dxvk {
auto srcSubresourceRange = vk::makeSubresourceRange(imageSubresource); auto srcSubresourceRange = vk::makeSubresourceRange(imageSubresource);
srcSubresourceRange.aspectMask = srcFormatInfo->aspectMask; srcSubresourceRange.aspectMask = srcFormatInfo->aspectMask;
if (m_execBarriers.isImageDirty(image, srcSubresourceRange, DxvkAccess::Write) flushPendingAccesses(*image, srcSubresourceRange, DxvkAccess::Read);
|| m_execBarriers.isBufferDirty(bufferSlice, DxvkAccess::Write)) flushPendingAccesses(*buffer, bufferOffset, dataSize, DxvkAccess::Write);
m_execBarriers.recordCommands(m_cmd);
// Select a suitable image layout for the transfer op // Select a suitable image layout for the transfer op
VkImageLayout srcImageLayoutTransfer = image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); VkImageLayout srcImageLayoutTransfer = image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
@ -3124,20 +3123,12 @@ namespace dxvk {
image, imageSubresource, imageOffset, imageExtent, srcImageLayoutTransfer, image, imageSubresource, imageOffset, imageExtent, srcImageLayoutTransfer,
bufferSlice, bufferRowAlignment, bufferSliceAlignment); bufferSlice, bufferRowAlignment, bufferSliceAlignment);
m_execBarriers.accessImage( accessImage(DxvkCmdBuffer::ExecBuffer,
image, srcSubresourceRange, *image, srcSubresourceRange, srcImageLayoutTransfer,
srcImageLayoutTransfer, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT);
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_ACCESS_TRANSFER_READ_BIT,
image->info().layout,
image->info().stages,
image->info().access);
m_execBarriers.accessBuffer(bufferSlice, accessBuffer(DxvkCmdBuffer::ExecBuffer, *buffer, bufferOffset, dataSize,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_WRITE_BIT);
VK_ACCESS_TRANSFER_WRITE_BIT,
buffer->info().stages,
buffer->info().access);
m_cmd->trackResource<DxvkAccess::Write>(buffer); m_cmd->trackResource<DxvkAccess::Write>(buffer);
m_cmd->trackResource<DxvkAccess::Read>(image); m_cmd->trackResource<DxvkAccess::Read>(image);