mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 02:52:10 +01:00
[dxvk] Support multi-plane formats in copyImageToBuffer
This commit is contained in:
parent
a660b35f6e
commit
6462174c13
@ -4052,8 +4052,7 @@ namespace dxvk {
|
||||
cPackedFormat = packedFormat
|
||||
] (DxvkContext* ctx) {
|
||||
if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
|
||||
ctx->copyImageToBuffer(
|
||||
cImageBuffer, 0, VkExtent2D { 0u, 0u },
|
||||
ctx->copyImageToBuffer(cImageBuffer, 0, 0,
|
||||
cImage, cSubresources, VkOffset3D { 0, 0, 0 },
|
||||
cLevelExtent);
|
||||
} else {
|
||||
|
@ -866,8 +866,7 @@ namespace dxvk {
|
||||
cLevelExtent = srcExtent,
|
||||
cDstExtent = dstExtent
|
||||
] (DxvkContext* ctx) {
|
||||
ctx->copyImageToBuffer(
|
||||
cBuffer, 0, cDstExtent,
|
||||
ctx->copyImageToBuffer(cBuffer, 0, 4,
|
||||
cImage, cSubresources, VkOffset3D { 0, 0, 0 },
|
||||
cLevelExtent);
|
||||
});
|
||||
@ -4162,8 +4161,7 @@ namespace dxvk {
|
||||
cPackedFormat = packedFormat
|
||||
] (DxvkContext* ctx) {
|
||||
if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
|
||||
ctx->copyImageToBuffer(
|
||||
cImageBuffer, 0, VkExtent2D { 0u, 0u },
|
||||
ctx->copyImageToBuffer(cImageBuffer, 0, 0,
|
||||
cImage, cSubresources, VkOffset3D { 0, 0, 0 },
|
||||
cLevelExtent);
|
||||
} else {
|
||||
|
@ -456,8 +456,7 @@ namespace dxvk {
|
||||
cSubresources = srcSubresourceLayers,
|
||||
cLevelExtent = srcExtent
|
||||
] (DxvkContext* ctx) {
|
||||
ctx->copyImageToBuffer(
|
||||
cBuffer, 0, VkExtent2D { 0u, 0u },
|
||||
ctx->copyImageToBuffer(cBuffer, 0, 0,
|
||||
cImage, cSubresources, VkOffset3D { 0, 0, 0 },
|
||||
cLevelExtent);
|
||||
});
|
||||
|
@ -892,7 +892,7 @@ namespace dxvk {
|
||||
void DxvkContext::copyImageToBuffer(
|
||||
const Rc<DxvkBuffer>& dstBuffer,
|
||||
VkDeviceSize dstOffset,
|
||||
VkExtent2D dstExtent,
|
||||
VkDeviceSize rowAlignment,
|
||||
const Rc<DxvkImage>& srcImage,
|
||||
VkImageSubresourceLayers srcSubresource,
|
||||
VkOffset3D srcOffset,
|
||||
@ -926,17 +926,8 @@ namespace dxvk {
|
||||
|
||||
m_execAcquires.recordCommands(m_cmd);
|
||||
|
||||
VkBufferImageCopy copyRegion;
|
||||
copyRegion.bufferOffset = dstSlice.offset;
|
||||
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, ©Region);
|
||||
this->copyImageBufferData<false>(DxvkCmdBuffer::ExecBuffer, srcImage, srcSubresource,
|
||||
srcOffset, srcExtent, srcImageLayoutTransfer, dstSlice, rowAlignment, 0);
|
||||
|
||||
m_execBarriers.accessImage(
|
||||
srcImage, srcSubresourceRange,
|
||||
|
@ -409,7 +409,7 @@ namespace dxvk {
|
||||
void copyImageToBuffer(
|
||||
const Rc<DxvkBuffer>& dstBuffer,
|
||||
VkDeviceSize dstOffset,
|
||||
VkExtent2D dstExtent,
|
||||
VkDeviceSize rowAlignment,
|
||||
const Rc<DxvkImage>& srcImage,
|
||||
VkImageSubresourceLayers srcSubresource,
|
||||
VkOffset3D srcOffset,
|
||||
|
Loading…
x
Reference in New Issue
Block a user