SDL
SDL copied to clipboard
cocoa/uikit: Support VK_EXT_metal_surface
Uses VK_EXT_metal_surface (vkCreateMetalSurfaceEXT) when possible, otherwise falls back to the obsoleted VK_MVK_macos_surface and VK_MVK_ios_surface.
Description
See documentation for VK_EXT_metal_surface.
SDL_cocoavulkan.m and SDL_uikitvulkan.m are nearly identical now, the shared code can likely be easily extracted, but I will leave that as a future improvement.
Existing Issue(s)
Fixes #3906
@slime73, how does this look?
Thanks, I create my Vulkan instance externally, so I missed that.
Since there doesn't appear to be an existing way to check supported extensions when building SDL_Vulkan_GetInstanceExtensions, I simply replaced the legacy extensions with VK_EXT_metal_surface.
This may require a Vulkan SDK update for those using SDL_Vulkan_GetInstanceExtensions, but this extension has been supported since 2019, so it seems relatively minor.
I say yes on this, but let's merge right after 2.24 finalizes.