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

[dxvk] Use new layout transition helper for blitImageFb

This commit is contained in:
Philip Rebohle 2024-10-10 17:57:48 +02:00 committed by Philip Rebohle
parent 971042b3d3
commit aff6cb744c

View File

@ -2604,30 +2604,13 @@ namespace dxvk {
VkImageLayout dstLayout = dstView->image()->pickLayout(
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
if (dstView->image()->info().layout != dstLayout) {
m_execAcquires.accessImage(
dstView->image(),
dstView->imageSubresources(),
dstView->image()->info().layout,
dstView->image()->info().stages, 0,
dstLayout,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
}
if (srcView->image()->info().layout != srcLayout) {
m_execAcquires.accessImage(
srcView->image(),
srcView->imageSubresources(),
srcView->image()->info().layout,
srcView->image()->info().stages, 0,
srcLayout,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_ACCESS_SHADER_READ_BIT);
}
m_execAcquires.recordCommands(m_cmd);
addImageLayoutTransition(*dstView->image(), dstView->imageSubresources(),
dstLayout, VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, false);
addImageLayoutTransition(*srcView->image(), srcView->imageSubresources(),
srcLayout, VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT,
VK_ACCESS_2_SHADER_READ_BIT, false);
flushImageLayoutTransitions(DxvkCmdBuffer::ExecBuffer);
// Sort out image offsets so that dstOffset[0] points
// to the top-left corner of the target area