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:
parent
a660b35f6e
commit
6462174c13
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
|
@ -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, ©Region);
|
|
||||||
|
|
||||||
m_execBarriers.accessImage(
|
m_execBarriers.accessImage(
|
||||||
srcImage, srcSubresourceRange,
|
srcImage, srcSubresourceRange,
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user