1// Copyright 2014-2023 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[create_shared_swapchains]] 6 7[open,refpage='vkCreateSharedSwapchainsKHR',desc='Create multiple swapchains that share presentable images',type='protos'] 8-- 9:refpage: vkCreateSharedSwapchainsKHR 10:objectnameplural: swapchains 11:objectnamecamelcase: swapchain 12:objectcount: pname:swapchainCount 13 14When the `apiext:VK_KHR_display_swapchain` extension is enabled, multiple 15swapchains that share presentable images are created by calling: 16 17include::{generated}/api/protos/vkCreateSharedSwapchainsKHR.adoc[] 18 19 * pname:device is the device to create the swapchains for. 20 * pname:swapchainCount is the number of swapchains to create. 21 * pname:pCreateInfos is a pointer to an array of 22 slink:VkSwapchainCreateInfoKHR structures specifying the parameters of 23 the created swapchains. 24 * pname:pAllocator is the allocator used for host memory allocated for the 25 swapchain objects when there is no more specific allocator available 26 (see <<memory-allocation,Memory Allocation>>). 27 * pname:pSwapchains is a pointer to an array of slink:VkSwapchainKHR 28 handles in which the created swapchain objects will be returned. 29 30fname:vkCreateSharedSwapchainsKHR is similar to flink:vkCreateSwapchainKHR, 31except that it takes an array of slink:VkSwapchainCreateInfoKHR structures, 32and returns an array of swapchain objects. 33 34The swapchain creation parameters that affect the properties and number of 35presentable images must: match between all the swapchains. 36If the displays used by any of the swapchains do not use the same 37presentable image layout or are incompatible in a way that prevents sharing 38images, swapchain creation will fail with the result code 39ename:VK_ERROR_INCOMPATIBLE_DISPLAY_KHR. 40If any error occurs, no swapchains will be created. 41Images presented to multiple swapchains must: be re-acquired from all of 42them before being modified. 43After destroying one or more of the swapchains, the remaining swapchains and 44the presentable images can: continue to be used. 45 46include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[] 47 48ifdef::VKSC_VERSION_1_0[] 49.Valid Usage 50**** 51include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[] 52**** 53endif::VKSC_VERSION_1_0[] 54 55include::{generated}/validity/protos/vkCreateSharedSwapchainsKHR.adoc[] 56-- 57