mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxvk] Use granular image access tracking in copyImageToBufferHw
This commit is contained in:
parent
d683c3f3df
commit
e9bc7c5cd1
1 changed files with 5 additions and 5 deletions
|
@ -3738,16 +3738,16 @@ namespace dxvk {
|
||||||
// but pipeline barriers need to have all aspect bits set
|
// but pipeline barriers need to have all aspect bits set
|
||||||
auto srcFormatInfo = image->formatInfo();
|
auto srcFormatInfo = image->formatInfo();
|
||||||
|
|
||||||
auto srcSubresourceRange = vk::makeSubresourceRange(imageSubresource);
|
auto srcSubresource = imageSubresource;
|
||||||
srcSubresourceRange.aspectMask = srcFormatInfo->aspectMask;
|
srcSubresource.aspectMask = srcFormatInfo->aspectMask;
|
||||||
|
|
||||||
flushPendingAccesses(*image, srcSubresourceRange, DxvkAccess::Read);
|
flushPendingAccesses(*image, srcSubresource, imageOffset, imageExtent, DxvkAccess::Read);
|
||||||
flushPendingAccesses(*buffer, bufferOffset, dataSize, DxvkAccess::Write);
|
flushPendingAccesses(*buffer, bufferOffset, dataSize, DxvkAccess::Write);
|
||||||
|
|
||||||
// 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);
|
||||||
|
|
||||||
addImageLayoutTransition(*image, srcSubresourceRange, srcImageLayoutTransfer,
|
addImageLayoutTransition(*image, vk::makeSubresourceRange(srcSubresource), srcImageLayoutTransfer,
|
||||||
VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, false);
|
VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, false);
|
||||||
flushImageLayoutTransitions(DxvkCmdBuffer::ExecBuffer);
|
flushImageLayoutTransitions(DxvkCmdBuffer::ExecBuffer);
|
||||||
|
|
||||||
|
@ -3755,7 +3755,7 @@ namespace dxvk {
|
||||||
image, imageSubresource, imageOffset, imageExtent, srcImageLayoutTransfer,
|
image, imageSubresource, imageOffset, imageExtent, srcImageLayoutTransfer,
|
||||||
bufferSlice, bufferRowAlignment, bufferSliceAlignment);
|
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);
|
VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, DxvkAccessOp::None);
|
||||||
|
|
||||||
accessBuffer(DxvkCmdBuffer::ExecBuffer, *buffer, bufferOffset, dataSize,
|
accessBuffer(DxvkCmdBuffer::ExecBuffer, *buffer, bufferOffset, dataSize,
|
||||||
|
|
Loading…
Add table
Reference in a new issue