Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRSwapchain

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

The VK_KHR_swapchain extension is the device-level companion to the VK_KHR_surface extension. It introduces VkSwapchainKHR objects, which provide the ability to present rendering results to a surface.
Examples
Note

The example code for the VK_KHR_surface and VK_KHR_swapchain extensions was removed from the appendix after revision 1.0.29. This WSI 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_swapchain
Name String
VK_KHR_swapchain
Extension Type
Device extension
Registered Extension Number
2
Revision
70
Extension and Version Dependencies
VK_KHR_surface
Contact
Other Extension Metadata
Last Modified Date
2017-10-06
IP Status
No known IP claims.
Interactions and External Dependencies
  • Interacts with Vulkan 1.1
Contributors
  • Patrick Doane, Blizzard
  • Ian Elliott, LunarG
  • Jesse Hall, Google
  • Mathias Heyer, NVIDIA
  • James Jones, NVIDIA
  • David Mao, AMD
  • Norbert Nopper, Freescale
  • Alon Or-bach, Samsung
  • Daniel Rakos, AMD
  • Graham Sellers, AMD
  • Jeff Vigil, Qualcomm
  • Chia-I Wu, LunarG
  • Faith Ekstrand, Intel
  • Matthaeus G. Chajdas, AMD
  • Ray Smith, ARM

Field Summary

Modifier and TypeField and Description
public static final int
VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR

VkDeviceGroupPresentModeFlagBitsKHR - Bitmask specifying supported device group present modes Description

public static final int
VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR

VkDeviceGroupPresentModeFlagBitsKHR - Bitmask specifying supported device group present modes Description

public static final int
VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR

VkDeviceGroupPresentModeFlagBitsKHR - Bitmask specifying supported device group present modes Description

public static final int
VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR

VkDeviceGroupPresentModeFlagBitsKHR - Bitmask specifying supported device group present modes Description

public static final int
VK_ERROR_OUT_OF_DATE_KHR

Extends VkResult.

public static final int
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR

Extends VkImageLayout.

public static final String
public static final int
VK_KHR_SWAPCHAIN_SPEC_VERSION

The extension specification version.

public static final int
VK_OBJECT_TYPE_SWAPCHAIN_KHR

Extends VkObjectType.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
VK_STRUCTURE_TYPE_PRESENT_INFO_KHR

Extends VkStructureType.

public static final int
public static final int
VK_SUBOPTIMAL_KHR

Extends VkResult.

public static final int
VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR

Extends VkSwapchainCreateFlagBitsKHR.

public static final int
VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR

Extends VkSwapchainCreateFlagBitsKHR.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nvkAcquireNextImage2KHR(VkDevice device, long pAcquireInfo, long pImageIndex)

Unsafe version of: AcquireNextImage2KHR

public static int
nvkAcquireNextImageKHR(VkDevice device, long swapchain, long timeout, long semaphore, long fence, long pImageIndex)

Unsafe version of: AcquireNextImageKHR

public static int
nvkCreateSwapchainKHR(VkDevice device, long pCreateInfo, long pAllocator, long pSwapchain)

Unsafe version of: CreateSwapchainKHR

public static void
nvkDestroySwapchainKHR(VkDevice device, long swapchain, long pAllocator)

Unsafe version of: DestroySwapchainKHR

public static int
nvkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, long pDeviceGroupPresentCapabilities)

Unsafe version of: GetDeviceGroupPresentCapabilitiesKHR

public static int
nvkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, long surface, long pModes)

Unsafe version of: GetDeviceGroupSurfacePresentModesKHR

public static int
nvkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, long surface, long
a pointer to an integer related to the number of rectangles available or queried, as described below.
pRectCount
,
long pRects)

Unsafe version of: GetPhysicalDevicePresentRectanglesKHR

public static int
nvkGetSwapchainImagesKHR(VkDevice device, long swapchain, long
a pointer to an integer related to the number of presentable images available or queried, as described below.
pSwapchainImageCount
,
long pSwapchainImages)

Unsafe version of: GetSwapchainImagesKHR

public static int
nvkQueuePresentKHR(VkQueue queue, long pPresentInfo)

Unsafe version of: QueuePresentKHR

public static int
vkAcquireNextImage2KHR(VkDevice
the device associated with swapchain.
device
,
VkAcquireNextImageInfoKHR
a pointer to a VkAcquireNextImageInfoKHR structure containing parameters of the acquire.
pAcquireInfo
,
IntBuffer
a pointer to a uint32_t that is set to the index of the next image to use.
pImageIndex
)

