mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Use copy_commands2 functions for image blits
Don't expose VkImageBlit2 to client APIs since we can't easily support pNext chains, so just convert the struct internally.
This commit is contained in:
parent
563b1d7801
commit
ff81323228
@ -339,17 +339,8 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
void cmdBlitImage(
|
||||
VkImage srcImage,
|
||||
VkImageLayout srcImageLayout,
|
||||
VkImage dstImage,
|
||||
VkImageLayout dstImageLayout,
|
||||
uint32_t regionCount,
|
||||
const VkImageBlit* pRegions,
|
||||
VkFilter filter) {
|
||||
m_vkd->vkCmdBlitImage(m_execBuffer,
|
||||
srcImage, srcImageLayout,
|
||||
dstImage, dstImageLayout,
|
||||
regionCount, pRegions, filter);
|
||||
const VkBlitImageInfo2* pBlitInfo) {
|
||||
m_vkd->vkCmdBlitImage2(m_execBuffer, pBlitInfo);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2861,10 +2861,25 @@ namespace dxvk {
|
||||
m_execAcquires.recordCommands(m_cmd);
|
||||
|
||||
// Perform the blit operation
|
||||
m_cmd->cmdBlitImage(
|
||||
srcImage->handle(), srcLayout,
|
||||
dstImage->handle(), dstLayout,
|
||||
1, ®ion, filter);
|
||||
VkImageBlit2 blitRegion = { VK_STRUCTURE_TYPE_IMAGE_BLIT_2 };
|
||||
blitRegion.srcSubresource = region.srcSubresource;
|
||||
blitRegion.dstSubresource = region.dstSubresource;
|
||||
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
blitRegion.srcOffsets[i] = region.srcOffsets[i];
|
||||
blitRegion.dstOffsets[i] = region.dstOffsets[i];
|
||||
}
|
||||
|
||||
VkBlitImageInfo2 blitInfo = { VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 };
|
||||
blitInfo.srcImage = srcImage->handle();
|
||||
blitInfo.srcImageLayout = srcLayout;
|
||||
blitInfo.dstImage = dstImage->handle();
|
||||
blitInfo.dstImageLayout = dstLayout;
|
||||
blitInfo.regionCount = 1;
|
||||
blitInfo.pRegions = &blitRegion;
|
||||
blitInfo.filter = filter;
|
||||
|
||||
m_cmd->cmdBlitImage(&blitInfo);
|
||||
|
||||
m_execBarriers.accessImage(
|
||||
dstImage, dstSubresourceRange, dstLayout,
|
||||
|
Loading…
x
Reference in New Issue
Block a user