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