org.lwjgl.vulkan.KHRDisplaySwapchain Maven / Gradle / Ivy
Show all versions of lwjgl-vulkan Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* 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 {@link KHRDisplay VK_KHR_display} and {@code 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
* - {@code VK_KHR_display_swapchain}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 4
* - Revision
* - 10
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@link KHRSwapchain VK_KHR_swapchain}
* - Requires {@link KHRDisplay VK_KHR_display}
*
* - Contact
*
* - James Jones cubanismo
*
*
*
* 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
*
*
*/
public class KHRDisplaySwapchain {
/** The extension specification version. */
public static final int VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION = 10;
/** The extension name. */
public static final String VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_display_swapchain";
/** Extends {@code VkStructureType}. */
public static final int VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000;
/** Extends {@code VkResult}. */
public static final int VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001;
protected KHRDisplaySwapchain() {
throw new UnsupportedOperationException();
}
// --- [ vkCreateSharedSwapchainsKHR ] ---
/**
* Unsafe version of: {@link #vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR}
*
* @param swapchainCount the number of swapchains to create.
*/
public static int nvkCreateSharedSwapchainsKHR(VkDevice device, int swapchainCount, long pCreateInfos, long pAllocator, long pSwapchains) {
long __functionAddress = device.getCapabilities().vkCreateSharedSwapchainsKHR;
if (CHECKS) {
check(__functionAddress);
if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); }
}
return callPPPPI(device.address(), swapchainCount, pCreateInfos, pAllocator, pSwapchains, __functionAddress);
}
/**
* Create multiple swapchains that share presentable images.
*
* C Specification
*
* When the {@code 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
*
* {@code vkCreateSharedSwapchainsKHR} is similar to {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}, except that it takes an array of {@link 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 {@link #VK_ERROR_INCOMPATIBLE_DISPLAY_KHR 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 from {@link KHRSwapchain#VK_IMAGE_LAYOUT_PRESENT_SRC_KHR IMAGE_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)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pCreateInfos} must be a valid pointer to an array of {@code swapchainCount} valid {@link VkSwapchainCreateInfoKHR} structures
* - If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a valid pointer to a valid {@link VkAllocationCallbacks} structure
* - {@code pSwapchains} must be a valid pointer to an array of {@code swapchainCount} {@code VkSwapchainKHR} handles
* - {@code swapchainCount} must be greater than 0
*
*
* Host Synchronization
*
*
* - Host access to {@code pCreateInfos}[].surface must be externally synchronized
* - Host access to {@code pCreateInfos}[].oldSwapchain must be externally synchronized
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
* - {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
* - {@link #VK_ERROR_INCOMPATIBLE_DISPLAY_KHR ERROR_INCOMPATIBLE_DISPLAY_KHR}
* - {@link VK10#VK_ERROR_DEVICE_LOST ERROR_DEVICE_LOST}
* - {@link KHRSurface#VK_ERROR_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
*
*
*
* See Also
*
* {@link VkAllocationCallbacks}, {@link VkSwapchainCreateInfoKHR}
*
* @param device the device to create the swapchains for.
* @param pCreateInfos a pointer to an array of {@link VkSwapchainCreateInfoKHR} structures specifying the parameters of the created swapchains.
* @param pAllocator the allocator used for host memory allocated for the swapchain objects when there is no more specific allocator available (see Memory Allocation).
* @param pSwapchains a pointer to an array of {@code VkSwapchainKHR} handles in which the created swapchain objects will be returned.
*/
@NativeType("VkResult")
public static int vkCreateSharedSwapchainsKHR(VkDevice device, @NativeType("VkSwapchainCreateInfoKHR const *") VkSwapchainCreateInfoKHR.Buffer pCreateInfos, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkSwapchainKHR *") LongBuffer pSwapchains) {
if (CHECKS) {
check(pSwapchains, pCreateInfos.remaining());
}
return nvkCreateSharedSwapchainsKHR(device, pCreateInfos.remaining(), pCreateInfos.address(), memAddressSafe(pAllocator), memAddress(pSwapchains));
}
/** Array version of: {@link #vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR} */
@NativeType("VkResult")
public static int vkCreateSharedSwapchainsKHR(VkDevice device, @NativeType("VkSwapchainCreateInfoKHR const *") VkSwapchainCreateInfoKHR.Buffer pCreateInfos, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkSwapchainKHR *") long[] pSwapchains) {
long __functionAddress = device.getCapabilities().vkCreateSharedSwapchainsKHR;
if (CHECKS) {
check(__functionAddress);
check(pSwapchains, pCreateInfos.remaining());
if (pAllocator != null) { VkAllocationCallbacks.validate(pAllocator.address()); }
}
return callPPPPI(device.address(), pCreateInfos.remaining(), pCreateInfos.address(), memAddressSafe(pAllocator), pSwapchains, __functionAddress);
}
}