Cocoa: Add support for VK_EXT_metal_surface

This adds optional support for the VK_EXT_metal_surface instance
extension.

Closes #1619.
This commit is contained in:
ByunghoonKim
2020-01-06 00:46:42 +09:00
committed by Camilla Löwy
parent 9372ba95fa
commit c5cb4a253a
8 changed files with 74 additions and 8 deletions
+18
View File
@@ -60,6 +60,7 @@ typedef void* id;
#define NSWindowStyleMaskTitled NSTitledWindowMask
#endif
#if defined(VK_USE_PLATFORM_MACOS_MVK)
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
typedef struct VkMacOSSurfaceCreateInfoMVK
@@ -72,6 +73,23 @@ typedef struct VkMacOSSurfaceCreateInfoMVK
typedef VkResult (APIENTRY *PFN_vkCreateMacOSSurfaceMVK)(VkInstance,const VkMacOSSurfaceCreateInfoMVK*,const VkAllocationCallbacks*,VkSurfaceKHR*);
#elif defined(VK_USE_PLATFORM_METAL_EXT)
#define VK_EXT_metal_surface 1
typedef void CAMetalLayer;
#define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
#define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface"
typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
typedef struct VkMetalSurfaceCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkMetalSurfaceCreateFlagsEXT flags;
const CAMetalLayer* pLayer;
} VkMetalSurfaceCreateInfoEXT;
typedef VkResult (APIENTRY *PFN_vkCreateMetalSurfaceEXT)(VkInstance, const VkMetalSurfaceCreateInfoEXT*, const VkAllocationCallbacks*, VkSurfaceKHR*);
#endif
#include "posix_thread.h"
#include "cocoa_joystick.h"
#include "nsgl_context.h"