SDL icon indicating copy to clipboard operation
SDL copied to clipboard

cocoa/uikit: Support VK_EXT_metal_surface

Open encounter opened this issue 3 years ago • 3 comments

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

encounter avatar May 19 '22 20:05 encounter

@slime73, how does this look?

slouken avatar May 19 '22 22:05 slouken

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.

encounter avatar May 20 '22 17:05 encounter

I say yes on this, but let's merge right after 2.24 finalizes.

icculus avatar Aug 09 '22 15:08 icculus