mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 07:24:15 +01:00
[dxvk] Use new barrier helpers in copyBufferToImageHw
This commit is contained in:
parent
389e40be67
commit
d7dd80b62f
@ -2828,9 +2828,8 @@ namespace dxvk {
|
|||||||
auto dstSubresourceRange = vk::makeSubresourceRange(imageSubresource);
|
auto dstSubresourceRange = vk::makeSubresourceRange(imageSubresource);
|
||||||
dstSubresourceRange.aspectMask = dstFormatInfo->aspectMask;
|
dstSubresourceRange.aspectMask = dstFormatInfo->aspectMask;
|
||||||
|
|
||||||
if (m_execBarriers.isImageDirty(image, dstSubresourceRange, DxvkAccess::Write)
|
flushPendingAccesses(*image, dstSubresourceRange, DxvkAccess::Write);
|
||||||
|| m_execBarriers.isBufferDirty(bufferSlice, DxvkAccess::Read))
|
flushPendingAccesses(*buffer, bufferOffset, dataSize, DxvkAccess::Read);
|
||||||
m_execBarriers.recordCommands(m_cmd);
|
|
||||||
|
|
||||||
// Initialize the image if the entire subresource is covered
|
// Initialize the image if the entire subresource is covered
|
||||||
VkImageLayout dstImageLayoutTransfer = image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
VkImageLayout dstImageLayoutTransfer = image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
||||||
@ -2844,20 +2843,12 @@ namespace dxvk {
|
|||||||
image, imageSubresource, imageOffset, imageExtent, dstImageLayoutTransfer,
|
image, imageSubresource, imageOffset, imageExtent, dstImageLayoutTransfer,
|
||||||
bufferSlice, bufferRowAlignment, bufferSliceAlignment);
|
bufferSlice, bufferRowAlignment, bufferSliceAlignment);
|
||||||
|
|
||||||
m_execBarriers.accessImage(
|
accessImage(DxvkCmdBuffer::ExecBuffer,
|
||||||
image, dstSubresourceRange,
|
*image, dstSubresourceRange, dstImageLayoutTransfer,
|
||||||
dstImageLayoutTransfer,
|
VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_WRITE_BIT);
|
||||||
VK_PIPELINE_STAGE_TRANSFER_BIT,
|
|
||||||
VK_ACCESS_TRANSFER_WRITE_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_READ_BIT);
|
||||||
VK_ACCESS_TRANSFER_READ_BIT,
|
|
||||||
buffer->info().stages,
|
|
||||||
buffer->info().access);
|
|
||||||
|
|
||||||
m_cmd->trackResource<DxvkAccess::Write>(image);
|
m_cmd->trackResource<DxvkAccess::Write>(image);
|
||||||
m_cmd->trackResource<DxvkAccess::Read>(buffer);
|
m_cmd->trackResource<DxvkAccess::Read>(buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user