1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[dxvk] Explicitly specify the command buffer for copy commands

This commit is contained in:
Philip Rebohle 2019-06-28 03:19:14 +02:00
parent be24ca6099
commit f85b9088d4
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 32 additions and 27 deletions

View File

@ -379,36 +379,45 @@ namespace dxvk {
void cmdCopyBuffer(
DxvkCmdBuffer cmdBuffer,
VkBuffer srcBuffer,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferCopy* pRegions) {
m_vkd->vkCmdCopyBuffer(m_execBuffer,
m_cmdBuffersUsed.set(cmdBuffer);
m_vkd->vkCmdCopyBuffer(getCmdBuffer(cmdBuffer),
srcBuffer, dstBuffer,
regionCount, pRegions);
}
void cmdCopyBufferToImage(
DxvkCmdBuffer cmdBuffer,
VkBuffer srcBuffer,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkBufferImageCopy* pRegions) {
m_vkd->vkCmdCopyBufferToImage(m_execBuffer,
m_cmdBuffersUsed.set(cmdBuffer);
m_vkd->vkCmdCopyBufferToImage(getCmdBuffer(cmdBuffer),
srcBuffer, dstImage, dstImageLayout,
regionCount, pRegions);
}
void cmdCopyImage(
DxvkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageCopy* pRegions) {
m_vkd->vkCmdCopyImage(m_execBuffer,
m_cmdBuffersUsed.set(cmdBuffer);
m_vkd->vkCmdCopyImage(getCmdBuffer(cmdBuffer),
srcImage, srcImageLayout,
dstImage, dstImageLayout,
regionCount, pRegions);
@ -416,12 +425,15 @@ namespace dxvk {
void cmdCopyImageToBuffer(
DxvkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferImageCopy* pRegions) {
m_vkd->vkCmdCopyImageToBuffer(m_execBuffer,
m_cmdBuffersUsed.set(cmdBuffer);
m_vkd->vkCmdCopyImageToBuffer(getCmdBuffer(cmdBuffer),
srcImage, srcImageLayout, dstBuffer,
regionCount, pRegions);
}

View File

@ -623,7 +623,7 @@ namespace dxvk {
region.imageOffset = offset;
region.imageExtent = extent;
m_cmd->cmdCopyBufferToImage(
m_cmd->cmdCopyBufferToImage(DxvkCmdBuffer::ExecBuffer,
stagingHandle.handle, image->handle(),
image->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL),
1, &region);
@ -837,10 +837,8 @@ namespace dxvk {
bufferRegion.dstOffset = dstSlice.offset;
bufferRegion.size = dstSlice.length;
m_cmd->cmdCopyBuffer(
srcSlice.handle,
dstSlice.handle,
1, &bufferRegion);
m_cmd->cmdCopyBuffer(DxvkCmdBuffer::ExecBuffer,
srcSlice.handle, dstSlice.handle, 1, &bufferRegion);
m_execBarriers.accessBuffer(srcSlice,
VK_PIPELINE_STAGE_TRANSFER_BIT,
@ -936,11 +934,9 @@ namespace dxvk {
copyRegion.imageOffset = dstOffset;
copyRegion.imageExtent = dstExtent;
m_cmd->cmdCopyBufferToImage(
srcSlice.handle,
dstImage->handle(),
dstImageLayoutTransfer,
1, &copyRegion);
m_cmd->cmdCopyBufferToImage(DxvkCmdBuffer::ExecBuffer,
srcSlice.handle, dstImage->handle(),
dstImageLayoutTransfer, 1, &copyRegion);
m_execBarriers.accessImage(
dstImage, dstSubresourceRange,
@ -1095,11 +1091,9 @@ namespace dxvk {
copyRegion.imageOffset = srcOffset;
copyRegion.imageExtent = srcExtent;
m_cmd->cmdCopyImageToBuffer(
srcImage->handle(),
srcImageLayoutTransfer,
dstSlice.handle,
1, &copyRegion);
m_cmd->cmdCopyImageToBuffer(DxvkCmdBuffer::ExecBuffer,
srcImage->handle(), srcImageLayoutTransfer,
dstSlice.handle, 1, &copyRegion);
m_execBarriers.accessImage(
srcImage, srcSubresourceRange,
@ -1382,7 +1376,7 @@ namespace dxvk {
{ tmpBufferViewS->info().rangeOffset, 0, 0, dstSubresourceS, dstOffset3D, dstExtent3D },
}};
m_cmd->cmdCopyBufferToImage(
m_cmd->cmdCopyBufferToImage(DxvkCmdBuffer::ExecBuffer,
tmpBuffer->getSliceHandle().handle,
dstImage->handle(),
dstImage->pickLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL),
@ -1916,10 +1910,8 @@ namespace dxvk {
region.dstOffset = bufferSlice.offset;
region.size = size;
m_cmd->cmdCopyBuffer(
stagingHandle.handle,
bufferSlice.handle,
1, &region);
m_cmd->cmdCopyBuffer(DxvkCmdBuffer::ExecBuffer,
stagingHandle.handle, bufferSlice.handle, 1, &region);
m_cmd->trackResource(stagingSlice.buffer());
}
@ -2005,8 +1997,9 @@ namespace dxvk {
region.imageOffset = imageOffset;
region.imageExtent = imageExtent;
m_cmd->cmdCopyBufferToImage(stagingHandle.handle,
image->handle(), imageLayoutTransfer, 1, &region);
m_cmd->cmdCopyBufferToImage(DxvkCmdBuffer::ExecBuffer,
stagingHandle.handle, image->handle(),
imageLayoutTransfer, 1, &region);
// Transition image back into its optimal layout
m_execBarriers.accessImage(
@ -2544,7 +2537,7 @@ namespace dxvk {
imageRegion.dstOffset = dstOffset;
imageRegion.extent = extent;
m_cmd->cmdCopyImage(
m_cmd->cmdCopyImage(DxvkCmdBuffer::ExecBuffer,
srcImage->handle(), srcImageLayout,
dstImage->handle(), dstImageLayout,
1, &imageRegion);