Hint buffer creations for VulkanAllocateHostMemory

Add VkExternalMemoryBufferCreateInfo to buffer creations to hint that
host allocations may be used for its memory. This is necessary to
invalid usage when VkExternalMemoryBufferCreateInfo is enabled.

Bug: 354139765
Test: run vulkan apps with -feature VulkanAllocateHostMemory and VVL
Change-Id: I67322444c2948022d75ca13f34aa936d76589650
diff --git a/host/vulkan/VkDecoderGlobalState.cpp b/host/vulkan/VkDecoderGlobalState.cpp
index dfb65a8..2d2ea2b 100644
--- a/host/vulkan/VkDecoderGlobalState.cpp
+++ b/host/vulkan/VkDecoderGlobalState.cpp
@@ -2032,6 +2032,21 @@
             pCreateInfo = &localCreateInfo;
         }
 
+        VkExternalMemoryBufferCreateInfo externalCI = {
+            VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO};
+        if (m_emu->features.VulkanAllocateHostMemory.enabled) {
+            localCreateInfo = *pCreateInfo;
+            // Hint that we 'may' use host allocation for this buffer. This will only be used for
+            // host visible memory.
+            externalCI.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
+
+            // Insert the new struct to the chain
+            externalCI.pNext = localCreateInfo.pNext;
+            localCreateInfo.pNext = &externalCI;
+
+            pCreateInfo = &localCreateInfo;
+        }
+
         VkResult result = vk->vkCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
 
         if (result == VK_SUCCESS) {