1// Copyright (c) 2018-2020 The Brenwill Workshop Ltd. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[platformCreateSurface_macos,platformCreateSurface_macos]] 6=== macOS Platform 7 8[open,refpage='vkCreateMacOSSurfaceMVK',desc='Create a VkSurfaceKHR object for a macOS NSView',type='protos'] 9-- 10To create a sname:VkSurfaceKHR object for a macOS code:NSView or 11basetype:CAMetalLayer, call: 12 13include::{generated}/api/protos/vkCreateMacOSSurfaceMVK.txt[] 14 15ifdef::VK_EXT_metal_surface[] 16[NOTE] 17.Note 18==== 19The `vkCreateMacOSSurfaceMVK` function is considered deprecated and has been 20superseded by flink:vkCreateMetalSurfaceEXT from the 21`apiext:VK_EXT_metal_surface` extension. 22==== 23endif::VK_EXT_metal_surface[] 24 25 * pname:instance is the instance with which to associate the surface. 26 * pname:pCreateInfo is a pointer to a slink:VkMacOSSurfaceCreateInfoMVK 27 structure containing parameters affecting the creation of the surface 28 object. 29 * pname:pAllocator is the allocator used for host memory allocated for the 30 surface object when there is no more specific allocator available (see 31 <<memory-allocation,Memory Allocation>>). 32 * pname:pSurface is a pointer to a slink:VkSurfaceKHR handle in which the 33 created surface object is returned. 34 35include::{generated}/validity/protos/vkCreateMacOSSurfaceMVK.txt[] 36-- 37 38[open,refpage='VkMacOSSurfaceCreateInfoMVK',desc='Structure specifying parameters of a newly created macOS surface object',type='structs'] 39-- 40The slink:VkMacOSSurfaceCreateInfoMVK structure is defined as: 41 42include::{generated}/api/structs/VkMacOSSurfaceCreateInfoMVK.txt[] 43 44 * pname:sType is the type of this structure. 45 * pname:pNext is `NULL` or a pointer to a structure extending this 46 structure. 47 * pname:flags is reserved for future use. 48 * pname:pView is a reference to either a basetype:CAMetalLayer object or 49 an code:NSView object. 50 51.Valid Usage 52**** 53 * [[VUID-VkMacOSSurfaceCreateInfoMVK-pView-04144]] 54 If pname:pView is a basetype:CAMetalLayer object, it must: be a valid 55 basetype:CAMetalLayer 56 * [[VUID-VkMacOSSurfaceCreateInfoMVK-pView-01317]] 57 If pname:pView is an code:NSView object, it must: be a valid 58 code:NSView, must: be backed by a code:CALayer object of type 59 basetype:CAMetalLayer, and flink:vkCreateMacOSSurfaceMVK must: be called 60 on the main thread 61**** 62 63include::{generated}/validity/structs/VkMacOSSurfaceCreateInfoMVK.txt[] 64-- 65 66[open,refpage='VkMacOSSurfaceCreateFlagsMVK',desc='Reserved for future use',type='flags'] 67-- 68include::{generated}/api/flags/VkMacOSSurfaceCreateFlagsMVK.txt[] 69 70tname:VkMacOSSurfaceCreateFlagsMVK is a bitmask type for setting a mask, but 71is currently reserved for future use. 72-- 73