1// Copyright 2018-2021 The Khronos Group, Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[platformCreateSurface_metal,platformCreateSurface_metal]] 6 7=== Metal Platform 8 9[open,refpage='vkCreateMetalSurfaceEXT',desc='Create a VkSurfaceKHR object for CAMetalLayer',type='protos'] 10-- 11To create a sname:VkSurfaceKHR object for a basetype:CAMetalLayer, call: 12 13include::{generated}/api/protos/vkCreateMetalSurfaceEXT.txt[] 14 15 * pname:instance is the instance with which to associate the surface. 16 * pname:pCreateInfo is a pointer to a slink:VkMetalSurfaceCreateInfoEXT 17 structure specifying parameters affecting the creation of the surface 18 object. 19 * pname:pAllocator is the allocator used for host memory allocated for the 20 surface object when there is no more specific allocator available (see 21 <<memory-allocation,Memory Allocation>>). 22 * pname:pSurface is a pointer to a sname:VkSurfaceKHR handle in which the 23 created surface object is returned. 24 25include::{generated}/validity/protos/vkCreateMetalSurfaceEXT.txt[] 26-- 27 28[open,refpage='VkMetalSurfaceCreateInfoEXT',desc='Structure specifying parameters of a newly created Metal surface object',type='structs'] 29-- 30The slink:VkMetalSurfaceCreateInfoEXT structure is defined as: 31 32include::{generated}/api/structs/VkMetalSurfaceCreateInfoEXT.txt[] 33 34 * pname:sType is the type of this structure. 35 * pname:pNext is `NULL` or a pointer to a structure extending this 36 structure. 37 * pname:flags is reserved for future use. 38 * pname:pLayer is a reference to a basetype:CAMetalLayer object 39 representing a renderable surface. 40 41include::{generated}/validity/structs/VkMetalSurfaceCreateInfoEXT.txt[] 42-- 43 44[open,refpage='CAMetalLayer',desc='CoreAnimation native layer type for Metal',type='basetypes'] 45-- 46To remove an unnecessary compile-time dependency, an incomplete type 47definition of basetype:CAMetalLayer is provided in the Vulkan headers: 48 49include::{generated}/api/basetypes/CAMetalLayer.txt[] 50 51The actual basetype:CAMetalLayer type is defined in the QuartzCore 52framework. 53-- 54 55[open,refpage='VkMetalSurfaceCreateFlagsEXT',desc='Reserved for future use',type='flags'] 56-- 57include::{generated}/api/flags/VkMetalSurfaceCreateFlagsEXT.txt[] 58 59tname:VkMetalSurfaceCreateFlagsEXT is a bitmask type for setting a mask, but 60is currently reserved for future use. 61-- 62