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