1// Copyright (c) 2018-2020 The Brenwill Workshop Ltd.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5[[platformCreateSurface_ios]]
6=== iOS Platform
7
8[open,refpage='vkCreateIOSSurfaceMVK',desc='Create a VkSurfaceKHR object for an iOS UIView',type='protos']
9--
10:refpage: vkCreateIOSSurfaceMVK
11
12To create a sname:VkSurfaceKHR object for an iOS code:UIView or
13basetype:CAMetalLayer, call:
14
15include::{generated}/api/protos/vkCreateIOSSurfaceMVK.adoc[]
16
17ifdef::VK_EXT_metal_surface[]
18[NOTE]
19.Note
20====
21The `vkCreateIOSSurfaceMVK` 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:VkIOSSurfaceCreateInfoMVK
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/vkCreateIOSSurfaceMVK.adoc[]
38--
39
40[open,refpage='VkIOSSurfaceCreateInfoMVK',desc='Structure specifying parameters of a newly created iOS surface object',type='structs']
41--
42The slink:VkIOSSurfaceCreateInfoMVK structure is defined as:
43
44include::{generated}/api/structs/VkIOSSurfaceCreateInfoMVK.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 a
51    code:UIView object.
52
53.Valid Usage
54****
55  * [[VUID-VkIOSSurfaceCreateInfoMVK-pView-04143]]
56    If pname:pView is a basetype:CAMetalLayer object, it must: be a valid
57    basetype:CAMetalLayer
58  * [[VUID-VkIOSSurfaceCreateInfoMVK-pView-01316]]
59    If pname:pView is a code:UIView object, it must: be a valid code:UIView,
60    must: be backed by a code:CALayer object of type basetype:CAMetalLayer,
61    and flink:vkCreateIOSSurfaceMVK must: be called on the main thread
62****
63
64include::{generated}/validity/structs/VkIOSSurfaceCreateInfoMVK.adoc[]
65--
66
67[open,refpage='VkIOSSurfaceCreateFlagsMVK',desc='Reserved for future use',type='flags']
68--
69include::{generated}/api/flags/VkIOSSurfaceCreateFlagsMVK.adoc[]
70
71tname:VkIOSSurfaceCreateFlagsMVK is a bitmask type for setting a mask, but
72is currently reserved for future use.
73--
74