Remove direct usages of MoltenVK library functions

These APIs and the related extension are deprecated in favor of the new
metal_objects extension to make sure the loader can intercept them, so that the layers, such as VVL, would work fine.
Removes necessity to load functions directly from a separate dylib.
VK_MVK_moltenvk extension support is still passed to the guest side
due to the existing checks for enabling the AHB extension.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Serdar Kocdemir
2024-06-26 22:34:31 +01:00
committed by Marge Bot
parent a7fdf81103
commit 96b42bdbee
5 changed files with 2 additions and 58 deletions

View File

@@ -46,14 +46,7 @@ getProcAddrFuncs = [
# address using vkGetInstProcAddr() or vkGetDeviceProcAddr(). These function
# pointers should only be initialized when setting up the dispatch from system
# loader.
getProcAddrOnlyFuncs = [
"vkGetMTLDeviceMVK",
"vkSetMTLTextureMVK",
"vkGetMTLTextureMVK",
"vkGetMTLBufferMVK",
"vkUseIOSurfaceMVK",
"vkGetIOSurfaceMVK",
]
getProcAddrOnlyFuncs = []
getInstanceProcAddrNoInstanceFuncs = [
"vkCreateInstance",

View File

@@ -346,12 +346,6 @@ KNOWN_FUNCTION_OPCODES = {
"vkQueueWaitIdleAsyncGOOGLE": 20331,
"vkQueueBindSparseAsyncGOOGLE": 20332,
"vkGetLinearImageLayoutGOOGLE": 20333,
"vkGetMTLDeviceMVK": 20334,
"vkSetMTLTextureMVK": 20335,
"vkGetMTLTextureMVK": 20336,
"vkGetMTLBufferMVK": 20337,
"vkUseIOSurfaceMVK": 20338,
"vkGetIOSurfaceMVK": 20339,
"vkQueueFlushCommandsGOOGLE": 20340,
"vkGetBlobGOOGLE": 20341,
}

View File

@@ -120,7 +120,6 @@ SUPPORTED_FEATURES = [
"VK_KHR_xcb_surface",
"VK_KHR_win32_surface",
"VK_EXT_metal_surface",
"VK_MVK_moltenvk",
"VK_EXT_metal_objects",
"VK_KHR_external_semaphore_win32",
"VK_KHR_external_memory_win32",
@@ -160,9 +159,6 @@ SUPPORTED_MODULES = {
"VK_KHR_xcb_surface": ["goldfish_vk_dispatch"],
"VK_KHR_win32_surface": ["goldfish_vk_dispatch"],
"VK_EXT_metal_surface": ["goldfish_vk_dispatch"],
# VK_MVK_moltenvk doesn't generate a generate dispatch entry for some reason, but should. The
# lack of this extension doesn't cause any build failures though.
"VK_MVK_moltenvk": ["goldfish_vk_dispatch"],
"VK_EXT_metal_objects": ["goldfish_vk_dispatch"],
"VK_KHR_external_semaphore_win32" : ["goldfish_vk_dispatch"],
"VK_KHR_external_memory_win32" : ["goldfish_vk_dispatch"],

View File

@@ -246,36 +246,6 @@ specific entries.
<param><type>VkDeviceSize</type> <name>dataOffset</name></param>
<param><type>VkDeviceSize</type> <name>dataSize</name></param>
</command>
<command>
<proto><type>void</type> <name>vkGetMTLDeviceMVK</name></proto>
<param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
<param><type>void</type>** <name>pMTLDevice</name></param>
</command>
<command successcodes="VK_SUCCESS">
<proto><type>VkResult</type> <name>vkSetMTLTextureMVK</name></proto>
<param><type>VkImage</type> <name>image</name></param>
<param><type>void</type>* <name>mtlTexture</name></param>
</command>
<command>
<proto><type>void</type> <name>vkGetMTLTextureMVK</name></proto>
<param><type>VkImage</type> <name>image</name></param>
<param><type>void</type>** <name>pMTLTexture</name></param>
</command>
<command>
<proto><type>void</type> <name>vkGetMTLBufferMVK</name></proto>
<param><type>VkBuffer</type> <name>buffer</name></param>
<param><type>void</type>** <name>pMTLBuffer</name></param>
</command>
<command successcodes="VK_SUCCESS">
<proto><type>VkResult</type> <name>vkUseIOSurfaceMVK</name></proto>
<param><type>VkImage</type> <name>image</name></param>
<param><type>void</type>* <name>ioSurface</name></param>
</command>
<command>
<proto><type>void</type> <name>vkGetIOSurfaceMVK</name></proto>
<param><type>VkImage</type> <name>image</name></param>
<param><type>void</type>** <name>pIOSurface</name></param>
</command>
</commands>
<extensions comment="Vulkan extension interface definitions">
<extension name="VK_ANDROID_native_buffer" supported="vulkan"/>
@@ -316,15 +286,5 @@ specific entries.
<command name="vkQueueSubmitAsync2GOOGLE"/>
</require>
</extension>
<extension name="VK_MVK_moltenvk" supported="vulkan">
<require>
<command name="vkGetMTLDeviceMVK"/>
<command name="vkSetMTLTextureMVK"/>
<command name="vkGetMTLTextureMVK"/>
<command name="vkGetMTLBufferMVK"/>
<command name="vkUseIOSurfaceMVK"/>
<command name="vkGetIOSurfaceMVK"/>
</require>
</extension>
</extensions>
</registry>

View File

@@ -1855,6 +1855,7 @@ VkResult ResourceTracker::on_vkEnumerateDeviceExtensionProperties(
bool win32ExtMemAvailable = getHostDeviceExtensionIndex("VK_KHR_external_memory_win32") != -1;
bool posixExtMemAvailable = getHostDeviceExtensionIndex("VK_KHR_external_memory_fd") != -1;
//TODO(b/349066492): this should check external_memory_metal extension when it's ready
bool moltenVkExtAvailable = getHostDeviceExtensionIndex("VK_MVK_moltenvk") != -1;
bool qnxExtMemAvailable =
getHostDeviceExtensionIndex("VK_QNX_external_memory_screen_buffer") != -1;