Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRDisplaySwapchain

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

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 and VK_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).

VK_KHR_display_swapchain
Name String
VK_KHR_display_swapchain
Extension Type
Device extension
Registered Extension Number
4
Revision
10
Extension and Version Dependencies
VK_KHR_swapchain and VK_KHR_display
Contact
Other Extension Metadata
Last Modified Date
2017-03-13
IP Status
No known IP claims.
Contributors
  • James Jones, NVIDIA
  • Jeff Vigil, Qualcomm
  • Jesse Hall, Google

Field Summary

Modifier and TypeField and Description
public static final int
public static final String
public static final int
VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION

The extension specification version.

public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nvkCreateSharedSwapchainsKHR(VkDevice device, int
the number of swapchains to create.
swapchainCount
,
long pCreateInfos, long pAllocator, long pSwapchains)

Unsafe version of: CreateSharedSwapchainsKHR

public static int
vkCreateSharedSwapchainsKHR(VkDevice
the device to create the swapchains for.
device
,
VkSwapchainCreateInfoKHR.Buffer
a pointer to an array of VkSwapchainCreateInfoKHR structures specifying the parameters of the created swapchains.
pCreateInfos
,
VkAllocationCallbacks
the allocator used for host memory allocated for the swapchain objects when there is no more specific allocator available (see Memory Allocation).
pAllocator
,
LongBuffer
a pointer to an array of VkSwapchainKHR handles in which the created swapchain objects will be returned.
pSwapchains
)

Create multiple swapchains that share presentable images.

public static int
vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, VkAllocationCallbacks pAllocator, long[] pSwapchains)

Array version of: CreateSharedSwapchainsKHR

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_ERROR_INCOMPATIBLE_DISPLAY_KHRback to summary
public static final int VK_ERROR_INCOMPATIBLE_DISPLAY_KHR

Extends VkResult.

VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAMEback to summary
public static final String VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME

The extension name.

VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSIONback to summary
public static final int VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION

The extension specification version.

VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR

Extends VkStructureType.

Constructor Detail

KHRDisplaySwapchainback to summary
protected KHRDisplaySwapchain()

Method Detail

nvkCreateSharedSwapchainsKHRback to summary
public static int nvkCreateSharedSwapchainsKHR(VkDevice device, int swapchainCount, long pCreateInfos, long pAllocator, long pSwapchains)

Unsafe version of: CreateSharedSwapchainsKHR

Parameters
swapchainCount:int

the number of swapchains to create.

vkCreateSharedSwapchainsKHRback to summary
public static int vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, VkAllocationCallbacks pAllocator, 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 to CreateSwapchainKHR, except that it takes an array of VkSwapchainCreateInfoKHR 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 being modified. 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 valid VkDevice handle
  • pCreateInfos must be a valid pointer to an array of swapchainCount valid VkSwapchainCreateInfoKHR structures
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
  • pSwapchains must be a valid pointer to an array of swapchainCount VkSwapchainKHR handles
  • swapchainCount 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

VkAllocationCallbacks, VkSwapchainCreateInfoKHR

Parameters
device:VkDevice

the device to create the swapchains for.

pCreateInfos:VkSwapchainCreateInfoKHR.Buffer

a pointer to an array of VkSwapchainCreateInfoKHR structures specifying the parameters of the created swapchains.

pAllocator:VkAllocationCallbacks

the allocator used for host memory allocated for the swapchain objects when there is no more specific allocator available (see Memory Allocation).

pSwapchains:LongBuffer

a pointer to an array of VkSwapchainKHR handles in which the created swapchain objects will be returned.

Annotations
@NativeType:VkResult
vkCreateSharedSwapchainsKHRback to summary
public static int vkCreateSharedSwapchainsKHR(VkDevice device, VkSwapchainCreateInfoKHR.Buffer pCreateInfos, VkAllocationCallbacks pAllocator, long[] pSwapchains)

Array version of: CreateSharedSwapchainsKHR

Annotations
@NativeType:VkResult