/ chapters / VK_NN_vi_surface / platformCreateSurface_vi.txt
platformCreateSurface_vi.txt
 1  [[platformCreateSurface_vi,platformCreateSurface_vi]]
 2  
 3  === VI Platform
 4  
 5  [open,refpage='vkCreateViSurfaceNN',desc='Create a slink:VkSurfaceKHR object for a VI layer',type='protos']
 6  --
 7  
 8  To create a sname:VkSurfaceKHR object for an code:nn::code:vi::code:Layer,
 9  query the layer's native handle using
10  code:nn::code:vi::code:GetNativeWindow, and then call:
11  
12  include::{generated}/api/protos/vkCreateViSurfaceNN.txt[]
13  
14    * pname:instance is the instance with which to associate the surface.
15    * pname:pCreateInfo is a pointer to an instance of the
16      sname:VkViSurfaceCreateInfoNN structure containing parameters affecting
17      the creation of the surface object.
18    * pname:pAllocator is the allocator used for host memory allocated for the
19      surface object when there is no more specific allocator available (see
20      <<memory-allocation,Memory Allocation>>).
21    * pname:pSurface points to a slink:VkSurfaceKHR handle in which the
22      created surface object is returned.
23  
24  During the lifetime of a surface created using a particular
25  code:nn::code:vi::code:NativeWindowHandle, applications must: not attempt to
26  create another surface for the same code:nn::code:vi::code:Layer or attempt
27  to connect to the same code:nn::code:vi::code:Layer through other platform
28  mechanisms.
29  
30  If the native window is created with a specified size, pname:currentExtent
31  will reflect that size.
32  In this case, applications should use the same size for the swapchain's
33  pname:imageExtent.
34  Otherwise, the pname:currentExtent will have the special value
35  [eq]#(0xFFFFFFFF, 0xFFFFFFFF)#, indicating that applications are expected to
36  choose an appropriate size for the swapchain's pname:imageExtent (e.g., by
37  matching the result of a call to
38  code:nn::code:vi::code:GetDisplayResolution).
39  
40  include::{generated}/validity/protos/vkCreateViSurfaceNN.txt[]
41  --
42  
43  [open,refpage='VkViSurfaceCreateInfoNN',desc='Structure specifying parameters of a newly created VI surface object',type='structs']
44  --
45  
46  The sname:VkViSurfaceCreateInfoNN structure is defined as:
47  
48  include::{generated}/api/structs/VkViSurfaceCreateInfoNN.txt[]
49  
50    * pname:sType is the type of this structure.
51    * pname:pNext is `NULL` or a pointer to an extension-specific structure.
52    * pname:flags is reserved for future use.
53    * pname:window is the code:nn::code:vi::code:NativeWindowHandle for the
54      code:nn::code:vi::code:Layer with which to associate the surface.
55  
56  .Valid Usage
57  ****
58    * [[VUID-VkViSurfaceCreateInfoNN-window-01318]]
59      pname:window must: be a valid code:nn::code:vi::code:NativeWindowHandle
60  ****
61  
62  include::{generated}/validity/structs/VkViSurfaceCreateInfoNN.txt[]
63  --
64