27 #include "../../SDL_internal.h"
29 #if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_UIKIT
41 const char* defaultPaths[] = {
47 #define DEFAULT_HANDLE RTLD_DEFAULT
49 int UIKit_Vulkan_LoadLibrary(
_THIS,
const char *
path)
58 return SDL_SetError(
"Vulkan Portability library is already loaded.");
70 "vkGetInstanceProcAddr");
77 const char *foundPath =
NULL;
96 return SDL_SetError(
"Failed to load Vulkan Portability library");
104 "vkGetInstanceProcAddr");
108 SDL_SetError(
"Failed to find %s in either executable or %s: %s",
109 "vkGetInstanceProcAddr",
110 "linked Vulkan Portability library",
111 (
const char *) dlerror());
121 SDL_SetError(
"No vkEnumerateInstanceExtensionProperties found.");
125 extensions = SDL_Vulkan_CreateInstanceExtensionsList(
134 for (
Uint32 i = 0;
i < extensionCount;
i++) {
144 if (!hasSurfaceExtension) {
145 SDL_SetError(
"Installed Vulkan Portability doesn't implement the "
148 }
else if (!hasIOSSurfaceExtension) {
149 SDL_SetError(
"Installed Vulkan Portability doesn't implement the "
161 void UIKit_Vulkan_UnloadLibrary(
_THIS)
176 static const char *
const extensionsForUIKit[] = {
184 return SDL_Vulkan_GetInstanceExtensions_Helper(
198 (VkInstance)instance,
199 "vkCreateIOSSurfaceMVK");
211 " extension is not enabled in the Vulkan instance.");
216 if (metalview ==
NULL) {
222 createInfo.
flags = 0;
223 createInfo.
pView = (
const void *)metalview;
227 UIKit_Metal_DestroyView(
_this, metalview);
229 SDL_Vulkan_GetResultString(
result));
238 CFBridgingRelease(metalview);
void * SDL_LoadFunction(void *handle, const char *name)
GLuint GLuint GLsizei count
GLsizei const GLuint * paths
GLsizei const GLchar *const * path
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
#define SDL_arraysize(array)
static SDL_VideoDevice * _this
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)
EGLSurface EGLNativeWindowType * window
struct SDL_VideoDevice::@441 vulkan_config
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties
The type used to identify a window.
VkIOSSurfaceCreateFlagsMVK flags
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName)
#define VK_KHR_SURFACE_EXTENSION_NAME
VkResult(VKAPI_PTR * PFN_vkEnumerateInstanceExtensionProperties)(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties)
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
@ VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME
VkResult(VKAPI_PTR * PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)