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