All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.vulkan.KHRDisplaySwapchain Maven / Gradle / Ivy

Go to download

A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

There is a newer version: 3.3.4
Show newest version
/*
 * 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-LoaderAndValidationLayers/blob/master/demos/cube.c).

*
* *
*
Name String
*
{@code VK_KHR_display_swapchain}
*
Extension Type
*
Device extension
*
Registered Extension Number
*
4
*
Revision
*
9
*
Extension and Version Dependencies
*
    *
  • Requires Vulkan 1.0
  • *
  • Requires {@link KHRSwapchain VK_KHR_swapchain}
  • *
  • Requires {@link KHRDisplay 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
  • *
*
*/ public class KHRDisplaySwapchain { /** The extension specification version. */ public static final int VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION = 9; /** 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(); } static boolean isAvailable(VKCapabilitiesDevice caps) { return checkFunctions( caps.vkCreateSharedSwapchainsKHR ); } // --- [ 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); VkSwapchainCreateInfoKHR.validate(pCreateInfos, swapchainCount); if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); } } return callPPPPI(__functionAddress, device.address(), swapchainCount, pCreateInfos, pAllocator, pSwapchains); } /** * 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
* *

{@link #vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR} 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("const VkSwapchainCreateInfoKHR *") VkSwapchainCreateInfoKHR.Buffer pCreateInfos, @Nullable @NativeType("const VkAllocationCallbacks *") 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("const VkSwapchainCreateInfoKHR *") VkSwapchainCreateInfoKHR.Buffer pCreateInfos, @Nullable @NativeType("const VkAllocationCallbacks *") VkAllocationCallbacks pAllocator, @NativeType("VkSwapchainKHR *") long[] pSwapchains) { long __functionAddress = device.getCapabilities().vkCreateSharedSwapchainsKHR; if (CHECKS) { check(__functionAddress); check(pSwapchains, pCreateInfos.remaining()); VkSwapchainCreateInfoKHR.validate(pCreateInfos.address(), pCreateInfos.remaining()); if (pAllocator != null) { VkAllocationCallbacks.validate(pAllocator.address()); } } return callPPPPI(__functionAddress, device.address(), pCreateInfos.remaining(), pCreateInfos.address(), memAddressSafe(pAllocator), pSwapchains); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy