summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInho Lee <[email protected]>2025-03-10 13:03:23 +0100
committerInho Lee <[email protected]>2025-03-28 16:43:05 +0100
commitc0a01ca6ad48b22cc73ccb72b0757d06b6a74b43 (patch)
treeb1ff0aa5b7bc5831f547971566c8f388009a733d
parentf9d9630e9ec4963b779ed98b9fc50ac03c9156d6 (diff)
rhi: vulkan: Support to read depth textures
When reading back textures, VkImageAspect is just used as VK_IMAGE_ASPECT_COLOR_BIT and it doesn't work for depth/stencil formats. Change-Id: Ib356a0821f9de8e27eb2b9333714fe75971744a2 Reviewed-by: Laszlo Agocs <[email protected]>
-rw-r--r--src/gui/rhi/qrhivulkan.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index f94f27a79e1..c0ade70bf7a 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -4369,7 +4369,7 @@ void QRhiVulkan::enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdat
// Copy from the (optimal and not host visible) image into the buffer.
VkBufferImageCopy copyDesc = {};
copyDesc.bufferOffset = 0;
- copyDesc.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ copyDesc.imageSubresource.aspectMask = aspectMaskForTextureFormat(readback.format);
copyDesc.imageSubresource.mipLevel = uint32_t(u.rb.level());
copyDesc.imageSubresource.baseArrayLayer = is3D ? 0 : uint32_t(u.rb.layer());
copyDesc.imageSubresource.layerCount = 1;