1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxvk] Use new layout transition helper for blitImageHw

This commit is contained in:
Philip Rebohle 2024-10-10 18:00:06 +02:00 committed by Philip Rebohle
parent aff6cb744c
commit 2353867d54

View File

@ -2761,29 +2761,11 @@ namespace dxvk {
auto dstLayout = dstView->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); auto dstLayout = dstView->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
auto srcLayout = srcView->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); auto srcLayout = srcView->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
if (dstView->image()->info().layout != dstLayout) { addImageLayoutTransition(*dstView->image(), dstView->imageSubresources(),
m_execAcquires.accessImage( dstLayout, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_WRITE_BIT, false);
dstView->image(), addImageLayoutTransition(*srcView->image(), srcView->imageSubresources(),
dstView->imageSubresources(), srcLayout, VK_PIPELINE_STAGE_2_TRANSFER_BIT, VK_ACCESS_2_TRANSFER_READ_BIT, false);
dstView->image()->info().layout, flushImageLayoutTransitions(DxvkCmdBuffer::ExecBuffer);
VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
dstLayout,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_ACCESS_TRANSFER_WRITE_BIT);
}
if (srcView->image()->info().layout != srcLayout) {
m_execAcquires.accessImage(
srcView->image(),
srcView->imageSubresources(),
srcView->image()->info().layout,
VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
srcLayout,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_ACCESS_TRANSFER_READ_BIT);
}
m_execAcquires.recordCommands(m_cmd);
// Perform the blit operation // Perform the blit operation
VkImageBlit2 blitRegion = { VK_STRUCTURE_TYPE_IMAGE_BLIT_2 }; VkImageBlit2 blitRegion = { VK_STRUCTURE_TYPE_IMAGE_BLIT_2 };