Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion host/vulkan/VkCommonOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ std::unique_ptr<VkEmulation> VkEmulation::create(VulkanDispatch* gvk,
}

// TODO([email protected]): Remove once dmabuf extension support has been flushed out on QNX
#if !defined(__QNX__)
#if !defined(__QNX__) && !defined(__APPLE__)
bool dmaBufBlockList = (deviceInfos[i].driverVendor == "NVIDIA (Vendor 0x10de)");
#ifdef CONFIG_AEMU
// TODO(b/400999642): dma_buf support should be checked with image format support
Expand Down
11 changes: 10 additions & 1 deletion host/vulkan/VkDecoderGlobalState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static constexpr const char* const kEmulatedDeviceExtensions[] = {
VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME,
VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME,
VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME,
#if defined(__QNX__)
#if defined(__QNX__) || defined(__APPLE__)
VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME,
#endif
Expand Down Expand Up @@ -1921,6 +1921,15 @@ class VkDecoderGlobalState::Impl {
}
#endif

// VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME is emulated by gfxstream
if (!hasDeviceExtension(properties, VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ideally requires checking in shouldPassthrough, as otherwise it will directly return vkEnumerateDeviceExtensionProperties results for non-moltenvk cases.

On the other hand, VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME is already in kEmulatedDeviceExtensions, so this requires a change on the guest side.

Looking at the guest side code, looks like currently it's only enabled for android guests:

    if (hostHasExternalMemorySupport) {
#ifdef VK_USE_PLATFORM_ANDROID_KHR
        filteredExts.push_back(
            VkExtensionProperties{"VK_ANDROID_external_memory_android_hardware_buffer", 7});
        filteredExts.push_back(VkExtensionProperties{"VK_EXT_queue_family_foreign", 1});
#endif
#ifdef VK_USE_PLATFORM_FUCHSIA
        filteredExts.push_back(VkExtensionProperties{"VK_FUCHSIA_external_memory", 1});
        filteredExts.push_back(VkExtensionProperties{"VK_FUCHSIA_buffer_collection", 1});
#endif
    } else {
...

So, this change needs to be made on mesa3d side instead to include linux guests.

VkExtensionProperties queue_props;
strncpy(queue_props.extensionName, VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME,
sizeof(queue_props.extensionName));
queue_props.specVersion = VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION;
properties.push_back(queue_props);
}

if (m_vkEmulation->isYcbcrEmulationEnabled() &&
!hasDeviceExtension(properties, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME)) {
VkExtensionProperties ycbcr_props;
Expand Down