Retrieve the index of the next available presentable image.

public static int
vkAcquireNextImage2KHR(VkDevice device, VkAcquireNextImageInfoKHR pAcquireInfo, int[] pImageIndex)

Array version of: AcquireNextImage2KHR

public static int
vkAcquireNextImageKHR(VkDevice
the device associated with swapchain.
device
,
long
the non-retired swapchain from which an image is being acquired.
swapchain
,
long
specifies how long the function waits, in nanoseconds, if no image is available.
timeout
,
long
NULL_HANDLE or a semaphore to signal.
semaphore
,
long
NULL_HANDLE or a fence to signal.
fence
,
IntBuffer
a pointer to a uint32_t in which the index of the next image to use (i.e. an index into the array of images returned by vkGetSwapchainImagesKHR) is returned.
pImageIndex
)

Retrieve the index of the next available presentable image.

public static int
vkAcquireNextImageKHR(VkDevice device, long swapchain, long timeout, long semaphore, long fence, int[] pImageIndex)

Array version of: AcquireNextImageKHR

public static int
vkCreateSwapchainKHR(VkDevice
the device to create the swapchain for.
device
,
VkSwapchainCreateInfoKHR
a pointer to a VkSwapchainCreateInfoKHR structure specifying the parameters of the created swapchain.
pCreateInfo
,
VkAllocationCallbacks
the allocator used for host memory allocated for the swapchain object when there is no more specific allocator available (see Memory Allocation).
pAllocator
,
LongBuffer
a pointer to a VkSwapchainKHR handle in which the created swapchain object will be returned.
pSwapchain
)

Create a swapchain.

public static int
vkCreateSwapchainKHR(VkDevice device, VkSwapchainCreateInfoKHR pCreateInfo, VkAllocationCallbacks pAllocator, long[] pSwapchain)

Array version of: CreateSwapchainKHR

public static void
vkDestroySwapchainKHR(VkDevice
the VkDevice associated with swapchain.
device
,
long
the swapchain to destroy.
swapchain
,
VkAllocationCallbacks
the allocator used for host memory allocated for the swapchain object when there is no more specific allocator available (see Memory Allocation).
pAllocator
)

Destroy a swapchain object.

public static int
vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice
the logical device.
device
,
VkDeviceGroupPresentCapabilitiesKHR
a pointer to a VkDeviceGroupPresentCapabilitiesKHR structure in which the device’s capabilities are returned.
pDeviceGroupPresentCapabilities
)

Query present capabilities from other physical devices.

public static int
vkGetDeviceGroupSurfacePresentModesKHR(VkDevice
the logical device.
device
,
long
the surface.
surface
,
IntBuffer
a pointer to a VkDeviceGroupPresentModeFlagsKHR in which the supported device group present modes for the surface are returned.
pModes
)

Query present capabilities for a surface.

public static int
vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, long surface, int[] pModes)

Array version of: GetDeviceGroupSurfacePresentModesKHR

public static int
vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice
the physical device.
physicalDevice
,
long
the surface.
surface
,
IntBuffer
a pointer to an integer related to the number of rectangles available or queried, as described below.
pRectCount
,
VkRect2D.Buffer
either NULL or a pointer to an array of VkRect2D structures.
pRects
)

Query present rectangles for a surface on a physical device.

public static int
vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, long surface, int[] pRectCount, VkRect2D.Buffer pRects)

Array version of: GetPhysicalDevicePresentRectanglesKHR

public static int
vkGetSwapchainImagesKHR(VkDevice
the device associated with swapchain.
device
,
long
the swapchain to query.
swapchain
,
IntBuffer
a pointer to an integer related to the number of presentable images available or queried, as described below.
pSwapchainImageCount
,
LongBuffer
either NULL or a pointer to an array of VkImage handles.
pSwapchainImages
)

Obtain the array of presentable images associated with a swapchain.

public static int
vkGetSwapchainImagesKHR(VkDevice device, long swapchain, int[] pSwapchainImageCount, long[] pSwapchainImages)

Array version of: GetSwapchainImagesKHR

public static int
vkQueuePresentKHR(VkQueue
a queue that is capable of presentation to the target surface’s platform on the same device as the image’s swapchain.
queue
,
VkPresentInfoKHR
a pointer to a VkPresentInfoKHR structure specifying parameters of the presentation.
pPresentInfo
)

Queue an image for presentation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait