27 #include "../../SDL_internal.h" 29 #if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_UIKIT 42 const char* defaultPaths[] = {
48 #define DEFAULT_HANDLE RTLD_DEFAULT 50 int UIKit_Vulkan_LoadLibrary(
_THIS,
const char *
path)
59 return SDL_SetError(
"Vulkan Portability library is already loaded.");
69 vkGetInstanceProcAddr =
71 "vkGetInstanceProcAddr");
74 if (vkGetInstanceProcAddr) {
78 const char *foundPath =
NULL;
97 return SDL_SetError(
"Failed to load Vulkan Portability library");
102 vkGetInstanceProcAddr =
105 "vkGetInstanceProcAddr");
108 if (!vkGetInstanceProcAddr) {
109 SDL_SetError(
"Failed to find %s in either executable or %s: %s",
110 "vkGetInstanceProcAddr",
111 "linked Vulkan Portability library",
112 (
const char *) dlerror());
122 SDL_SetError(
"No vkEnumerateInstanceExtensionProperties found.");
126 extensions = SDL_Vulkan_CreateInstanceExtensionsList(
135 for (
Uint32 i = 0; i < extensionCount; i++) {
145 if (!hasSurfaceExtension) {
146 SDL_SetError(
"Installed Vulkan Portability doesn't implement the " 149 }
else if (!hasIOSSurfaceExtension) {
150 SDL_SetError(
"Installed Vulkan Portability doesn't implement the " 162 void UIKit_Vulkan_UnloadLibrary(
_THIS)
177 static const char *
const extensionsForUIKit[] = {
185 return SDL_Vulkan_GetInstanceExtensions_Helper(
199 (VkInstance)instance,
200 "vkCreateIOSSurfaceMVK");
211 " extension is not enabled in the Vulkan instance.");
217 createInfo.
flags = 0;
218 createInfo.
pView = (__bridge
void *)UIKit_Mtl_AddMetalView(window);
223 SDL_Vulkan_GetResultString(result));
232 UIKit_Mtl_GetDrawableSize(window, w, h);
GLuint GLuint GLsizei count
GLfloat GLfloat GLfloat GLfloat h
struct SDL_VideoDevice::@263 vulkan_config
static SDL_VideoDevice * _this
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME
GLubyte GLubyte GLubyte GLubyte w
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
#define VK_KHR_SURFACE_EXTENSION_NAME
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)
VkResult(VKAPI_PTR * PFN_vkEnumerateInstanceExtensionProperties)(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties)
VkResult(VKAPI_PTR * PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)
VkIOSSurfaceCreateFlagsMVK flags
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
EGLSurface EGLNativeWindowType * window
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties
The type used to identify a window.
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr
#define SDL_arraysize(array)
GLsizei const GLchar *const * path
void * SDL_LoadFunction(void *handle, const char *name)
GLsizei const GLuint * paths