From ef3f0cb3267056b61ba82fb12b44596e095fa28c Mon Sep 17 00:00:00 2001 From: Powei Feng Date: Tue, 31 Oct 2023 10:36:07 -0700 Subject: [PATCH] vk: assert updateImage is called with non-empty size (#7315) BUG=303073160 --- filament/backend/src/vulkan/VulkanTexture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filament/backend/src/vulkan/VulkanTexture.cpp b/filament/backend/src/vulkan/VulkanTexture.cpp index ec5c3fc93cf..16ab0a2eccf 100644 --- a/filament/backend/src/vulkan/VulkanTexture.cpp +++ b/filament/backend/src/vulkan/VulkanTexture.cpp @@ -272,6 +272,8 @@ void VulkanTexture::updateImage(const PixelBufferDescriptor& data, uint32_t widt return; } + assert_invariant(hostData->size > 0 && "Data is empty"); + // Otherwise, use vkCmdCopyBufferToImage. void* mapped = nullptr; VulkanStage const* stage = mStagePool.acquireStage(hostData->size);