Commit 654b3c56 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Fix multi-layer image readback

The buffer size did not take layer count into account. angleproject: 2828 Change-Id: I94b9294503d785d3e727422550d7e4643eed1917 Reviewed-on: https://chromium-review.googlesource.com/c/1359618 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent e3e680ca
...@@ -757,7 +757,8 @@ angle::Result TextureVk::copyImageDataToBuffer(ContextVk *contextVk, ...@@ -757,7 +757,8 @@ angle::Result TextureVk::copyImageDataToBuffer(ContextVk *contextVk,
ANGLE_TRY(ensureImageInitialized(contextVk)); ANGLE_TRY(ensureImageInitialized(contextVk));
const angle::Format &imageFormat = getImage().getFormat().textureFormat(); const angle::Format &imageFormat = getImage().getFormat().textureFormat();
size_t sourceCopyAllocationSize = sourceArea.width * sourceArea.height * imageFormat.pixelBytes; size_t sourceCopyAllocationSize =
sourceArea.width * sourceArea.height * imageFormat.pixelBytes * layerCount;
vk::CommandBuffer *commandBuffer = nullptr; vk::CommandBuffer *commandBuffer = nullptr;
ANGLE_TRY(mImage.recordCommands(contextVk, &commandBuffer)); ANGLE_TRY(mImage.recordCommands(contextVk, &commandBuffer));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment