Update guest encoder generated code for MoltenVK
Bug: 177241396
Change-Id: I17663ddab5cceebbc7b32295612e2b413558ad6e
diff --git a/system/vulkan/func_table.cpp b/system/vulkan/func_table.cpp
index 6a4a128..b5b1174 100644
--- a/system/vulkan/func_table.cpp
+++ b/system/vulkan/func_table.cpp
@@ -5365,6 +5365,60 @@
vkEnc->vkGetLinearImageLayoutGOOGLE(device, format, pOffset, pRowPitchAlignment);
}
#endif
+#ifdef VK_MVK_moltenvk
+static void entry_vkGetMTLDeviceMVK(
+ VkPhysicalDevice physicalDevice,
+ void** pMTLDevice)
+{
+ AEMU_SCOPED_TRACE("vkGetMTLDeviceMVK");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ vkEnc->vkGetMTLDeviceMVK(physicalDevice, pMTLDevice);
+}
+static VkResult entry_vkSetMTLTextureMVK(
+ VkImage image,
+ void* mtlTexture)
+{
+ AEMU_SCOPED_TRACE("vkSetMTLTextureMVK");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ VkResult vkSetMTLTextureMVK_VkResult_return = (VkResult)0;
+ vkSetMTLTextureMVK_VkResult_return = vkEnc->vkSetMTLTextureMVK(image, mtlTexture);
+ return vkSetMTLTextureMVK_VkResult_return;
+}
+static void entry_vkGetMTLTextureMVK(
+ VkImage image,
+ void** pMTLTexture)
+{
+ AEMU_SCOPED_TRACE("vkGetMTLTextureMVK");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ vkEnc->vkGetMTLTextureMVK(image, pMTLTexture);
+}
+static void entry_vkGetMTLBufferMVK(
+ VkBuffer buffer,
+ void** pMTLBuffer)
+{
+ AEMU_SCOPED_TRACE("vkGetMTLBufferMVK");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ vkEnc->vkGetMTLBufferMVK(buffer, pMTLBuffer);
+}
+static VkResult entry_vkUseIOSurfaceMVK(
+ VkImage image,
+ void* ioSurface)
+{
+ AEMU_SCOPED_TRACE("vkUseIOSurfaceMVK");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ VkResult vkUseIOSurfaceMVK_VkResult_return = (VkResult)0;
+ vkUseIOSurfaceMVK_VkResult_return = vkEnc->vkUseIOSurfaceMVK(image, ioSurface);
+ return vkUseIOSurfaceMVK_VkResult_return;
+}
+static void entry_vkGetIOSurfaceMVK(
+ VkImage image,
+ void** pIOSurface)
+{
+ AEMU_SCOPED_TRACE("vkGetIOSurfaceMVK");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ vkEnc->vkGetIOSurfaceMVK(image, pIOSurface);
+}
+#endif
void* goldfish_vulkan_get_proc_address(const char* name){
#ifdef VK_VERSION_1_0
if (!strcmp(name, "vkCreateInstance"))
@@ -6846,6 +6900,32 @@
return nullptr;
}
#endif
+#ifdef VK_MVK_moltenvk
+ if (!strcmp(name, "vkGetMTLDeviceMVK"))
+ {
+ return nullptr;
+ }
+ if (!strcmp(name, "vkSetMTLTextureMVK"))
+ {
+ return nullptr;
+ }
+ if (!strcmp(name, "vkGetMTLTextureMVK"))
+ {
+ return nullptr;
+ }
+ if (!strcmp(name, "vkGetMTLBufferMVK"))
+ {
+ return nullptr;
+ }
+ if (!strcmp(name, "vkUseIOSurfaceMVK"))
+ {
+ return nullptr;
+ }
+ if (!strcmp(name, "vkGetIOSurfaceMVK"))
+ {
+ return nullptr;
+ }
+#endif
return nullptr;
}
void* goldfish_vulkan_get_instance_proc_address(VkInstance instance, const char* name){
@@ -8428,6 +8508,38 @@
return (void*)dynCheck_entry_vkGetLinearImageLayoutGOOGLE;
}
#endif
+#ifdef VK_MVK_moltenvk
+ if (!strcmp(name, "vkGetMTLDeviceMVK"))
+ {
+ bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetMTLDeviceMVK : nullptr;
+ }
+ if (!strcmp(name, "vkSetMTLTextureMVK"))
+ {
+ bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkSetMTLTextureMVK : nullptr;
+ }
+ if (!strcmp(name, "vkGetMTLTextureMVK"))
+ {
+ bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetMTLTextureMVK : nullptr;
+ }
+ if (!strcmp(name, "vkGetMTLBufferMVK"))
+ {
+ bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetMTLBufferMVK : nullptr;
+ }
+ if (!strcmp(name, "vkUseIOSurfaceMVK"))
+ {
+ bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkUseIOSurfaceMVK : nullptr;
+ }
+ if (!strcmp(name, "vkGetIOSurfaceMVK"))
+ {
+ bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetIOSurfaceMVK : nullptr;
+ }
+#endif
return nullptr;
}
void* goldfish_vulkan_get_device_proc_address(VkDevice device, const char* name){
@@ -10082,6 +10194,38 @@
return hasExt ? (void*)entry_vkGetLinearImageLayoutGOOGLE : nullptr;
}
#endif
+#ifdef VK_MVK_moltenvk
+ if (!strcmp(name, "vkGetMTLDeviceMVK"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetMTLDeviceMVK : nullptr;
+ }
+ if (!strcmp(name, "vkSetMTLTextureMVK"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkSetMTLTextureMVK : nullptr;
+ }
+ if (!strcmp(name, "vkGetMTLTextureMVK"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetMTLTextureMVK : nullptr;
+ }
+ if (!strcmp(name, "vkGetMTLBufferMVK"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetMTLBufferMVK : nullptr;
+ }
+ if (!strcmp(name, "vkUseIOSurfaceMVK"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkUseIOSurfaceMVK : nullptr;
+ }
+ if (!strcmp(name, "vkGetIOSurfaceMVK"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+ return hasExt ? (void*)entry_vkGetIOSurfaceMVK : nullptr;
+ }
+#endif
return nullptr;
}