diff options
author | Aaron Ruby <aruby@blackberry.com> | 2024-03-15 15:12:51 -0400 |
---|---|---|
committer | Gurchetan Singh <gurchetansingh@google.com> | 2024-04-23 18:08:50 -0700 |
commit | 64a06812371ee187d87a47e36c10da5cbe889be2 (patch) | |
tree | cb2ce5201fb5f7fe732057b72f92f9b0dce6ae3b | |
parent | 9f755ae1d5b84a8b2ab03bc133ccdee323204df7 (diff) | |
download | gfxstream-64a06812371ee187d87a47e36c10da5cbe889be2.tar.gz |
gfxstream: ColorBufferVk: Don't append VkExternalMemoryImageCreateInfo without a valid handle for import
When not actually importing anything, VkExternalMemoryImageCreateInfo
can change some properties queried from the createdImage (i.e. size does
not have to be provided).
BUG=287083974
TEST=compile
Change-Id: I035f714961ab56a6ea8838f216ae0b05bf83c72b
-rw-r--r-- | host/vulkan/VkCommonOperations.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/host/vulkan/VkCommonOperations.cpp b/host/vulkan/VkCommonOperations.cpp index bd7db479..7ee70416 100644 --- a/host/vulkan/VkCommonOperations.cpp +++ b/host/vulkan/VkCommonOperations.cpp @@ -1943,8 +1943,8 @@ bool initializeVkColorBufferLocked( return false; } - if ((VK_EXT_MEMORY_HANDLE_INVALID != extMemHandle) && - (!sVkEmulation->deviceInfo.supportsExternalMemoryImport)) { + const bool extMemImport = (VK_EXT_MEMORY_HANDLE_INVALID != extMemHandle); + if (extMemImport && !sVkEmulation->deviceInfo.supportsExternalMemoryImport) { VK_COMMON_ERROR( "Failed to initialize Vk ColorBuffer -- extMemHandle provided, but device does " "not support externalMemoryImport"); @@ -1997,8 +1997,7 @@ bool initializeVkColorBufferLocked( VkExternalMemoryImageCreateInfo* extImageCiPtr = nullptr; - if (sVkEmulation->deviceInfo.supportsExternalMemoryImport || - sVkEmulation->deviceInfo.supportsExternalMemoryExport) { + if (extMemImport || sVkEmulation->deviceInfo.supportsExternalMemoryExport) { extImageCiPtr = &extImageCi; } |