• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2014-2022 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_KHR_display_swapchain.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10    2017-03-13
11*IP Status*::
12    No known IP claims.
13*Contributors*::
14  - James Jones, NVIDIA
15  - Jeff Vigil, Qualcomm
16  - Jesse Hall, Google
17
18=== Description
19
20This extension provides an API to create a swapchain directly on a device's
21display without any underlying window system.
22
23include::{generated}/interfaces/VK_KHR_display_swapchain.adoc[]
24
25=== Issues
26
271) Should swapchains sharing images each hold a reference to the images, or
28should it be up to the application to destroy the swapchains and images in
29an order that avoids the need for reference counting?
30
31*RESOLVED*: Take a reference.
32The lifetime of presentable images is already complex enough.
33
342) Should the pname:srcRect and pname:dstRect parameters be specified as
35part of the presentation command, or at swapchain creation time?
36
37*RESOLVED*: As part of the presentation command.
38This allows moving and scaling the image on the screen without the need to
39respecify the mode or create a new swapchain and presentable images.
40
413) Should pname:srcRect and pname:dstRect be specified as rects, or separate
42offset/extent values?
43
44*RESOLVED*: As rects.
45Specifying them separately might make it easier for hardware to expose
46support for one but not the other, but in such cases applications must just
47take care to obey the reported capabilities and not use non-zero offsets or
48extents that require scaling, as appropriate.
49
504) How can applications create multiple swapchains that use the same images?
51
52*RESOLVED*: By calling flink:vkCreateSharedSwapchainsKHR.
53
54An earlier resolution used flink:vkCreateSwapchainKHR, chaining multiple
55slink:VkSwapchainCreateInfoKHR structures through pname:pNext.
56In order to allow each swapchain to also allow other extension structs, a
57level of indirection was used: slink:VkSwapchainCreateInfoKHR::pname:pNext
58pointed to a different structure, which had both pname:sType and pname:pNext
59members for additional extensions, and also had a pointer to the next
60slink:VkSwapchainCreateInfoKHR structure.
61The number of swapchains to be created could only be found by walking this
62linked list of alternating structures, and the pname:pSwapchains out
63parameter was reinterpreted to be an array of slink:VkSwapchainKHR handles.
64
65Another option considered was a method to specify a "`shared`" swapchain
66when creating a new swapchain, such that groups of swapchains using the same
67images could be built up one at a time.
68This was deemed unusable because drivers need to know all of the displays an
69image will be used on when determining which internal formats and layouts to
70use for that image.
71
72=== Examples
73
74[NOTE]
75.Note
76====
77The example code for the `apiext:VK_KHR_display` and
78`VK_KHR_display_swapchain` extensions was removed from the appendix after
79revision 1.0.43.
80The display swapchain creation example code was ported to the cube demo that
81is shipped with the official Khronos SDK, and is being kept up-to-date in
82that location (see:
83https://github.com/KhronosGroup/Vulkan-Tools/blob/master/cube/cube.c).
84====
85
86=== Version History
87
88  * Revision 1, 2015-07-29 (James Jones)
89  ** Initial draft
90
91  * Revision 2, 2015-08-21 (Ian Elliott)
92  ** Renamed this extension and all of its enumerations, types, functions,
93     etc.
94     This makes it compliant with the proposed standard for Vulkan
95     extensions.
96  ** Switched from "`revision`" to "`version`", including use of the
97     VK_MAKE_VERSION macro in the header file.
98
99  * Revision 3, 2015-09-01 (James Jones)
100  ** Restore single-field revision number.
101
102  * Revision 4, 2015-09-08 (James Jones)
103  ** Allow creating multiple swap chains that share the same images using a
104     single call to vkCreateSwapchainKHR().
105
106  * Revision 5, 2015-09-10 (Alon Or-bach)
107  ** Removed underscores from SWAP_CHAIN in two enums.
108
109  * Revision 6, 2015-10-02 (James Jones)
110  ** Added support for smart panels/buffered displays.
111
112  * Revision 7, 2015-10-26 (Ian Elliott)
113  ** Renamed from VK_EXT_KHR_display_swapchain to VK_KHR_display_swapchain.
114
115  * Revision 8, 2015-11-03 (Daniel Rakos)
116  ** Updated sample code based on the changes to VK_KHR_swapchain.
117
118  * Revision 9, 2015-11-10 (Jesse Hall)
119  ** Replaced VkDisplaySwapchainCreateInfoKHR with
120     vkCreateSharedSwapchainsKHR, changing resolution of issue #4.
121
122  * Revision 10, 2017-03-13 (James Jones)
123  ** Closed all remaining issues.
124     The specification and implementations have been shipping with the
125     proposed resolutions for some time now.
126  ** Removed the sample code and noted it has been integrated into the
127     official Vulkan SDK cube demo.
128