Class KHRDisplaySwapchain
- java.lang.Object
-
- org.lwjgl.vulkan.KHRDisplaySwapchain
-
public class KHRDisplaySwapchain extends java.lang.Object
This extension provides an API to create a swapchain directly on a device's display without any underlying window system.Examples
Note
The example code for the
VK_KHR_display
andVK_KHR_display_swapchain
extensions was removed from the appendix after revision 1.0.43. The display swapchain creation example code was ported to the cube demo that is shipped with the official Khronos SDK, and is being kept up-to-date in that location (see: https://github.com/KhronosGroup/Vulkan-Tools/blob/master/cube/cube.c).- Name String
VK_KHR_display_swapchain
- Extension Type
- Device extension
- Registered Extension Number
- 4
- Revision
- 10
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_swapchain
- Requires
VK_KHR_display
- Contact
- James Jones cubanismo
- Last Modified Date
- 2017-03-13
- IP Status
- No known IP claims.
- Contributors
- James Jones, NVIDIA
- Jeff Vigil, Qualcomm
- Jesse Hall, Google
-
-
Field Summary
Fields Modifier and Type Field Description static int
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR
ExtendsVkResult
.static java.lang.String
VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME
The extension name.static int
VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION
The extension specification version.static int
VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR
ExtendsVkStructureType
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
nvkCreateSharedSwapchainsKHR(VkDevice device, int swapchainCount, long pCreateInfos, long pAllocator, long pSwapchains)
Unsafe version of:CreateSharedSwapchainsKHR
static int
vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, VkAllocationCallbacks pAllocator, long[] pSwapchains)
Array version of:CreateSharedSwapchainsKHR
static int
vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, VkAllocationCallbacks pAllocator, java.nio.LongBuffer pSwapchains)
Create multiple swapchains that share presentable images.
-
-
-
Field Detail
-
VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION
public static final int VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION
The extension specification version.- See Also:
- Constant Field Values
-
VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME
public static final java.lang.String VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME
The extension name.- See Also:
- Constant Field Values
-
VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR
public static final int VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR
ExtendsVkStructureType
.- See Also:
- Constant Field Values
-
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR
public static final int VK_ERROR_INCOMPATIBLE_DISPLAY_KHR
ExtendsVkResult
.- See Also:
- Constant Field Values
-
-
Method Detail
-
nvkCreateSharedSwapchainsKHR
public static int nvkCreateSharedSwapchainsKHR(VkDevice device, int swapchainCount, long pCreateInfos, long pAllocator, long pSwapchains)
Unsafe version of:CreateSharedSwapchainsKHR
- Parameters:
swapchainCount
- the number of swapchains to create.
-
vkCreateSharedSwapchainsKHR
public static int vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, @Nullable VkAllocationCallbacks pAllocator, java.nio.LongBuffer pSwapchains)
Create multiple swapchains that share presentable images.C Specification
When the
VK_KHR_display_swapchain
extension is enabled, multiple swapchains that share presentable images are created by calling:VkResult vkCreateSharedSwapchainsKHR( VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains);
Description
vkCreateSharedSwapchainsKHR
is similar toCreateSwapchainKHR
, except that it takes an array ofVkSwapchainCreateInfoKHR
structures, and returns an array of swapchain objects.The swapchain creation parameters that affect the properties and number of presentable images must match between all the swapchains. If the displays used by any of the swapchains do not use the same presentable image layout or are incompatible in a way that prevents sharing images, swapchain creation will fail with the result code
ERROR_INCOMPATIBLE_DISPLAY_KHR
. If any error occurs, no swapchains will be created. Images presented to multiple swapchains must be re-acquired from all of them before transitioning away fromIMAGE_LAYOUT_PRESENT_SRC_KHR
. After destroying one or more of the swapchains, the remaining swapchains and the presentable images can continue to be used.Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfos
must be a valid pointer to an array ofswapchainCount
validVkSwapchainCreateInfoKHR
structures- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validVkAllocationCallbacks
structure pSwapchains
must be a valid pointer to an array ofswapchainCount
VkSwapchainKHR
handlesswapchainCount
must be greater than 0
Host Synchronization
- Host access to
pCreateInfos
[].surface must be externally synchronized - Host access to
pCreateInfos
[].oldSwapchain must be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device
- the device to create the swapchains for.pCreateInfos
- a pointer to an array ofVkSwapchainCreateInfoKHR
structures specifying the parameters of the created swapchains.pAllocator
- the allocator used for host memory allocated for the swapchain objects when there is no more specific allocator available (see Memory Allocation).pSwapchains
- a pointer to an array ofVkSwapchainKHR
handles in which the created swapchain objects will be returned.
-
vkCreateSharedSwapchainsKHR
public static int vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, @Nullable VkAllocationCallbacks pAllocator, long[] pSwapchains)
Array version of:CreateSharedSwapchainsKHR
-
-