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

[dxvk] Support multi-plane formats in copyImageToBuffer

This commit is contained in:
Philip Rebohle 2021-05-20 05:41:32 +02:00
parent a660b35f6e
commit 6462174c13
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 8 additions and 21 deletions

View File

@ -4052,8 +4052,7 @@ namespace dxvk {
cPackedFormat = packedFormat cPackedFormat = packedFormat
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
ctx->copyImageToBuffer( ctx->copyImageToBuffer(cImageBuffer, 0, 0,
cImageBuffer, 0, VkExtent2D { 0u, 0u },
cImage, cSubresources, VkOffset3D { 0, 0, 0 }, cImage, cSubresources, VkOffset3D { 0, 0, 0 },
cLevelExtent); cLevelExtent);
} else { } else {

View File

@ -866,8 +866,7 @@ namespace dxvk {
cLevelExtent = srcExtent, cLevelExtent = srcExtent,
cDstExtent = dstExtent cDstExtent = dstExtent
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
ctx->copyImageToBuffer( ctx->copyImageToBuffer(cBuffer, 0, 4,
cBuffer, 0, cDstExtent,
cImage, cSubresources, VkOffset3D { 0, 0, 0 }, cImage, cSubresources, VkOffset3D { 0, 0, 0 },
cLevelExtent); cLevelExtent);
}); });
@ -4162,8 +4161,7 @@ namespace dxvk {
cPackedFormat = packedFormat cPackedFormat = packedFormat
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
ctx->copyImageToBuffer( ctx->copyImageToBuffer(cImageBuffer, 0, 0,
cImageBuffer, 0, VkExtent2D { 0u, 0u },
cImage, cSubresources, VkOffset3D { 0, 0, 0 }, cImage, cSubresources, VkOffset3D { 0, 0, 0 },
cLevelExtent); cLevelExtent);
} else { } else {

View File

@ -456,8 +456,7 @@ namespace dxvk {
cSubresources = srcSubresourceLayers, cSubresources = srcSubresourceLayers,
cLevelExtent = srcExtent cLevelExtent = srcExtent
] (DxvkContext* ctx) { ] (DxvkContext* ctx) {
ctx->copyImageToBuffer( ctx->copyImageToBuffer(cBuffer, 0, 0,
cBuffer, 0, VkExtent2D { 0u, 0u },
cImage, cSubresources, VkOffset3D { 0, 0, 0 }, cImage, cSubresources, VkOffset3D { 0, 0, 0 },
cLevelExtent); cLevelExtent);
}); });

View File

@ -892,7 +892,7 @@ namespace dxvk {
void DxvkContext::copyImageToBuffer( void DxvkContext::copyImageToBuffer(
const Rc<DxvkBuffer>& dstBuffer, const Rc<DxvkBuffer>& dstBuffer,
VkDeviceSize dstOffset, VkDeviceSize dstOffset,
VkExtent2D dstExtent, VkDeviceSize rowAlignment,
const Rc<DxvkImage>& srcImage, const Rc<DxvkImage>& srcImage,
VkImageSubresourceLayers srcSubresource, VkImageSubresourceLayers srcSubresource,
VkOffset3D srcOffset, VkOffset3D srcOffset,
@ -926,17 +926,8 @@ namespace dxvk {
m_execAcquires.recordCommands(m_cmd); m_execAcquires.recordCommands(m_cmd);
VkBufferImageCopy copyRegion; this->copyImageBufferData<false>(DxvkCmdBuffer::ExecBuffer, srcImage, srcSubresource,
copyRegion.bufferOffset = dstSlice.offset; srcOffset, srcExtent, srcImageLayoutTransfer, dstSlice, rowAlignment, 0);
copyRegion.bufferRowLength = dstExtent.width;
copyRegion.bufferImageHeight = dstExtent.height;
copyRegion.imageSubresource = srcSubresource;
copyRegion.imageOffset = srcOffset;
copyRegion.imageExtent = srcExtent;
m_cmd->cmdCopyImageToBuffer(DxvkCmdBuffer::ExecBuffer,
srcImage->handle(), srcImageLayoutTransfer,
dstSlice.handle, 1, &copyRegion);
m_execBarriers.accessImage( m_execBarriers.accessImage(
srcImage, srcSubresourceRange, srcImage, srcSubresourceRange,

View File

@ -409,7 +409,7 @@ namespace dxvk {
void copyImageToBuffer( void copyImageToBuffer(
const Rc<DxvkBuffer>& dstBuffer, const Rc<DxvkBuffer>& dstBuffer,
VkDeviceSize dstOffset, VkDeviceSize dstOffset,
VkExtent2D dstExtent, VkDeviceSize rowAlignment,
const Rc<DxvkImage>& srcImage, const Rc<DxvkImage>& srcImage,
VkImageSubresourceLayers srcSubresource, VkImageSubresourceLayers srcSubresource,
VkOffset3D srcOffset, VkOffset3D srcOffset,