From ef176832348b13e1018704f4e7e6b265aa50c8d4 Mon Sep 17 00:00:00 2001 From: Aaron Ruby Date: Fri, 9 Oct 2026 12:19:21 -0400 Subject: [PATCH] Fix Vulkan memoryType selection for QNX Screen buffer imports ... and fall-back to attempting selection using only Screen buffer memoryTypeBits when there is no combined type available. --- host/vulkan/vk_common_operations.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/host/vulkan/vk_common_operations.cpp b/host/vulkan/vk_common_operations.cpp index 50de4f4a4..34ff24f80 100644 --- a/host/vulkan/vk_common_operations.cpp +++ b/host/vulkan/vk_common_operations.cpp @@ -2363,19 +2363,21 @@ bool VkEmulation::allocExternalMemory(VulkanDispatch* vk, VkEmulation::ExternalM // Check that there is a memoryType that covers both the VkImage and the // screenBuffer memory requirements - const uint32_t combinedMemoryTypeBits = + uint32_t combinedMemoryTypeBits = screenBufferProps.memoryTypeBits & cbInfoPtr->imageMemReqs.memoryTypeBits; if (!combinedMemoryTypeBits) { - GFXSTREAM_ERROR( - "There is no common memory type for both screenBuffer requirements (0x%x) " - "and VkImage requirements (0x%x) for ColorBuffer: %d", + GFXSTREAM_WARNING( + "WARNING -- There is no common memory type for both screenBuffer " + "requirements (0x%x) " + "and VkImage requirements (0x%x) for ColorBuffer: %d. Defaulting to " + "selection based of the Screen Buffer's memoryTypeBits on their own.", screenBufferProps.memoryTypeBits, cbInfoPtr->imageMemReqs.memoryTypeBits, cbInfoPtr->handle); - return false; + combinedMemoryTypeBits = screenBufferProps.memoryTypeBits; } // Update the memory type: - info->typeIndex = getValidMemoryTypeIndex(screenBufferProps.memoryTypeBits, - cbInfoPtr->memoryProperty); + info->typeIndex = + getValidMemoryTypeIndex(combinedMemoryTypeBits, cbInfoPtr->memoryProperty); allocInfo.memoryTypeIndex = info->typeIndex; info->qnxScreenStreamHandle = screenStreamBuffer->first;