diff --git a/src/dxvk/dxvk_cmdlist.h b/src/dxvk/dxvk_cmdlist.h index a07ba5e24..ef2aa7dca 100644 --- a/src/dxvk/dxvk_cmdlist.h +++ b/src/dxvk/dxvk_cmdlist.h @@ -405,18 +405,10 @@ namespace dxvk { void cmdCopyImage( DxvkCmdBuffer cmdBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageCopy* pRegions) { + const VkCopyImageInfo2* copyInfo) { m_cmdBuffersUsed.set(cmdBuffer); - m_vkd->vkCmdCopyImage(getCmdBuffer(cmdBuffer), - srcImage, srcImageLayout, - dstImage, dstImageLayout, - regionCount, pRegions); + m_vkd->vkCmdCopyImage2(getCmdBuffer(cmdBuffer), copyInfo); } diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index abbb6f32a..48e3c378b 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -3301,29 +3301,34 @@ namespace dxvk { for (auto aspects = dstSubresource.aspectMask; aspects; ) { auto aspect = vk::getNextAspect(aspects); - VkImageCopy imageRegion; - imageRegion.srcSubresource = srcSubresource; - imageRegion.srcSubresource.aspectMask = aspect; - imageRegion.srcOffset = srcOffset; - imageRegion.dstSubresource = dstSubresource; - imageRegion.dstSubresource.aspectMask = aspect; - imageRegion.dstOffset = dstOffset; - imageRegion.extent = extent; + VkImageCopy2 copyRegion = { VK_STRUCTURE_TYPE_IMAGE_COPY_2 }; + copyRegion.srcSubresource = srcSubresource; + copyRegion.srcSubresource.aspectMask = aspect; + copyRegion.srcOffset = srcOffset; + copyRegion.dstSubresource = dstSubresource; + copyRegion.dstSubresource.aspectMask = aspect; + copyRegion.dstOffset = dstOffset; + copyRegion.extent = extent; if (dstFormatInfo->flags.test(DxvkFormatFlag::MultiPlane)) { auto plane = &dstFormatInfo->planes[vk::getPlaneIndex(aspect)]; - imageRegion.srcOffset.x /= plane->blockSize.width; - imageRegion.srcOffset.y /= plane->blockSize.height; - imageRegion.dstOffset.x /= plane->blockSize.width; - imageRegion.dstOffset.y /= plane->blockSize.height; - imageRegion.extent.width /= plane->blockSize.width; - imageRegion.extent.height /= plane->blockSize.height; + copyRegion.srcOffset.x /= plane->blockSize.width; + copyRegion.srcOffset.y /= plane->blockSize.height; + copyRegion.dstOffset.x /= plane->blockSize.width; + copyRegion.dstOffset.y /= plane->blockSize.height; + copyRegion.extent.width /= plane->blockSize.width; + copyRegion.extent.height /= plane->blockSize.height; } - m_cmd->cmdCopyImage(DxvkCmdBuffer::ExecBuffer, - srcImage->handle(), srcImageLayout, - dstImage->handle(), dstImageLayout, - 1, &imageRegion); + VkCopyImageInfo2 copyInfo = { VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2 }; + copyInfo.srcImage = srcImage->handle(); + copyInfo.srcImageLayout = srcImageLayout; + copyInfo.dstImage = dstImage->handle(); + copyInfo.dstImageLayout = dstImageLayout; + copyInfo.regionCount = 1; + copyInfo.pRegions = ©Region; + + m_cmd->cmdCopyImage(DxvkCmdBuffer::ExecBuffer, ©Info); } m_execBarriers.accessImage(