1e5c31af7Sopenharmony_ci// Copyright 2014-2021 The Khronos Group, Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ciinclude::{generated}/meta/{refprefix}VK_KHR_swapchain.txt[]
6e5c31af7Sopenharmony_ci
7e5c31af7Sopenharmony_ci=== Other Extension Metadata
8e5c31af7Sopenharmony_ci
9e5c31af7Sopenharmony_ci*Last Modified Date*::
10e5c31af7Sopenharmony_ci    2017-10-06
11e5c31af7Sopenharmony_ci*IP Status*::
12e5c31af7Sopenharmony_ci    No known IP claims.
13e5c31af7Sopenharmony_ci*Interactions and External Dependencies*::
14e5c31af7Sopenharmony_ci  - Interacts with Vulkan 1.1
15e5c31af7Sopenharmony_ci*Contributors*::
16e5c31af7Sopenharmony_ci  - Patrick Doane, Blizzard
17e5c31af7Sopenharmony_ci  - Ian Elliott, LunarG
18e5c31af7Sopenharmony_ci  - Jesse Hall, Google
19e5c31af7Sopenharmony_ci  - Mathias Heyer, NVIDIA
20e5c31af7Sopenharmony_ci  - James Jones, NVIDIA
21e5c31af7Sopenharmony_ci  - David Mao, AMD
22e5c31af7Sopenharmony_ci  - Norbert Nopper, Freescale
23e5c31af7Sopenharmony_ci  - Alon Or-bach, Samsung
24e5c31af7Sopenharmony_ci  - Daniel Rakos, AMD
25e5c31af7Sopenharmony_ci  - Graham Sellers, AMD
26e5c31af7Sopenharmony_ci  - Jeff Vigil, Qualcomm
27e5c31af7Sopenharmony_ci  - Chia-I Wu, LunarG
28e5c31af7Sopenharmony_ci  - Jason Ekstrand, Intel
29e5c31af7Sopenharmony_ci  - Matthaeus G. Chajdas, AMD
30e5c31af7Sopenharmony_ci  - Ray Smith, ARM
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ci=== Description
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_ciThe `VK_KHR_swapchain` extension is the device-level companion to the
35e5c31af7Sopenharmony_ci`apiext:VK_KHR_surface` extension.
36e5c31af7Sopenharmony_ciIt introduces slink:VkSwapchainKHR objects, which provide the ability to
37e5c31af7Sopenharmony_cipresent rendering results to a surface.
38e5c31af7Sopenharmony_ci
39e5c31af7Sopenharmony_ciinclude::{generated}/interfaces/VK_KHR_swapchain.txt[]
40e5c31af7Sopenharmony_ci
41e5c31af7Sopenharmony_ci=== Issues
42e5c31af7Sopenharmony_ci
43e5c31af7Sopenharmony_ci1) Does this extension allow the application to specify the memory backing
44e5c31af7Sopenharmony_ciof the presentable images?
45e5c31af7Sopenharmony_ci
46e5c31af7Sopenharmony_ci*RESOLVED*: No.
47e5c31af7Sopenharmony_ciUnlike standard images, the implementation will allocate the memory backing
48e5c31af7Sopenharmony_ciof the presentable image.
49e5c31af7Sopenharmony_ci
50e5c31af7Sopenharmony_ci2) What operations are allowed on presentable images?
51e5c31af7Sopenharmony_ci
52e5c31af7Sopenharmony_ci*RESOLVED*: This is determined by the image usage flags specified when
53e5c31af7Sopenharmony_cicreating the presentable image's swapchain.
54e5c31af7Sopenharmony_ci
55e5c31af7Sopenharmony_ci3) Does this extension support MSAA presentable images?
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_ci*RESOLVED*: No.
58e5c31af7Sopenharmony_ciPresentable images are always single-sampled.
59e5c31af7Sopenharmony_ciMulti-sampled rendering must use regular images.
60e5c31af7Sopenharmony_ciTo present the rendering results the application must manually resolve the
61e5c31af7Sopenharmony_cimulti- sampled image to a single-sampled presentable image prior to
62e5c31af7Sopenharmony_cipresentation.
63e5c31af7Sopenharmony_ci
64e5c31af7Sopenharmony_ci4) Does this extension support stereo/multi-view presentable images?
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
67e5c31af7Sopenharmony_ciThe number of views associated with a presentable image is determined by the
68e5c31af7Sopenharmony_cipname:imageArrayLayers specified when creating a swapchain.
69e5c31af7Sopenharmony_ciAll presentable images in a given swapchain use the same array size.
70e5c31af7Sopenharmony_ci
71e5c31af7Sopenharmony_ci5) Are the layers of stereo presentable images half-sized?
72e5c31af7Sopenharmony_ci
73e5c31af7Sopenharmony_ci*RESOLVED*: No.
74e5c31af7Sopenharmony_ciThe image extents always match those requested by the application.
75e5c31af7Sopenharmony_ci
76e5c31af7Sopenharmony_ci6) Do the "`present`" and "`acquire next image`" commands operate on a
77e5c31af7Sopenharmony_ciqueue? If not, do they need to include explicit semaphore objects to
78e5c31af7Sopenharmony_ciinterlock them with queue operations?
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ci*RESOLVED*: The present command operates on a queue.
81e5c31af7Sopenharmony_ciThe image ownership operation it represents happens in order with other
82e5c31af7Sopenharmony_cioperations on the queue, so no explicit semaphore object is required to
83e5c31af7Sopenharmony_cisynchronize its actions.
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_ciApplications may want to acquire the next image in separate threads from
86e5c31af7Sopenharmony_cithose in which they manage their queue, or in multiple threads.
87e5c31af7Sopenharmony_ciTo make such usage easier, the acquire next image command takes a semaphore
88e5c31af7Sopenharmony_cito signal as a method of explicit synchronization.
89e5c31af7Sopenharmony_ciThe application must later queue a wait for this semaphore before queuing
90e5c31af7Sopenharmony_ciexecution of any commands using the image.
91e5c31af7Sopenharmony_ci
92e5c31af7Sopenharmony_ci7) Does flink:vkAcquireNextImageKHR block if no images are available?
93e5c31af7Sopenharmony_ci
94e5c31af7Sopenharmony_ci*RESOLVED*: The command takes a timeout parameter.
95e5c31af7Sopenharmony_ciSpecial values for the timeout are 0, which makes the call a non-blocking
96e5c31af7Sopenharmony_cioperation, and code:UINT64_MAX, which blocks indefinitely.
97e5c31af7Sopenharmony_ciValues in between will block for up to the specified time.
98e5c31af7Sopenharmony_ciThe call will return when an image becomes available or an error occurs.
99e5c31af7Sopenharmony_ciIt may, but is not required to, return before the specified timeout expires
100e5c31af7Sopenharmony_ciif the swapchain becomes out of date.
101e5c31af7Sopenharmony_ci
102e5c31af7Sopenharmony_ci8) Can multiple presents be queued using one flink:vkQueuePresentKHR call?
103e5c31af7Sopenharmony_ci
104e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
105e5c31af7Sopenharmony_cislink:VkPresentInfoKHR contains a list of swapchains and corresponding image
106e5c31af7Sopenharmony_ciindices that will be presented.
107e5c31af7Sopenharmony_ciWhen supported, all presentations queued with a single
108e5c31af7Sopenharmony_ciflink:vkQueuePresentKHR call will be applied atomically as one operation.
109e5c31af7Sopenharmony_ciThe same swapchain must not appear in the list more than once.
110e5c31af7Sopenharmony_ciLater extensions may provide applications stronger guarantees of atomicity
111e5c31af7Sopenharmony_cifor such present operations, and/or allow them to query whether atomic
112e5c31af7Sopenharmony_cipresentation of a particular group of swapchains is possible.
113e5c31af7Sopenharmony_ci
114e5c31af7Sopenharmony_ci9) How do the presentation and acquire next image functions notify the
115e5c31af7Sopenharmony_ciapplication the targeted surface has changed?
116e5c31af7Sopenharmony_ci
117e5c31af7Sopenharmony_ci*RESOLVED*: Two new result codes are introduced for this purpose:
118e5c31af7Sopenharmony_ci
119e5c31af7Sopenharmony_ci  * ename:VK_SUBOPTIMAL_KHR - Presentation will still succeed, subject to
120e5c31af7Sopenharmony_ci    the window resize behavior, but the swapchain is no longer configured
121e5c31af7Sopenharmony_ci    optimally for the surface it targets.
122e5c31af7Sopenharmony_ci    Applications should query updated surface information and recreate their
123e5c31af7Sopenharmony_ci    swapchain at the next convenient opportunity.
124e5c31af7Sopenharmony_ci  * ename:VK_ERROR_OUT_OF_DATE_KHR - Failure.
125e5c31af7Sopenharmony_ci    The swapchain is no longer compatible with the surface it targets.
126e5c31af7Sopenharmony_ci    The application must query updated surface information and recreate the
127e5c31af7Sopenharmony_ci    swapchain before presentation will succeed.
128e5c31af7Sopenharmony_ci
129e5c31af7Sopenharmony_ciThese can be returned by both flink:vkAcquireNextImageKHR and
130e5c31af7Sopenharmony_ciflink:vkQueuePresentKHR.
131e5c31af7Sopenharmony_ci
132e5c31af7Sopenharmony_ci10) Does the flink:vkAcquireNextImageKHR command return a semaphore to the
133e5c31af7Sopenharmony_ciapplication via an output parameter, or accept a semaphore to signal from
134e5c31af7Sopenharmony_cithe application as an object handle parameter?
135e5c31af7Sopenharmony_ci
136e5c31af7Sopenharmony_ci*RESOLVED*: Accept a semaphore to signal as an object handle.
137e5c31af7Sopenharmony_ciThis avoids the need to specify whether the application must destroy the
138e5c31af7Sopenharmony_cisemaphore or whether it is owned by the swapchain, and if the latter, what
139e5c31af7Sopenharmony_ciits lifetime is and whether it can be reused for other operations once it is
140e5c31af7Sopenharmony_cireceived from flink:vkAcquireNextImageKHR.
141e5c31af7Sopenharmony_ci
142e5c31af7Sopenharmony_ci11) What types of swapchain queuing behavior should be exposed? Options
143e5c31af7Sopenharmony_ciinclude swap interval specification, mailbox/most recent vs. FIFO queue
144e5c31af7Sopenharmony_cimanagement, targeting specific vertical blank intervals or absolute times
145e5c31af7Sopenharmony_cifor a given present operation, and probably others.
146e5c31af7Sopenharmony_ciFor some of these, whether they are specified at swapchain creation time or
147e5c31af7Sopenharmony_cias per-present parameters needs to be decided as well.
148e5c31af7Sopenharmony_ci
149e5c31af7Sopenharmony_ci*RESOLVED*: The base swapchain extension will expose 3 possible behaviors
150e5c31af7Sopenharmony_ci(of which, FIFO will always be supported):
151e5c31af7Sopenharmony_ci
152e5c31af7Sopenharmony_ci  - Immediate present: Does not wait for vertical blanking period to update
153e5c31af7Sopenharmony_ci    the current image, likely resulting in visible tearing.
154e5c31af7Sopenharmony_ci    No internal queue is used.
155e5c31af7Sopenharmony_ci    Present requests are applied immediately.
156e5c31af7Sopenharmony_ci  - Mailbox queue: Waits for the next vertical blanking period to update the
157e5c31af7Sopenharmony_ci    current image.
158e5c31af7Sopenharmony_ci    No tearing should be observed.
159e5c31af7Sopenharmony_ci    An internal single-entry queue is used to hold pending presentation
160e5c31af7Sopenharmony_ci    requests.
161e5c31af7Sopenharmony_ci    If the queue is full when a new presentation request is received, the
162e5c31af7Sopenharmony_ci    new request replaces the existing entry, and any images associated with
163e5c31af7Sopenharmony_ci    the prior entry become available for reuse by the application.
164e5c31af7Sopenharmony_ci  - FIFO queue: Waits for the next vertical blanking period to update the
165e5c31af7Sopenharmony_ci    current image.
166e5c31af7Sopenharmony_ci    No tearing should be observed.
167e5c31af7Sopenharmony_ci    An internal queue containing [eq]#ptext:numSwapchainImages - 1# entries
168e5c31af7Sopenharmony_ci    is used to hold pending presentation requests.
169e5c31af7Sopenharmony_ci    New requests are appended to the end of the queue, and one request is
170e5c31af7Sopenharmony_ci    removed from the beginning of the queue and processed during each
171e5c31af7Sopenharmony_ci    vertical blanking period in which the queue is non-empty
172e5c31af7Sopenharmony_ci
173e5c31af7Sopenharmony_ciNot all surfaces will support all of these modes, so the modes supported
174e5c31af7Sopenharmony_ciwill be returned using a surface information query.
175e5c31af7Sopenharmony_ciAll surfaces must support the FIFO queue mode.
176e5c31af7Sopenharmony_ciApplications must choose one of these modes up front when creating a
177e5c31af7Sopenharmony_ciswapchain.
178e5c31af7Sopenharmony_ciSwitching modes can be accomplished by recreating the swapchain.
179e5c31af7Sopenharmony_ci
180e5c31af7Sopenharmony_ci12) Can ename:VK_PRESENT_MODE_MAILBOX_KHR provide non-blocking guarantees
181e5c31af7Sopenharmony_cifor flink:vkAcquireNextImageKHR? If so, what is the proper criteria?
182e5c31af7Sopenharmony_ci
183e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
184e5c31af7Sopenharmony_ciThe difficulty is not immediately obvious here.
185e5c31af7Sopenharmony_ciNaively, if at least 3 images are requested, mailbox mode should always have
186e5c31af7Sopenharmony_cian image available for the application if the application does not own any
187e5c31af7Sopenharmony_ciimages when the call to flink:vkAcquireNextImageKHR was made.
188e5c31af7Sopenharmony_ciHowever, some presentation engines may have more than one "`current`" image,
189e5c31af7Sopenharmony_ciand would still need to block in some cases.
190e5c31af7Sopenharmony_ciThe right requirement appears to be that if the application allocates the
191e5c31af7Sopenharmony_cisurface's minimum number of images + 1 then it is guaranteed non-blocking
192e5c31af7Sopenharmony_cibehavior when it does not currently own any images.
193e5c31af7Sopenharmony_ci
194e5c31af7Sopenharmony_ci13) Is there a way to create and initialize a new swapchain for a surface
195e5c31af7Sopenharmony_cithat has generated a ename:VK_SUBOPTIMAL_KHR return code while still using
196e5c31af7Sopenharmony_cithe old swapchain?
197e5c31af7Sopenharmony_ci
198e5c31af7Sopenharmony_ci*RESOLVED*: Not as part of this specification.
199e5c31af7Sopenharmony_ciThis could be useful to allow the application to create an "`optimal`"
200e5c31af7Sopenharmony_cireplacement swapchain and rebuild all its command buffers using it in a
201e5c31af7Sopenharmony_cibackground thread at a low priority while continuing to use the
202e5c31af7Sopenharmony_ci"`suboptimal`" swapchain in the main thread.
203e5c31af7Sopenharmony_ciIt could probably use the same "`atomic replace`" semantics proposed for
204e5c31af7Sopenharmony_cirecreating direct-to-device swapchains without incurring a mode switch.
205e5c31af7Sopenharmony_ciHowever, after discussion, it was determined some platforms probably could
206e5c31af7Sopenharmony_cinot support concurrent swapchains for the same surface though, so this will
207e5c31af7Sopenharmony_cibe left out of the base KHR extensions.
208e5c31af7Sopenharmony_ciA future extension could add this for platforms where it is supported.
209e5c31af7Sopenharmony_ci
210e5c31af7Sopenharmony_ci14) Should there be a special value for
211e5c31af7Sopenharmony_cislink:VkSurfaceCapabilitiesKHR::pname:maxImageCount to indicate there are no
212e5c31af7Sopenharmony_cipractical limits on the number of images in a swapchain?
213e5c31af7Sopenharmony_ci
214e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
215e5c31af7Sopenharmony_ciThere will often be cases where there is no practical limit to the number of
216e5c31af7Sopenharmony_ciimages in a swapchain other than the amount of available resources (i.e.,
217e5c31af7Sopenharmony_cimemory) in the system.
218e5c31af7Sopenharmony_ciTrying to derive a hard limit from things like memory size is prone to
219e5c31af7Sopenharmony_cifailure.
220e5c31af7Sopenharmony_ciIt is better in such cases to leave it to applications to figure such soft
221e5c31af7Sopenharmony_cilimits out via trial/failure iterations.
222e5c31af7Sopenharmony_ci
223e5c31af7Sopenharmony_ci15) Should there be a special value for
224e5c31af7Sopenharmony_cislink:VkSurfaceCapabilitiesKHR::pname:currentExtent to indicate the size of
225e5c31af7Sopenharmony_cithe platform surface is undefined:?
226e5c31af7Sopenharmony_ci
227e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
228e5c31af7Sopenharmony_ciOn some platforms (Wayland, for example), the surface size is defined by the
229e5c31af7Sopenharmony_ciimages presented to it rather than the other way around.
230e5c31af7Sopenharmony_ci
231e5c31af7Sopenharmony_ci16) Should there be a special value for
232e5c31af7Sopenharmony_cislink:VkSurfaceCapabilitiesKHR::pname:maxImageExtent to indicate there is no
233e5c31af7Sopenharmony_cipractical limit on the surface size?
234e5c31af7Sopenharmony_ci
235e5c31af7Sopenharmony_ci*RESOLVED*: No.
236e5c31af7Sopenharmony_ciIt seems unlikely such a system would exist.
237e5c31af7Sopenharmony_ci0 could be used to indicate the platform places no limits on the extents
238e5c31af7Sopenharmony_cibeyond those imposed by Vulkan for normal images, but this query could just
239e5c31af7Sopenharmony_cias easily return those same limits, so a special "`unlimited`" value does
240e5c31af7Sopenharmony_cinot seem useful for this field.
241e5c31af7Sopenharmony_ci
242e5c31af7Sopenharmony_ci17) How should surface rotation and mirroring be exposed to applications?
243e5c31af7Sopenharmony_ciHow do they specify rotation and mirroring transforms applied prior to
244e5c31af7Sopenharmony_cipresentation?
245e5c31af7Sopenharmony_ci
246e5c31af7Sopenharmony_ci*RESOLVED*: Applications can query both the supported and current transforms
247e5c31af7Sopenharmony_ciof a surface.
248e5c31af7Sopenharmony_ciBoth are specified relative to the device's "`natural`" display rotation and
249e5c31af7Sopenharmony_cidirection.
250e5c31af7Sopenharmony_ciThe supported transforms indicate which orientations the presentation engine
251e5c31af7Sopenharmony_ciaccepts images in.
252e5c31af7Sopenharmony_ciFor example, a presentation engine that does not support transforming
253e5c31af7Sopenharmony_cisurfaces as part of presentation, and which is presenting to a surface that
254e5c31af7Sopenharmony_ciis displayed with a 90-degree rotation, would return only one supported
255e5c31af7Sopenharmony_citransform bit: ename:VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR.
256e5c31af7Sopenharmony_ciApplications must transform their rendering by the transform they specify
257e5c31af7Sopenharmony_ciwhen creating the swapchain in pname:preTransform field.
258e5c31af7Sopenharmony_ci
259e5c31af7Sopenharmony_ci18) Can surfaces ever not support etext:VK_MIRROR_NONE? Can they support
260e5c31af7Sopenharmony_civertical and horizontal mirroring simultaneously? Relatedly, should
261e5c31af7Sopenharmony_cietext:VK_MIRROR_NONE[_BIT] be zero, or bit one, and should applications be
262e5c31af7Sopenharmony_ciallowed to specify multiple pre and current mirror transform bits, or
263e5c31af7Sopenharmony_ciexactly one?
264e5c31af7Sopenharmony_ci
265e5c31af7Sopenharmony_ci*RESOLVED*: Since some platforms may not support presenting with a transform
266e5c31af7Sopenharmony_ciother than the native window's current transform, and prerotation/mirroring
267e5c31af7Sopenharmony_ciare specified relative to the device's natural rotation and direction,
268e5c31af7Sopenharmony_cirather than relative to the surface's current rotation and direction, it is
269e5c31af7Sopenharmony_cinecessary to express lack of support for no mirroring.
270e5c31af7Sopenharmony_ciTo allow this, the etext:MIRROR_NONE enum must occupy a bit in the flags.
271e5c31af7Sopenharmony_ciSince etext:MIRROR_NONE must be a bit in the bitmask rather than a bitmask
272e5c31af7Sopenharmony_ciwith no values set, allowing more than one bit to be set in the bitmask
273e5c31af7Sopenharmony_ciwould make it possible to describe undefined: transforms such as
274e5c31af7Sopenharmony_cietext:VK_MIRROR_NONE_BIT | etext:VK_MIRROR_HORIZONTAL_BIT, or a transform
275e5c31af7Sopenharmony_cithat includes both "`no mirroring`" and "`horizontal mirroring`"
276e5c31af7Sopenharmony_cisimultaneously.
277e5c31af7Sopenharmony_ciTherefore, it is desirable to allow specifying all supported mirroring
278e5c31af7Sopenharmony_citransforms using only one bit.
279e5c31af7Sopenharmony_ciThe question then becomes, should there be a
280e5c31af7Sopenharmony_cietext:VK_MIRROR_HORIZONTAL_AND_VERTICAL_BIT to represent a simultaneous
281e5c31af7Sopenharmony_cihorizontal and vertical mirror transform? However, such a transform is
282e5c31af7Sopenharmony_ciequivalent to a 180 degree rotation, so presentation engines and
283e5c31af7Sopenharmony_ciapplications that wish to support or use such a transform can express it
284e5c31af7Sopenharmony_cithrough rotation instead.
285e5c31af7Sopenharmony_ciTherefore, 3 exclusive bits are sufficient to express all needed mirroring
286e5c31af7Sopenharmony_citransforms.
287e5c31af7Sopenharmony_ci
288e5c31af7Sopenharmony_ci19) Should support for sRGB be required?
289e5c31af7Sopenharmony_ci
290e5c31af7Sopenharmony_ci*RESOLVED*: In the advent of UHD and HDR display devices, proper color space
291e5c31af7Sopenharmony_ciinformation is vital to the display pipeline represented by the swapchain.
292e5c31af7Sopenharmony_ciThe app can discover the supported format/color-space pairs and select a
293e5c31af7Sopenharmony_cipair most suited to its rendering needs.
294e5c31af7Sopenharmony_ciCurrently only the sRGB color space is supported, future extensions may
295e5c31af7Sopenharmony_ciprovide support for more color spaces.
296e5c31af7Sopenharmony_ciSee issues 23 and 24.
297e5c31af7Sopenharmony_ci
298e5c31af7Sopenharmony_ci20) Is there a mechanism to modify or replace an existing swapchain with one
299e5c31af7Sopenharmony_citargeting the same surface?
300e5c31af7Sopenharmony_ci
301e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
302e5c31af7Sopenharmony_ciThis is described above in the text.
303e5c31af7Sopenharmony_ci
304e5c31af7Sopenharmony_ci21) Should there be a way to set prerotation and mirroring using native APIs
305e5c31af7Sopenharmony_ciwhen presenting using a Vulkan swapchain?
306e5c31af7Sopenharmony_ci
307e5c31af7Sopenharmony_ci*RESOLVED*: Yes.
308e5c31af7Sopenharmony_ciThe transforms that can be expressed in this extension are a subset of those
309e5c31af7Sopenharmony_cipossible on native platforms.
310e5c31af7Sopenharmony_ciIf a platform exposes a method to specify the transform of presented images
311e5c31af7Sopenharmony_cifor a given surface using native methods and exposes more transforms or
312e5c31af7Sopenharmony_ciother properties for surfaces than Vulkan supports, it might be impossible,
313e5c31af7Sopenharmony_cidifficult, or inconvenient to set some of those properties using Vulkan KHR
314e5c31af7Sopenharmony_ciextensions and some using the native interfaces.
315e5c31af7Sopenharmony_ciTo avoid overwriting properties set using native commands when presenting
316e5c31af7Sopenharmony_ciusing a Vulkan swapchain, the application can set the pretransform to
317e5c31af7Sopenharmony_ci"`inherit`", in which case the current native properties will be used, or if
318e5c31af7Sopenharmony_cinone are available, a platform-specific default will be used.
319e5c31af7Sopenharmony_ciPlatforms that do not specify a reasonable default or do not provide native
320e5c31af7Sopenharmony_cimechanisms to specify such transforms should not include the inherit bits in
321e5c31af7Sopenharmony_cithe pname:supportedTransforms bitmask they return in
322e5c31af7Sopenharmony_cislink:VkSurfaceCapabilitiesKHR.
323e5c31af7Sopenharmony_ci
324e5c31af7Sopenharmony_ci22) Should the content of presentable images be clipped by objects obscuring
325e5c31af7Sopenharmony_citheir target surface?
326e5c31af7Sopenharmony_ci
327e5c31af7Sopenharmony_ci*RESOLVED*: Applications can choose which behavior they prefer.
328e5c31af7Sopenharmony_ciAllowing the content to be clipped could enable more efficient presentation
329e5c31af7Sopenharmony_cimethods on some platforms, but some applications might rely on the content
330e5c31af7Sopenharmony_ciof presentable images to perform techniques such as partial updates or
331e5c31af7Sopenharmony_cimotion blurs.
332e5c31af7Sopenharmony_ci
333e5c31af7Sopenharmony_ci23) What is the purpose of specifying a elink:VkColorSpaceKHR along with
334e5c31af7Sopenharmony_cielink:VkFormat when creating a swapchain?
335e5c31af7Sopenharmony_ci
336e5c31af7Sopenharmony_ci*RESOLVED*: While Vulkan itself is color space agnostic (e.g. even the
337e5c31af7Sopenharmony_cimeaning of R, G, B and A can be freely defined by the rendering
338e5c31af7Sopenharmony_ciapplication), the swapchain eventually will have to present the images on a
339e5c31af7Sopenharmony_cidisplay device with specific color reproduction characteristics.
340e5c31af7Sopenharmony_ciIf any color space transformations are necessary before an image can be
341e5c31af7Sopenharmony_cidisplayed, the color space of the presented image must be known to the
342e5c31af7Sopenharmony_ciswapchain.
343e5c31af7Sopenharmony_ciA swapchain will only support a restricted set of color format and -space
344e5c31af7Sopenharmony_cipairs.
345e5c31af7Sopenharmony_ciThis set can be discovered via flink:vkGetPhysicalDeviceSurfaceFormatsKHR.
346e5c31af7Sopenharmony_ciAs it can be expected that most display devices support the sRGB color
347e5c31af7Sopenharmony_cispace, at least one format/color-space pair has to be exposed, where the
348e5c31af7Sopenharmony_cicolor space is ename:VK_COLOR_SPACE_SRGB_NONLINEAR_KHR.
349e5c31af7Sopenharmony_ci
350e5c31af7Sopenharmony_ci24) How are sRGB formats and the sRGB color space related?
351e5c31af7Sopenharmony_ci
352e5c31af7Sopenharmony_ci*RESOLVED*: While Vulkan exposes a number of SRGB texture formats, using
353e5c31af7Sopenharmony_cisuch formats does not guarantee working in a specific color space.
354e5c31af7Sopenharmony_ciIt merely means that the hardware can directly support applying the
355e5c31af7Sopenharmony_cinon-linear transfer functions defined by the sRGB standard color space when
356e5c31af7Sopenharmony_cireading from or writing to images of those formats.
357e5c31af7Sopenharmony_ciStill, it is unlikely that a swapchain will expose a etext:*_SRGB format
358e5c31af7Sopenharmony_cialong with any color space other than
359e5c31af7Sopenharmony_ciename:VK_COLOR_SPACE_SRGB_NONLINEAR_KHR.
360e5c31af7Sopenharmony_ci
361e5c31af7Sopenharmony_ciOn the other hand, non-etext:*_SRGB formats will be very likely exposed in
362e5c31af7Sopenharmony_cipair with a SRGB color space.
363e5c31af7Sopenharmony_ciThis means, the hardware will not apply any transfer function when reading
364e5c31af7Sopenharmony_cifrom or writing to such images, yet they will still be presented on a device
365e5c31af7Sopenharmony_ciwith sRGB display characteristics.
366e5c31af7Sopenharmony_ciIn this case the application is responsible for applying the transfer
367e5c31af7Sopenharmony_cifunction, for instance by using shader math.
368e5c31af7Sopenharmony_ci
369e5c31af7Sopenharmony_ci25) How are the lifetimes of surfaces and swapchains targeting them related?
370e5c31af7Sopenharmony_ci
371e5c31af7Sopenharmony_ci*RESOLVED*: A surface must outlive any swapchains targeting it.
372e5c31af7Sopenharmony_ciA slink:VkSurfaceKHR owns the binding of the native window to the Vulkan
373e5c31af7Sopenharmony_cidriver.
374e5c31af7Sopenharmony_ci
375e5c31af7Sopenharmony_ci26) How can the client control the way the alpha component of swapchain
376e5c31af7Sopenharmony_ciimages is treated by the presentation engine during compositing?
377e5c31af7Sopenharmony_ci
378e5c31af7Sopenharmony_ci*RESOLVED*: We should add new enum values to allow the client to negotiate
379e5c31af7Sopenharmony_ciwith the presentation engine on how to treat image alpha values during the
380e5c31af7Sopenharmony_cicompositing process.
381e5c31af7Sopenharmony_ciSince not all platforms can practically control this through the Vulkan
382e5c31af7Sopenharmony_cidriver, a value of ename:VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR is provided like
383e5c31af7Sopenharmony_cifor surface transforms.
384e5c31af7Sopenharmony_ci
385e5c31af7Sopenharmony_ci27) Is flink:vkCreateSwapchainKHR the right function to return
386e5c31af7Sopenharmony_ciename:VK_ERROR_NATIVE_WINDOW_IN_USE_KHR, or should the various
387e5c31af7Sopenharmony_ciplatform-specific slink:VkSurfaceKHR factory functions catch this error
388e5c31af7Sopenharmony_ciearlier?
389e5c31af7Sopenharmony_ci
390e5c31af7Sopenharmony_ci*RESOLVED*: For most platforms, the slink:VkSurfaceKHR structure is a simple
391e5c31af7Sopenharmony_cicontainer holding the data that identifies a native window or other object
392e5c31af7Sopenharmony_cirepresenting a surface on a particular platform.
393e5c31af7Sopenharmony_ciFor the surface factory functions to return this error, they would likely
394e5c31af7Sopenharmony_cineed to register a reference on the native objects with the native display
395e5c31af7Sopenharmony_ciserver somehow, and ensure no other such references exist.
396e5c31af7Sopenharmony_ciSurfaces were not intended to be that heavyweight.
397e5c31af7Sopenharmony_ci
398e5c31af7Sopenharmony_ciSwapchains are intended to be the objects that directly manipulate native
399e5c31af7Sopenharmony_ciwindows and communicate with the native presentation mechanisms.
400e5c31af7Sopenharmony_ciSwapchains will already need to communicate with the native display server
401e5c31af7Sopenharmony_cito negotiate allocation and/or presentation of presentable images for a
402e5c31af7Sopenharmony_cinative surface.
403e5c31af7Sopenharmony_ciTherefore, it makes more sense for swapchain creation to be the point at
404e5c31af7Sopenharmony_ciwhich native object exclusivity is enforced.
405e5c31af7Sopenharmony_ciPlatforms may choose to enforce further restrictions on the number of
406e5c31af7Sopenharmony_cislink:VkSurfaceKHR objects that may be created for the same native window if
407e5c31af7Sopenharmony_cisuch a requirement makes sense on a particular platform, but a global
408e5c31af7Sopenharmony_cirequirement is only sensible at the swapchain level.
409e5c31af7Sopenharmony_ci
410e5c31af7Sopenharmony_ci=== Examples
411e5c31af7Sopenharmony_ci
412e5c31af7Sopenharmony_ci[NOTE]
413e5c31af7Sopenharmony_ci.Note
414e5c31af7Sopenharmony_ci====
415e5c31af7Sopenharmony_ciThe example code for the `apiext:VK_KHR_surface` and `VK_KHR_swapchain`
416e5c31af7Sopenharmony_ciextensions was removed from the appendix after revision 1.0.29.
417e5c31af7Sopenharmony_ciThis WSI example code was ported to the cube demo that is shipped with the
418e5c31af7Sopenharmony_ciofficial Khronos SDK, and is being kept up-to-date in that location (see:
419e5c31af7Sopenharmony_cihttps://github.com/KhronosGroup/Vulkan-Tools/blob/master/cube/cube.c).
420e5c31af7Sopenharmony_ci====
421e5c31af7Sopenharmony_ci
422e5c31af7Sopenharmony_ci=== Version History
423e5c31af7Sopenharmony_ci
424e5c31af7Sopenharmony_ci  * Revision 1, 2015-05-20 (James Jones)
425e5c31af7Sopenharmony_ci    - Initial draft, based on LunarG KHR spec, other KHR specs, patches
426e5c31af7Sopenharmony_ci      attached to bugs.
427e5c31af7Sopenharmony_ci
428e5c31af7Sopenharmony_ci  * Revision 2, 2015-05-22 (Ian Elliott)
429e5c31af7Sopenharmony_ci    - Made many agreed-upon changes from 2015-05-21 KHR TSG meeting.
430e5c31af7Sopenharmony_ci      This includes using only a queue for presentation, and having an
431e5c31af7Sopenharmony_ci      explicit function to acquire the next image.
432e5c31af7Sopenharmony_ci    - Fixed typos and other minor mistakes.
433e5c31af7Sopenharmony_ci
434e5c31af7Sopenharmony_ci  * Revision 3, 2015-05-26 (Ian Elliott)
435e5c31af7Sopenharmony_ci    - Improved the Description section.
436e5c31af7Sopenharmony_ci    - Added or resolved issues that were found in improving the Description.
437e5c31af7Sopenharmony_ci      For example, pSurfaceDescription is used consistently, instead of
438e5c31af7Sopenharmony_ci      sometimes using pSurface.
439e5c31af7Sopenharmony_ci
440e5c31af7Sopenharmony_ci  * Revision 4, 2015-05-27 (James Jones)
441e5c31af7Sopenharmony_ci    - Fixed some grammatical errors and typos
442e5c31af7Sopenharmony_ci    - Filled in the description of imageUseFlags when creating a swapchain.
443e5c31af7Sopenharmony_ci    - Added a description of swapInterval.
444e5c31af7Sopenharmony_ci    - Replaced the paragraph describing the order of operations on a queue
445e5c31af7Sopenharmony_ci      for image ownership and presentation.
446e5c31af7Sopenharmony_ci
447e5c31af7Sopenharmony_ci  * Revision 5, 2015-05-27 (James Jones)
448e5c31af7Sopenharmony_ci    - Imported relevant issues from the (abandoned)
449e5c31af7Sopenharmony_ci      vk_wsi_persistent_swapchain_images extension.
450e5c31af7Sopenharmony_ci    - Added issues 6 and 7, regarding behavior of the acquire next image and
451e5c31af7Sopenharmony_ci      present commands with respect to queues.
452e5c31af7Sopenharmony_ci    - Updated spec language and examples to align with proposed resolutions
453e5c31af7Sopenharmony_ci      to issues 6 and 7.
454e5c31af7Sopenharmony_ci
455e5c31af7Sopenharmony_ci  * Revision 6, 2015-05-27 (James Jones)
456e5c31af7Sopenharmony_ci    - Added issue 8, regarding atomic presentation of multiple swapchains
457e5c31af7Sopenharmony_ci    - Updated spec language and examples to align with proposed resolution
458e5c31af7Sopenharmony_ci      to issue 8.
459e5c31af7Sopenharmony_ci
460e5c31af7Sopenharmony_ci  * Revision 7, 2015-05-27 (James Jones)
461e5c31af7Sopenharmony_ci    - Fixed compilation errors in example code, and made related spec fixes.
462e5c31af7Sopenharmony_ci
463e5c31af7Sopenharmony_ci  * Revision 8, 2015-05-27 (James Jones)
464e5c31af7Sopenharmony_ci    - Added issue 9, and the related VK_SUBOPTIMAL_KHR result code.
465e5c31af7Sopenharmony_ci    - Renamed VK_OUT_OF_DATE_KHR to VK_ERROR_OUT_OF_DATE_KHR.
466e5c31af7Sopenharmony_ci
467e5c31af7Sopenharmony_ci  * Revision 9, 2015-05-27 (James Jones)
468e5c31af7Sopenharmony_ci    - Added inline proposed resolutions (marked with [JRJ]) to some XXX
469e5c31af7Sopenharmony_ci      questions/issues.
470e5c31af7Sopenharmony_ci      These should be moved to the issues section in a subsequent update if
471e5c31af7Sopenharmony_ci      the proposals are adopted.
472e5c31af7Sopenharmony_ci
473e5c31af7Sopenharmony_ci  * Revision 10, 2015-05-28 (James Jones)
474e5c31af7Sopenharmony_ci    - Converted vkAcquireNextImageKHR back to a non-queue operation that
475e5c31af7Sopenharmony_ci      uses a VkSemaphore object for explicit synchronization.
476e5c31af7Sopenharmony_ci    - Added issue 10 to determine whether vkAcquireNextImageKHR generates or
477e5c31af7Sopenharmony_ci      returns semaphores, or whether it operates on a semaphore provided by
478e5c31af7Sopenharmony_ci      the application.
479e5c31af7Sopenharmony_ci
480e5c31af7Sopenharmony_ci  * Revision 11, 2015-05-28 (James Jones)
481e5c31af7Sopenharmony_ci    - Marked issues 6, 7, and 8 resolved.
482e5c31af7Sopenharmony_ci    - Renamed VkSurfaceCapabilityPropertiesKHR to VkSurfacePropertiesKHR to
483e5c31af7Sopenharmony_ci      better convey the mutable nature of the information it contains.
484e5c31af7Sopenharmony_ci
485e5c31af7Sopenharmony_ci  * Revision 12, 2015-05-28 (James Jones)
486e5c31af7Sopenharmony_ci    - Added issue 11 with a proposed resolution, and the related issue 12.
487e5c31af7Sopenharmony_ci    - Updated various sections of the spec to match the proposed resolution
488e5c31af7Sopenharmony_ci      to issue 11.
489e5c31af7Sopenharmony_ci
490e5c31af7Sopenharmony_ci  * Revision 13, 2015-06-01 (James Jones)
491e5c31af7Sopenharmony_ci    - Moved some structures to VK_EXT_KHR_swap_chain to resolve the
492e5c31af7Sopenharmony_ci      specification's issues 1 and 2.
493e5c31af7Sopenharmony_ci
494e5c31af7Sopenharmony_ci  * Revision 14, 2015-06-01 (James Jones)
495e5c31af7Sopenharmony_ci    - Added code for example 4 demonstrating how an application might make
496e5c31af7Sopenharmony_ci      use of the two different present and acquire next image KHR result
497e5c31af7Sopenharmony_ci      codes.
498e5c31af7Sopenharmony_ci    - Added issue 13.
499e5c31af7Sopenharmony_ci
500e5c31af7Sopenharmony_ci  * Revision 15, 2015-06-01 (James Jones)
501e5c31af7Sopenharmony_ci    - Added issues 14 - 16 and related spec language.
502e5c31af7Sopenharmony_ci    - Fixed some spelling errors.
503e5c31af7Sopenharmony_ci    - Added language describing the meaningful return values for
504e5c31af7Sopenharmony_ci      vkAcquireNextImageKHR and vkQueuePresentKHR.
505e5c31af7Sopenharmony_ci
506e5c31af7Sopenharmony_ci  * Revision 16, 2015-06-02 (James Jones)
507e5c31af7Sopenharmony_ci    - Added issues 17 and 18, as well as related spec language.
508e5c31af7Sopenharmony_ci    - Removed some erroneous text added by mistake in the last update.
509e5c31af7Sopenharmony_ci
510e5c31af7Sopenharmony_ci  * Revision 17, 2015-06-15 (Ian Elliott)
511e5c31af7Sopenharmony_ci    - Changed special value from "-1" to "0" so that the data types can be
512e5c31af7Sopenharmony_ci      unsigned.
513e5c31af7Sopenharmony_ci
514e5c31af7Sopenharmony_ci  * Revision 18, 2015-06-15 (Ian Elliott)
515e5c31af7Sopenharmony_ci    - Clarified the values of VkSurfacePropertiesKHR::minImageCount and the
516e5c31af7Sopenharmony_ci      timeout parameter of the vkAcquireNextImageKHR function.
517e5c31af7Sopenharmony_ci
518e5c31af7Sopenharmony_ci  * Revision 19, 2015-06-17 (James Jones)
519e5c31af7Sopenharmony_ci    - Misc.
520e5c31af7Sopenharmony_ci      cleanup.
521e5c31af7Sopenharmony_ci      Removed resolved inline issues and fixed typos.
522e5c31af7Sopenharmony_ci    - Fixed clarification of VkSurfacePropertiesKHR::minImageCount made in
523e5c31af7Sopenharmony_ci      version 18.
524e5c31af7Sopenharmony_ci    - Added a brief "Image Ownership" definition to the list of terms used
525e5c31af7Sopenharmony_ci      in the spec.
526e5c31af7Sopenharmony_ci
527e5c31af7Sopenharmony_ci  * Revision 20, 2015-06-17 (James Jones)
528e5c31af7Sopenharmony_ci    - Updated enum-extending values using new convention.
529e5c31af7Sopenharmony_ci
530e5c31af7Sopenharmony_ci  * Revision 21, 2015-06-17 (James Jones)
531e5c31af7Sopenharmony_ci    - Added language describing how to use
532e5c31af7Sopenharmony_ci      VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR.
533e5c31af7Sopenharmony_ci    - Cleaned up an XXX comment regarding the description of which queues
534e5c31af7Sopenharmony_ci      vkQueuePresentKHR can be used on.
535e5c31af7Sopenharmony_ci
536e5c31af7Sopenharmony_ci  * Revision 22, 2015-06-17 (James Jones)
537e5c31af7Sopenharmony_ci    - Rebased on Vulkan API version 126.
538e5c31af7Sopenharmony_ci
539e5c31af7Sopenharmony_ci  * Revision 23, 2015-06-18 (James Jones)
540e5c31af7Sopenharmony_ci    - Updated language for issue 12 to read as a proposed resolution.
541e5c31af7Sopenharmony_ci    - Marked issues 11, 12, 13, 16, and 17 resolved.
542e5c31af7Sopenharmony_ci    - Temporarily added links to the relevant bugs under the remaining
543e5c31af7Sopenharmony_ci      unresolved issues.
544e5c31af7Sopenharmony_ci    - Added issues 19 and 20 as well as proposed resolutions.
545e5c31af7Sopenharmony_ci
546e5c31af7Sopenharmony_ci  * Revision 24, 2015-06-19 (Ian Elliott)
547e5c31af7Sopenharmony_ci    - Changed special value for VkSurfacePropertiesKHR::currentExtent back
548e5c31af7Sopenharmony_ci      to "`-1`" from "`0`".
549e5c31af7Sopenharmony_ci      This value will never need to be unsigned, and "`0`" is actually a
550e5c31af7Sopenharmony_ci      legal value.
551e5c31af7Sopenharmony_ci
552e5c31af7Sopenharmony_ci  * Revision 25, 2015-06-23 (Ian Elliott)
553e5c31af7Sopenharmony_ci    - Examples now show use of function pointers for extension functions.
554e5c31af7Sopenharmony_ci    - Eliminated extraneous whitespace.
555e5c31af7Sopenharmony_ci
556e5c31af7Sopenharmony_ci  * Revision 26, 2015-06-25 (Ian Elliott)
557e5c31af7Sopenharmony_ci    - Resolved Issues 9 & 10 per KHR TSG meeting.
558e5c31af7Sopenharmony_ci
559e5c31af7Sopenharmony_ci  * Revision 27, 2015-06-25 (James Jones)
560e5c31af7Sopenharmony_ci    - Added oldSwapchain member to VkSwapchainCreateInfoKHR.
561e5c31af7Sopenharmony_ci
562e5c31af7Sopenharmony_ci  * Revision 28, 2015-06-25 (James Jones)
563e5c31af7Sopenharmony_ci    - Added the "`inherit`" bits to the rotation and mirroring flags and the
564e5c31af7Sopenharmony_ci      associated issue 21.
565e5c31af7Sopenharmony_ci
566e5c31af7Sopenharmony_ci  * Revision 29, 2015-06-25 (James Jones)
567e5c31af7Sopenharmony_ci    - Added the "`clipped`" flag to VkSwapchainCreateInfoKHR, and the
568e5c31af7Sopenharmony_ci      associated issue 22.
569e5c31af7Sopenharmony_ci    - Specified that presenting an image does not modify it.
570e5c31af7Sopenharmony_ci
571e5c31af7Sopenharmony_ci  * Revision 30, 2015-06-25 (James Jones)
572e5c31af7Sopenharmony_ci    - Added language to the spec that clarifies the behavior of
573e5c31af7Sopenharmony_ci      vkCreateSwapchainKHR() when the oldSwapchain field of
574e5c31af7Sopenharmony_ci      VkSwapchainCreateInfoKHR is not NULL.
575e5c31af7Sopenharmony_ci
576e5c31af7Sopenharmony_ci  * Revision 31, 2015-06-26 (Ian Elliott)
577e5c31af7Sopenharmony_ci    - Example of new VkSwapchainCreateInfoKHR members, "`oldSwapchain`" and
578e5c31af7Sopenharmony_ci      "`clipped`".
579e5c31af7Sopenharmony_ci    - Example of using VkSurfacePropertiesKHR::{min|max}ImageCount to set
580e5c31af7Sopenharmony_ci      VkSwapchainCreateInfoKHR::minImageCount.
581e5c31af7Sopenharmony_ci    - Rename vkGetSurfaceInfoKHR()'s 4th parameter to "`pDataSize`", for
582e5c31af7Sopenharmony_ci      consistency with other functions.
583e5c31af7Sopenharmony_ci    - Add macro with C-string name of extension (just to header file).
584e5c31af7Sopenharmony_ci
585e5c31af7Sopenharmony_ci  * Revision 32, 2015-06-26 (James Jones)
586e5c31af7Sopenharmony_ci    - Minor adjustments to the language describing the behavior of
587e5c31af7Sopenharmony_ci      "`oldSwapchain`"
588e5c31af7Sopenharmony_ci    - Fixed the version date on my previous two updates.
589e5c31af7Sopenharmony_ci
590e5c31af7Sopenharmony_ci  * Revision 33, 2015-06-26 (Jesse Hall)
591e5c31af7Sopenharmony_ci    - Add usage flags to VkSwapchainCreateInfoKHR
592e5c31af7Sopenharmony_ci
593e5c31af7Sopenharmony_ci  * Revision 34, 2015-06-26 (Ian Elliott)
594e5c31af7Sopenharmony_ci    - Rename vkQueuePresentKHR()'s 2nd parameter to "`pPresentInfo`", for
595e5c31af7Sopenharmony_ci      consistency with other functions.
596e5c31af7Sopenharmony_ci
597e5c31af7Sopenharmony_ci  * Revision 35, 2015-06-26 (Jason Ekstrand)
598e5c31af7Sopenharmony_ci    - Merged the VkRotationFlagBitsKHR and VkMirrorFlagBitsKHR enums into a
599e5c31af7Sopenharmony_ci      single VkSurfaceTransformFlagBitsKHR enum.
600e5c31af7Sopenharmony_ci
601e5c31af7Sopenharmony_ci  * Revision 36, 2015-06-26 (Jason Ekstrand)
602e5c31af7Sopenharmony_ci    - Added a VkSurfaceTransformKHR enum that is not a bitmask.
603e5c31af7Sopenharmony_ci      Each value in VkSurfaceTransformKHR corresponds directly to one of the
604e5c31af7Sopenharmony_ci      bits in VkSurfaceTransformFlagBitsKHR so transforming from one to the
605e5c31af7Sopenharmony_ci      other is easy.
606e5c31af7Sopenharmony_ci      Having a separate enum means that currentTransform and preTransform
607e5c31af7Sopenharmony_ci      are now unambiguous by definition.
608e5c31af7Sopenharmony_ci
609e5c31af7Sopenharmony_ci  * Revision 37, 2015-06-29 (Ian Elliott)
610e5c31af7Sopenharmony_ci    - Corrected one of the signatures of vkAcquireNextImageKHR, which had
611e5c31af7Sopenharmony_ci      the last two parameters switched from what it is elsewhere in the
612e5c31af7Sopenharmony_ci      specification and header files.
613e5c31af7Sopenharmony_ci
614e5c31af7Sopenharmony_ci  * Revision 38, 2015-06-30 (Ian Elliott)
615e5c31af7Sopenharmony_ci    - Corrected a typo in description of the vkGetSwapchainInfoKHR()
616e5c31af7Sopenharmony_ci      function.
617e5c31af7Sopenharmony_ci    - Corrected a typo in header file comment for VkPresentInfoKHR::sType.
618e5c31af7Sopenharmony_ci
619e5c31af7Sopenharmony_ci  * Revision 39, 2015-07-07 (Daniel Rakos)
620e5c31af7Sopenharmony_ci    - Added error section describing when each error is expected to be
621e5c31af7Sopenharmony_ci      reported.
622e5c31af7Sopenharmony_ci    - Replaced bool32_t with VkBool32.
623e5c31af7Sopenharmony_ci
624e5c31af7Sopenharmony_ci  * Revision 40, 2015-07-10 (Ian Elliott)
625e5c31af7Sopenharmony_ci    - Updated to work with version 138 of the `vulkan.h` header.
626e5c31af7Sopenharmony_ci      This includes declaring the VkSwapchainKHR type using the new
627e5c31af7Sopenharmony_ci      VK_DEFINE_NONDISP_HANDLE macro, and no longer extending VkObjectType
628e5c31af7Sopenharmony_ci      (which was eliminated).
629e5c31af7Sopenharmony_ci
630e5c31af7Sopenharmony_ci  * Revision 41 2015-07-09 (Mathias Heyer)
631e5c31af7Sopenharmony_ci    - Added color space language.
632e5c31af7Sopenharmony_ci
633e5c31af7Sopenharmony_ci  * Revision 42, 2015-07-10 (Daniel Rakos)
634e5c31af7Sopenharmony_ci    - Updated query mechanism to reflect the convention changes done in the
635e5c31af7Sopenharmony_ci      core spec.
636e5c31af7Sopenharmony_ci    - Removed "`queue`" from the name of
637e5c31af7Sopenharmony_ci      VK_STRUCTURE_TYPE_QUEUE_PRESENT_INFO_KHR to be consistent with the
638e5c31af7Sopenharmony_ci      established naming convention.
639e5c31af7Sopenharmony_ci    - Removed reference to the no longer existing VkObjectType enum.
640e5c31af7Sopenharmony_ci
641e5c31af7Sopenharmony_ci  * Revision 43, 2015-07-17 (Daniel Rakos)
642e5c31af7Sopenharmony_ci    - Added support for concurrent sharing of swapchain images across queue
643e5c31af7Sopenharmony_ci      families.
644e5c31af7Sopenharmony_ci    - Updated sample code based on recent changes
645e5c31af7Sopenharmony_ci
646e5c31af7Sopenharmony_ci  * Revision 44, 2015-07-27 (Ian Elliott)
647e5c31af7Sopenharmony_ci    - Noted that support for VK_PRESENT_MODE_FIFO_KHR is required.
648e5c31af7Sopenharmony_ci      That is ICDs may optionally support IMMEDIATE and MAILBOX, but must
649e5c31af7Sopenharmony_ci      support FIFO.
650e5c31af7Sopenharmony_ci
651e5c31af7Sopenharmony_ci  * Revision 45, 2015-08-07 (Ian Elliott)
652e5c31af7Sopenharmony_ci    - Corrected a typo in spec file (type and variable name had wrong case
653e5c31af7Sopenharmony_ci      for the imageColorSpace member of the VkSwapchainCreateInfoKHR
654e5c31af7Sopenharmony_ci      struct).
655e5c31af7Sopenharmony_ci    - Corrected a typo in header file (last parameter in
656e5c31af7Sopenharmony_ci      PFN_vkGetSurfacePropertiesKHR was missing "`KHR`" at the end of type:
657e5c31af7Sopenharmony_ci      VkSurfacePropertiesKHR).
658e5c31af7Sopenharmony_ci
659e5c31af7Sopenharmony_ci  * Revision 46, 2015-08-20 (Ian Elliott)
660e5c31af7Sopenharmony_ci    - Renamed this extension and all of its enumerations, types, functions,
661e5c31af7Sopenharmony_ci      etc.
662e5c31af7Sopenharmony_ci      This makes it compliant with the proposed standard for Vulkan
663e5c31af7Sopenharmony_ci      extensions.
664e5c31af7Sopenharmony_ci    - Switched from "`revision`" to "`version`", including use of the
665e5c31af7Sopenharmony_ci      VK_MAKE_VERSION macro in the header file.
666e5c31af7Sopenharmony_ci    - Made improvements to several descriptions.
667e5c31af7Sopenharmony_ci    - Changed the status of several issues from PROPOSED to RESOLVED,
668e5c31af7Sopenharmony_ci      leaving no unresolved issues.
669e5c31af7Sopenharmony_ci    - Resolved several TODOs, did miscellaneous cleanup, etc.
670e5c31af7Sopenharmony_ci
671e5c31af7Sopenharmony_ci  * Revision 47, 2015-08-20 (Ian Elliott--porting a 2015-07-29 change from
672e5c31af7Sopenharmony_ci    James Jones)
673e5c31af7Sopenharmony_ci    - Moved the surface transform enums to VK_WSI_swapchain so they could be
674e5c31af7Sopenharmony_ci      reused by VK_WSI_display.
675e5c31af7Sopenharmony_ci
676e5c31af7Sopenharmony_ci  * Revision 48, 2015-09-01 (James Jones)
677e5c31af7Sopenharmony_ci    - Various minor cleanups.
678e5c31af7Sopenharmony_ci
679e5c31af7Sopenharmony_ci  * Revision 49, 2015-09-01 (James Jones)
680e5c31af7Sopenharmony_ci    - Restore single-field revision number.
681e5c31af7Sopenharmony_ci
682e5c31af7Sopenharmony_ci  * Revision 50, 2015-09-01 (James Jones)
683e5c31af7Sopenharmony_ci    - Update Example #4 to include code that illustrates how to use the
684e5c31af7Sopenharmony_ci      oldSwapchain field.
685e5c31af7Sopenharmony_ci
686e5c31af7Sopenharmony_ci  * Revision 51, 2015-09-01 (James Jones)
687e5c31af7Sopenharmony_ci    - Fix example code compilation errors.
688e5c31af7Sopenharmony_ci
689e5c31af7Sopenharmony_ci  * Revision 52, 2015-09-08 (Matthaeus G. Chajdas)
690e5c31af7Sopenharmony_ci    - Corrected a typo.
691e5c31af7Sopenharmony_ci
692e5c31af7Sopenharmony_ci  * Revision 53, 2015-09-10 (Alon Or-bach)
693e5c31af7Sopenharmony_ci    - Removed underscore from SWAP_CHAIN left in
694e5c31af7Sopenharmony_ci      VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR.
695e5c31af7Sopenharmony_ci
696e5c31af7Sopenharmony_ci  * Revision 54, 2015-09-11 (Jesse Hall)
697e5c31af7Sopenharmony_ci    - Described the execution and memory coherence requirements for image
698e5c31af7Sopenharmony_ci      transitions to and from VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR.
699e5c31af7Sopenharmony_ci
700e5c31af7Sopenharmony_ci  * Revision 55, 2015-09-11 (Ray Smith)
701e5c31af7Sopenharmony_ci    - Added errors for destroying and binding memory to presentable images
702e5c31af7Sopenharmony_ci
703e5c31af7Sopenharmony_ci  * Revision 56, 2015-09-18 (James Jones)
704e5c31af7Sopenharmony_ci    - Added fence argument to vkAcquireNextImageKHR
705e5c31af7Sopenharmony_ci    - Added example of how to meter a host thread based on presentation
706e5c31af7Sopenharmony_ci      rate.
707e5c31af7Sopenharmony_ci
708e5c31af7Sopenharmony_ci  * Revision 57, 2015-09-26 (Jesse Hall)
709e5c31af7Sopenharmony_ci    - Replace VkSurfaceDescriptionKHR with VkSurfaceKHR.
710e5c31af7Sopenharmony_ci    - Added issue 25 with agreed resolution.
711e5c31af7Sopenharmony_ci
712e5c31af7Sopenharmony_ci  * Revision 58, 2015-09-28 (Jesse Hall)
713e5c31af7Sopenharmony_ci    - Renamed from VK_EXT_KHR_device_swapchain to VK_EXT_KHR_swapchain.
714e5c31af7Sopenharmony_ci
715e5c31af7Sopenharmony_ci  * Revision 59, 2015-09-29 (Ian Elliott)
716e5c31af7Sopenharmony_ci    - Changed vkDestroySwapchainKHR() to return void.
717e5c31af7Sopenharmony_ci
718e5c31af7Sopenharmony_ci  * Revision 60, 2015-10-01 (Jeff Vigil)
719e5c31af7Sopenharmony_ci    - Added error result VK_ERROR_SURFACE_LOST_KHR.
720e5c31af7Sopenharmony_ci
721e5c31af7Sopenharmony_ci  * Revision 61, 2015-10-05 (Jason Ekstrand)
722e5c31af7Sopenharmony_ci    - Added the VkCompositeAlpha enum and corresponding structure fields.
723e5c31af7Sopenharmony_ci
724e5c31af7Sopenharmony_ci  * Revision 62, 2015-10-12 (Daniel Rakos)
725e5c31af7Sopenharmony_ci    - Added VK_PRESENT_MODE_FIFO_RELAXED_KHR.
726e5c31af7Sopenharmony_ci
727e5c31af7Sopenharmony_ci  * Revision 63, 2015-10-15 (Daniel Rakos)
728e5c31af7Sopenharmony_ci    - Moved surface capability queries to VK_EXT_KHR_surface.
729e5c31af7Sopenharmony_ci
730e5c31af7Sopenharmony_ci  * Revision 64, 2015-10-26 (Ian Elliott)
731e5c31af7Sopenharmony_ci    - Renamed from VK_EXT_KHR_swapchain to VK_KHR_swapchain.
732e5c31af7Sopenharmony_ci
733e5c31af7Sopenharmony_ci  * Revision 65, 2015-10-28 (Ian Elliott)
734e5c31af7Sopenharmony_ci    - Added optional pResult member to VkPresentInfoKHR, so that
735e5c31af7Sopenharmony_ci      per-swapchain results can be obtained from vkQueuePresentKHR().
736e5c31af7Sopenharmony_ci
737e5c31af7Sopenharmony_ci  * Revision 66, 2015-11-03 (Daniel Rakos)
738e5c31af7Sopenharmony_ci    - Added allocation callbacks to create and destroy functions.
739e5c31af7Sopenharmony_ci    - Updated resource transition language.
740e5c31af7Sopenharmony_ci    - Updated sample code.
741e5c31af7Sopenharmony_ci
742e5c31af7Sopenharmony_ci  * Revision 67, 2015-11-10 (Jesse Hall)
743e5c31af7Sopenharmony_ci    - Add reserved flags bitmask to VkSwapchainCreateInfoKHR.
744e5c31af7Sopenharmony_ci    - Modify naming and member ordering to match API style conventions, and
745e5c31af7Sopenharmony_ci      so the VkSwapchainCreateInfoKHR image property members mirror
746e5c31af7Sopenharmony_ci      corresponding VkImageCreateInfo members but with an 'image' prefix.
747e5c31af7Sopenharmony_ci    - Make VkPresentInfoKHR::pResults non-const; it is an output array
748e5c31af7Sopenharmony_ci      parameter.
749e5c31af7Sopenharmony_ci    - Make pPresentInfo parameter to vkQueuePresentKHR const.
750e5c31af7Sopenharmony_ci
751e5c31af7Sopenharmony_ci  * Revision 68, 2016-04-05 (Ian Elliott)
752e5c31af7Sopenharmony_ci    - Moved the "`validity`" include for vkAcquireNextImage to be in its
753e5c31af7Sopenharmony_ci      proper place, after the prototype and list of parameters.
754e5c31af7Sopenharmony_ci    - Clarified language about presentable images, including how they are
755e5c31af7Sopenharmony_ci      acquired, when applications can and cannot use them, etc.
756e5c31af7Sopenharmony_ci      As part of this, removed language about "`ownership`" of presentable
757e5c31af7Sopenharmony_ci      images, and replaced it with more-consistent language about
758e5c31af7Sopenharmony_ci      presentable images being "`acquired`" by the application.
759e5c31af7Sopenharmony_ci
760e5c31af7Sopenharmony_ci  * 2016-08-23 (Ian Elliott)
761e5c31af7Sopenharmony_ci    - Update the example code, to use the final API command names, to not
762e5c31af7Sopenharmony_ci      have so many characters per line, and to split out a new example to
763e5c31af7Sopenharmony_ci      show how to obtain function pointers.
764e5c31af7Sopenharmony_ci      This code is more similar to the LunarG "`cube`" demo program.
765e5c31af7Sopenharmony_ci
766e5c31af7Sopenharmony_ci  * 2016-08-25 (Ian Elliott)
767e5c31af7Sopenharmony_ci    - A note was added at the beginning of the example code, stating that it
768e5c31af7Sopenharmony_ci      will be removed from future versions of the appendix.
769e5c31af7Sopenharmony_ci
770e5c31af7Sopenharmony_ci  * Revision 69, 2017-09-07 (Tobias Hector)
771e5c31af7Sopenharmony_ci    - Added interactions with Vulkan 1.1
772e5c31af7Sopenharmony_ci
773e5c31af7Sopenharmony_ci  * Revision 70, 2017-10-06 (Ian Elliott)
774e5c31af7Sopenharmony_ci    - Corrected interactions with Vulkan 1.1
775