1// Copyright (c) 2018-2020 Nintendo 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[platformCreateSurface_vi]] 6=== VI Platform 7 8[open,refpage='vkCreateViSurfaceNN',desc='Create a slink:VkSurfaceKHR object for a VI layer',type='protos'] 9-- 10To create a sname:VkSurfaceKHR object for an code:nn::code:vi::code:Layer, 11query the layer's native handle using 12code:nn::code:vi::code:GetNativeWindow, and then call: 13 14include::{generated}/api/protos/vkCreateViSurfaceNN.adoc[] 15 16 * pname:instance is the instance with which to associate the surface. 17 * pname:pCreateInfo is a pointer to a sname:VkViSurfaceCreateInfoNN 18 structure containing 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 slink:VkSurfaceKHR handle in which the 24 created surface object is returned. 25 26During the lifetime of a surface created using a particular 27code:nn::code:vi::code:NativeWindowHandle, applications must: not attempt to 28create another surface for the same code:nn::code:vi::code:Layer or attempt 29to connect to the same code:nn::code:vi::code:Layer through other platform 30mechanisms. 31 32If the native window is created with a specified size, pname:currentExtent 33will reflect that size. 34In this case, applications should use the same size for the swapchain's 35pname:imageExtent. 36Otherwise, the pname:currentExtent will have the special value 37[eq]#(0xFFFFFFFF, 0xFFFFFFFF)#, indicating that applications are expected to 38choose an appropriate size for the swapchain's pname:imageExtent (e.g., by 39matching the result of a call to 40code:nn::code:vi::code:GetDisplayResolution). 41 42include::{generated}/validity/protos/vkCreateViSurfaceNN.adoc[] 43-- 44 45[open,refpage='VkViSurfaceCreateInfoNN',desc='Structure specifying parameters of a newly created VI surface object',type='structs'] 46-- 47The sname:VkViSurfaceCreateInfoNN structure is defined as: 48 49include::{generated}/api/structs/VkViSurfaceCreateInfoNN.adoc[] 50 51 * pname:sType is the type of this structure. 52 * pname:pNext is `NULL` or a pointer to a structure extending this 53 structure. 54 * pname:flags is reserved for future use. 55 * pname:window is the code:nn::code:vi::code:NativeWindowHandle for the 56 code:nn::code:vi::code:Layer with which to associate the surface. 57 58.Valid Usage 59**** 60 * [[VUID-VkViSurfaceCreateInfoNN-window-01318]] 61 pname:window must: be a valid code:nn::code:vi::code:NativeWindowHandle 62**** 63 64include::{generated}/validity/structs/VkViSurfaceCreateInfoNN.adoc[] 65-- 66 67[open,refpage='VkViSurfaceCreateFlagsNN',desc='Reserved for future use',type='flags'] 68-- 69include::{generated}/api/flags/VkViSurfaceCreateFlagsNN.adoc[] 70 71tname:VkViSurfaceCreateFlagsNN is a bitmask type for setting a mask, but is 72currently reserved for future use. 73-- 74