Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions host/vulkan/vk_common_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3275,6 +3275,14 @@ bool VkEmulation::readColorBufferToBytesLocked(uint32_t colorBufferHandle, uint3
VkDeviceSize bufferCopySize = transferInfo.stagingBufferCopySize;
const std::vector<VkBufferImageCopy>& bufferImageCopies = transferInfo.bufferImageCopies;

const VkDeviceSize stagingBufferSize = mStaging.mAllocationSize;
if (bufferCopySize > stagingBufferSize) {
GFXSTREAM_ERROR("Failed to read ColorBuffer:%d, transfer size %" PRIu64
" too large for staging buffer size:%" PRIu64 ".",
colorBufferHandle, bufferCopySize, stagingBufferSize);
return false;
}

// Avoid transitioning from VK_IMAGE_LAYOUT_UNDEFINED. Unfortunetly, Android does not
// yet have a mechanism for sharing the expected VkImageLayout. However, the Vulkan
// spec's image layout transition sections says "If the old layout is
Expand Down
Loading