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

org.lwjgl.vulkan.KHRSurface 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.*;

/**
 * The {@code VK_KHR_surface} extension is an instance extension. It introduces {@code VkSurfaceKHR} objects, which abstract native platform surface or window objects for use with Vulkan. It also provides a way to determine whether a queue family in a physical device supports presenting to particular surface.
 * 
 * 

Separate extensions for each platform provide the mechanisms for creating {@code VkSurfaceKHR} objects, but once created they may be used in this and other platform-independent extensions, in particular the {@link KHRSwapchain VK_KHR_swapchain} extension.

* *
Examples
* *
Note
* *

The example code for the {@code VK_KHR_surface} and {@link KHRSwapchain 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_surface
* *
*
Name String
*
{@code VK_KHR_surface}
*
Extension Type
*
Instance extension
*
Registered Extension Number
*
1
*
Revision
*
25
*
Extension and Version Dependencies
*
    *
  • Requires Vulkan 1.0
  • *
*
Contact
*
*
* *
Other Extension Metadata
* *
*
Last Modified Date
*
2016-08-25
*
IP Status
*
No known IP claims.
*
Contributors
*
    *
  • Patrick Doane, Blizzard
  • *
  • Ian Elliott, LunarG
  • *
  • Jesse Hall, Google
  • *
  • 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
  • *
  • Jason Ekstrand, Intel
  • *
*
*/ public class KHRSurface { /** The extension specification version. */ public static final int VK_KHR_SURFACE_SPEC_VERSION = 25; /** The extension name. */ public static final String VK_KHR_SURFACE_EXTENSION_NAME = "VK_KHR_surface"; /** * Extends {@code VkResult}. * *
Enum values:
* *
    *
  • {@link #VK_ERROR_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
  • *
  • {@link #VK_ERROR_NATIVE_WINDOW_IN_USE_KHR ERROR_NATIVE_WINDOW_IN_USE_KHR}
  • *
*/ public static final int VK_ERROR_SURFACE_LOST_KHR = -1000000000, VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001; /** Extends {@code VkObjectType}. */ public static final int VK_OBJECT_TYPE_SURFACE_KHR = 1000000000; /** * VkSurfaceTransformFlagBitsKHR - Presentation transforms supported on a device * *
Description
* *
    *
  • {@link #VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR SURFACE_TRANSFORM_IDENTITY_BIT_KHR} specifies that image content is presented without being transformed.
  • *
  • {@link #VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR SURFACE_TRANSFORM_ROTATE_90_BIT_KHR} specifies that image content is rotated 90 degrees clockwise.
  • *
  • {@link #VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR SURFACE_TRANSFORM_ROTATE_180_BIT_KHR} specifies that image content is rotated 180 degrees clockwise.
  • *
  • {@link #VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR SURFACE_TRANSFORM_ROTATE_270_BIT_KHR} specifies that image content is rotated 270 degrees clockwise.
  • *
  • {@link #VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR} specifies that image content is mirrored horizontally.
  • *
  • {@link #VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR} specifies that image content is mirrored horizontally, then rotated 90 degrees clockwise.
  • *
  • {@link #VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR} specifies that image content is mirrored horizontally, then rotated 180 degrees clockwise.
  • *
  • {@link #VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR} specifies that image content is mirrored horizontally, then rotated 270 degrees clockwise.
  • *
  • {@link #VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR SURFACE_TRANSFORM_INHERIT_BIT_KHR} specifies that the presentation transform is not specified, and is instead determined by platform-specific considerations and mechanisms outside Vulkan.
  • *
* *
See Also
* *

{@link VkCommandBufferInheritanceRenderPassTransformInfoQCOM}, {@link VkCopyCommandTransformInfoQCOM}, {@link VkDisplaySurfaceCreateInfoKHR}, {@link VkRenderPassTransformBeginInfoQCOM}, {@link VkSurfaceCapabilities2EXT}, {@link VkSurfaceCapabilitiesKHR}, {@link VkSwapchainCreateInfoKHR}

*/ public static final int VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x1, VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x2, VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x4, VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x8, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x10, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x20, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x40, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x80, VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x100; /** * VkPresentModeKHR - Presentation mode supported for a surface * *
Description
* *
    *
  • {@link #VK_PRESENT_MODE_IMMEDIATE_KHR PRESENT_MODE_IMMEDIATE_KHR} specifies that the presentation engine does not wait for a vertical blanking period to update the current image, meaning this mode may result in visible tearing. No internal queuing of presentation requests is needed, as the requests are applied immediately.
  • *
  • {@link #VK_PRESENT_MODE_MAILBOX_KHR PRESENT_MODE_MAILBOX_KHR} specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal single-entry queue is used to hold pending presentation requests. If the queue is full when a new presentation request is received, the new request replaces the existing entry, and any images associated with the prior entry become available for re-use by the application. One request is removed from the queue and processed during each vertical blanking period in which the queue is non-empty.
  • *
  • {@link #VK_PRESENT_MODE_FIFO_KHR PRESENT_MODE_FIFO_KHR} specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during each vertical blanking period in which the queue is non-empty. This is the only value of {@code presentMode} that is required to be supported.
  • *
  • {@link #VK_PRESENT_MODE_FIFO_RELAXED_KHR PRESENT_MODE_FIFO_RELAXED_KHR} specifies that the presentation engine generally waits for the next vertical blanking period to update the current image. If a vertical blanking period has already passed since the last update of the current image then the presentation engine does not wait for another vertical blanking period for the update, meaning this mode may result in visible tearing in this case. This mode is useful for reducing visual stutter with an application that will mostly present a new image before the next vertical blanking period, but may occasionally be late, and present a new image just after the next vertical blanking period. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during or after each vertical blanking period in which the queue is non-empty.
  • *
  • {@link KHRSharedPresentableImage#VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR} specifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine is only required to update the current image after a new presentation request is received. Therefore the application must make a presentation request whenever an update is required. However, the presentation engine may update the current image at any point, meaning this mode may result in visible tearing.
  • *
  • {@link KHRSharedPresentableImage#VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR} specifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine periodically updates the current image on its regular refresh cycle. The application is only required to make one initial presentation request, after which the presentation engine must update the current image without any need for further presentation requests. The application can indicate the image contents have been updated by making a presentation request, but this does not guarantee the timing of when it will be updated. This mode may result in visible tearing if rendering to the image is not timed correctly.
  • *
* *

The supported {@code VkImageUsageFlagBits} of the presentable images of a swapchain created for a surface may differ depending on the presentation mode, and can be determined as per the table below:

* *
Presentable image usage queries
* * * * * * * * * * * *
Presentation modeImage usage flags
{@link #VK_PRESENT_MODE_IMMEDIATE_KHR PRESENT_MODE_IMMEDIATE_KHR}{@link VkSurfaceCapabilitiesKHR}{@code ::supportedUsageFlags}
{@link #VK_PRESENT_MODE_MAILBOX_KHR PRESENT_MODE_MAILBOX_KHR}{@link VkSurfaceCapabilitiesKHR}{@code ::supportedUsageFlags}
{@link #VK_PRESENT_MODE_FIFO_KHR PRESENT_MODE_FIFO_KHR}{@link VkSurfaceCapabilitiesKHR}{@code ::supportedUsageFlags}
{@link #VK_PRESENT_MODE_FIFO_RELAXED_KHR PRESENT_MODE_FIFO_RELAXED_KHR}{@link VkSurfaceCapabilitiesKHR}{@code ::supportedUsageFlags}
{@link KHRSharedPresentableImage#VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR}{@link VkSharedPresentSurfaceCapabilitiesKHR}{@code ::sharedPresentSupportedUsageFlags}
{@link KHRSharedPresentableImage#VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR}{@link VkSharedPresentSurfaceCapabilitiesKHR}{@code ::sharedPresentSupportedUsageFlags}
* *
Note
* *

For reference, the mode indicated by {@link #VK_PRESENT_MODE_FIFO_KHR PRESENT_MODE_FIFO_KHR} is equivalent to the behavior of {wgl|glX|egl}SwapBuffers with a swap interval of 1, while the mode indicated by {@link #VK_PRESENT_MODE_FIFO_RELAXED_KHR PRESENT_MODE_FIFO_RELAXED_KHR} is equivalent to the behavior of {wgl|glX}SwapBuffers with a swap interval of -1 (from the {WGL|GLX}_EXT_swap_control_tear extensions).

*
* *
See Also
* *

{@link VkSwapchainCreateInfoKHR}, {@link EXTFullScreenExclusive#vkGetPhysicalDeviceSurfacePresentModes2EXT GetPhysicalDeviceSurfacePresentModes2EXT}, {@link #vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR}

*/ public static final int VK_PRESENT_MODE_IMMEDIATE_KHR = 0, VK_PRESENT_MODE_MAILBOX_KHR = 1, VK_PRESENT_MODE_FIFO_KHR = 2, VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3; /** * VkColorSpaceKHR - Supported color space of the presentation engine * *
Description
* *
    *
  • {@link #VK_COLOR_SPACE_SRGB_NONLINEAR_KHR COLOR_SPACE_SRGB_NONLINEAR_KHR} specifies support for the sRGB color space.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT} specifies support for the Display-P3 color space to be displayed using an sRGB-like EOTF (defined below).
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT} specifies support for the extended sRGB color space to be displayed using a linear EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT} specifies support for the extended sRGB color space to be displayed using an sRGB EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT COLOR_SPACE_DISPLAY_P3_LINEAR_EXT} specifies support for the Display-P3 color space to be displayed using a linear EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT COLOR_SPACE_DCI_P3_NONLINEAR_EXT} specifies support for the DCI-P3 color space to be displayed using the DCI-P3 EOTF. Note that values in such an image are interpreted as XYZ encoded color data by the presentation engine.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_BT709_LINEAR_EXT COLOR_SPACE_BT709_LINEAR_EXT} specifies support for the BT709 color space to be displayed using a linear EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_BT709_NONLINEAR_EXT COLOR_SPACE_BT709_NONLINEAR_EXT} specifies support for the BT709 color space to be displayed using the SMPTE 170M EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_BT2020_LINEAR_EXT COLOR_SPACE_BT2020_LINEAR_EXT} specifies support for the BT2020 color space to be displayed using a linear EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_HDR10_ST2084_EXT COLOR_SPACE_HDR10_ST2084_EXT} specifies support for the HDR10 (BT2020 color) space to be displayed using the SMPTE ST2084 Perceptual Quantizer (PQ) EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_DOLBYVISION_EXT COLOR_SPACE_DOLBYVISION_EXT} specifies support for the Dolby Vision (BT2020 color space), proprietary encoding, to be displayed using the SMPTE ST2084 EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_HDR10_HLG_EXT COLOR_SPACE_HDR10_HLG_EXT} specifies support for the HDR10 (BT2020 color space) to be displayed using the Hybrid Log Gamma (HLG) EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT COLOR_SPACE_ADOBERGB_LINEAR_EXT} specifies support for the AdobeRGB color space to be displayed using a linear EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT COLOR_SPACE_ADOBERGB_NONLINEAR_EXT} specifies support for the AdobeRGB color space to be displayed using the Gamma 2.2 EOTF.
  • *
  • {@link EXTSwapchainColorspace#VK_COLOR_SPACE_PASS_THROUGH_EXT COLOR_SPACE_PASS_THROUGH_EXT} specifies that color components are used “as is”. This is intended to allow applications to supply data for color spaces not described here.
  • *
  • {@link AMDDisplayNativeHdr#VK_COLOR_SPACE_DISPLAY_NATIVE_AMD COLOR_SPACE_DISPLAY_NATIVE_AMD} specifies support for the display’s native color space. This matches the color space expectations of AMD’s FreeSync2 standard, for displays supporting it.
  • *
* *
Note
* *

In the initial release of the {@code VK_KHR_surface} and {@link KHRSwapchain VK_KHR_swapchain} extensions, the token {@link #VK_COLORSPACE_SRGB_NONLINEAR_KHR COLORSPACE_SRGB_NONLINEAR_KHR} was used. Starting in the 2016-05-13 updates to the extension branches, matching release 1.0.13 of the core API specification, {@link #VK_COLOR_SPACE_SRGB_NONLINEAR_KHR COLOR_SPACE_SRGB_NONLINEAR_KHR} is used instead for consistency with Vulkan naming rules. The older enum is still available for backwards compatibility.

*
* *
Note
* *

In older versions of this extension {@link EXTSwapchainColorspace#VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT COLOR_SPACE_DISPLAY_P3_LINEAR_EXT} was misnamed {@link EXTSwapchainColorspace#VK_COLOR_SPACE_DCI_P3_LINEAR_EXT COLOR_SPACE_DCI_P3_LINEAR_EXT}. This has been updated to indicate that it uses RGB color encoding, not XYZ. The old name is deprecated but is maintained for backwards compatibility.

*
* *

The color components of non-linear color space swap chain images must have had the appropriate transfer function applied. The color space selected for the swap chain image will not affect the processing of data written into the image by the implementation. Vulkan requires that all implementations support the sRGB transfer function by use of an SRGB pixel format. Other transfer functions, such as SMPTE 170M or SMPTE2084, can be performed by the application shader. This extension defines enums for {@code VkColorSpaceKHR} that correspond to the following color spaces:

* *
Color Spaces and Attributes
* * * * * * * * * * * * * * *
NameRed PrimaryGreen PrimaryBlue PrimaryWhite-pointTransfer function
DCI-P31.000, 0.0000.000, 1.0000.000, 0.0000.3333, 0.3333DCI P3
Display-P30.680, 0.3200.265, 0.6900.150, 0.0600.3127, 0.3290 (D65)Display-P3
BT7090.640, 0.3300.300, 0.6000.150, 0.0600.3127, 0.3290 (D65)ITU (SMPTE 170M)
sRGB0.640, 0.3300.300, 0.6000.150, 0.0600.3127, 0.3290 (D65)sRGB
extended sRGB0.640, 0.3300.300, 0.6000.150, 0.0600.3127, 0.3290 (D65)extended sRGB
HDR10_ST20840.708, 0.2920.170, 0.7970.131, 0.0460.3127, 0.3290 (D65)ST2084 PQ
DOLBYVISION0.708, 0.2920.170, 0.7970.131, 0.0460.3127, 0.3290 (D65)ST2084 PQ
HDR10_HLG0.708, 0.2920.170, 0.7970.131, 0.0460.3127, 0.3290 (D65)HLG
AdobeRGB0.640, 0.3300.210, 0.7100.150, 0.0600.3127, 0.3290 (D65)AdobeRGB
* *

The transfer functions are described in the “{@code Transfer Functions}” chapter of the Khronos Data Format Specification.

* *

Except Display-P3 OETF, which is:

* *

     * E =  1.055 × L1/2.4 - 0.055 for 0.0030186 ≤ L ≤ 1
     *     12.92  × L for 0 ≤ L < 0.0030186
* *

where L is the linear value of a color component and E is the encoded value (as stored in the image in memory).

* *
Note
* *

For most uses, the sRGB OETF is equivalent.

*
* *
See Also
* *

{@link VkSurfaceFormatKHR}, {@link VkSwapchainCreateInfoKHR}

*/ public static final int VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0; /** * VkCompositeAlphaFlagBitsKHR - Alpha compositing modes supported on a device * *
Description
* *

These values are described as follows:

* *
    *
  • {@link #VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR COMPOSITE_ALPHA_OPAQUE_BIT_KHR}: The alpha component, if it exists, of the images is ignored in the compositing process. Instead, the image is treated as if it has a constant alpha of 1.0.
  • *
  • {@link #VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR}: The alpha component, if it exists, of the images is respected in the compositing process. The non-alpha components of the image are expected to already be multiplied by the alpha component by the application.
  • *
  • {@link #VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR}: The alpha component, if it exists, of the images is respected in the compositing process. The non-alpha components of the image are not expected to already be multiplied by the alpha component by the application; instead, the compositor will multiply the non-alpha components of the image by the alpha component during compositing.
  • *
  • {@link #VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR COMPOSITE_ALPHA_INHERIT_BIT_KHR}: The way in which the presentation engine treats the alpha component in the images is unknown to the Vulkan API. Instead, the application is responsible for setting the composite alpha blending mode using native window system commands. If the application does not set the blending mode using native window system commands, then a platform-specific default will be used.
  • *
* *
See Also
* *

{@link VkSwapchainCreateInfoKHR}

*/ public static final int VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x1, VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x2, VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x4, VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x8; protected KHRSurface() { throw new UnsupportedOperationException(); } // --- [ vkDestroySurfaceKHR ] --- /** Unsafe version of: {@link #vkDestroySurfaceKHR DestroySurfaceKHR} */ public static void nvkDestroySurfaceKHR(VkInstance instance, long surface, long pAllocator) { long __functionAddress = instance.getCapabilities().vkDestroySurfaceKHR; if (CHECKS) { check(__functionAddress); if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); } } callPJPV(instance.address(), surface, pAllocator, __functionAddress); } /** * Destroy a VkSurfaceKHR object. * *
C Specification
* *

To destroy a {@code VkSurfaceKHR} object, call:

* *

     * void vkDestroySurfaceKHR(
     *     VkInstance                                  instance,
     *     VkSurfaceKHR                                surface,
     *     const VkAllocationCallbacks*                pAllocator);
* *
Description
* *

Destroying a {@code VkSurfaceKHR} merely severs the connection between Vulkan and the native surface, and does not imply destroying the native surface, closing a window, or similar behavior.

* *
Valid Usage
* *
    *
  • All {@code VkSwapchainKHR} objects created for {@code surface} must have been destroyed prior to destroying {@code surface}
  • *
  • If {@link VkAllocationCallbacks} were provided when {@code surface} was created, a compatible set of callbacks must be provided here
  • *
  • If no {@link VkAllocationCallbacks} were provided when {@code surface} was created, {@code pAllocator} must be {@code NULL}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code instance} must be a valid {@code VkInstance} handle
  • *
  • If {@code surface} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code surface} must be a valid {@code VkSurfaceKHR} handle
  • *
  • If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a valid pointer to a valid {@link VkAllocationCallbacks} structure
  • *
  • If {@code surface} is a valid handle, it must have been created, allocated, or retrieved from {@code instance}
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code surface} must be externally synchronized
  • *
* *
See Also
* *

{@link VkAllocationCallbacks}

* * @param instance the instance used to create the surface. * @param surface the surface to destroy. * @param pAllocator the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation). */ public static void vkDestroySurfaceKHR(VkInstance instance, @NativeType("VkSurfaceKHR") long surface, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator) { nvkDestroySurfaceKHR(instance, surface, memAddressSafe(pAllocator)); } // --- [ vkGetPhysicalDeviceSurfaceSupportKHR ] --- /** Unsafe version of: {@link #vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR} */ public static int nvkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, long pSupported) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceSupportKHR; if (CHECKS) { check(__functionAddress); } return callPJPI(physicalDevice.address(), queueFamilyIndex, surface, pSupported, __functionAddress); } /** * Query if presentation is supported. * *
C Specification
* *

To determine whether a queue family of a physical device supports presentation to a given surface, call:

* *

     * VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
     *     VkPhysicalDevice                            physicalDevice,
     *     uint32_t                                    queueFamilyIndex,
     *     VkSurfaceKHR                                surface,
     *     VkBool32*                                   pSupported);
* *
Valid Usage
* *
    *
  • {@code queueFamilyIndex} must be less than {@code pQueueFamilyPropertyCount} returned by {@code vkGetPhysicalDeviceQueueFamilyProperties} for the given {@code physicalDevice}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
  • *
  • {@code surface} must be a valid {@code VkSurfaceKHR} handle
  • *
  • {@code pSupported} must be a valid pointer to a {@code VkBool32} value
  • *
  • Both of {@code physicalDevice}, and {@code surface} must have been created, allocated, or retrieved from the same {@code VkInstance}
  • *
* *
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_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
  • *
*
* * @param physicalDevice the physical device. * @param queueFamilyIndex the queue family. * @param surface the surface. * @param pSupported a pointer to a {@code VkBool32}, which is set to {@link VK10#VK_TRUE TRUE} to indicate support, and {@link VK10#VK_FALSE FALSE} otherwise. */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, @NativeType("uint32_t") int queueFamilyIndex, @NativeType("VkSurfaceKHR") long surface, @NativeType("VkBool32 *") IntBuffer pSupported) { if (CHECKS) { check(pSupported, 1); } return nvkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, memAddress(pSupported)); } // --- [ vkGetPhysicalDeviceSurfaceCapabilitiesKHR ] --- /** Unsafe version of: {@link #vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR} */ public static int nvkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceCapabilities) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceCapabilitiesKHR; if (CHECKS) { check(__functionAddress); } return callPJPI(physicalDevice.address(), surface, pSurfaceCapabilities, __functionAddress); } /** * Query surface capabilities. * *
C Specification
* *

To query the basic capabilities of a surface, needed in order to create a swapchain, call:

* *

     * VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
     *     VkPhysicalDevice                            physicalDevice,
     *     VkSurfaceKHR                                surface,
     *     VkSurfaceCapabilitiesKHR*                   pSurfaceCapabilities);
* *
Valid Usage
* *
    *
  • {@code surface} must be supported by {@code physicalDevice}, as reported by {@link #vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR} or an equivalent platform-specific mechanism
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
  • *
  • {@code surface} must be a valid {@code VkSurfaceKHR} handle
  • *
  • {@code pSurfaceCapabilities} must be a valid pointer to a {@link VkSurfaceCapabilitiesKHR} structure
  • *
  • Both of {@code physicalDevice}, and {@code surface} must have been created, allocated, or retrieved from the same {@code VkInstance}
  • *
* *
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_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
  • *
*
* *
See Also
* *

{@link VkSurfaceCapabilitiesKHR}

* * @param physicalDevice the physical device that will be associated with the swapchain to be created, as described for {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}. * @param surface the surface that will be associated with the swapchain. * @param pSurfaceCapabilities a pointer to a {@link VkSurfaceCapabilitiesKHR} structure in which the capabilities are returned. */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, @NativeType("VkSurfaceKHR") long surface, @NativeType("VkSurfaceCapabilitiesKHR *") VkSurfaceCapabilitiesKHR pSurfaceCapabilities) { return nvkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities.address()); } // --- [ vkGetPhysicalDeviceSurfaceFormatsKHR ] --- /** * Unsafe version of: {@link #vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR} * * @param pSurfaceFormatCount a pointer to an integer related to the number of format pairs available or queried, as described below. */ public static int nvkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceFormatCount, long pSurfaceFormats) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceFormatsKHR; if (CHECKS) { check(__functionAddress); } return callPJPPI(physicalDevice.address(), surface, pSurfaceFormatCount, pSurfaceFormats, __functionAddress); } /** * Query color formats supported by surface. * *
C Specification
* *

To query the supported swapchain format-color space pairs for a surface, call:

* *

     * VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
     *     VkPhysicalDevice                            physicalDevice,
     *     VkSurfaceKHR                                surface,
     *     uint32_t*                                   pSurfaceFormatCount,
     *     VkSurfaceFormatKHR*                         pSurfaceFormats);
* *
Description
* *

If {@code pSurfaceFormats} is {@code NULL}, then the number of format pairs supported for the given {@code surface} is returned in {@code pSurfaceFormatCount}. Otherwise, {@code pSurfaceFormatCount} must point to a variable set by the user to the number of elements in the {@code pSurfaceFormats} array, and on return the variable is overwritten with the number of structures actually written to {@code pSurfaceFormats}. If the value of {@code pSurfaceFormatCount} is less than the number of format pairs supported, at most {@code pSurfaceFormatCount} structures will be written, and {@link VK10#VK_INCOMPLETE INCOMPLETE} will be returned instead of {@link VK10#VK_SUCCESS SUCCESS}, to indicate that not all the available format pairs were returned.

* *

The number of format pairs supported must be greater than or equal to 1. {@code pSurfaceFormats} must not contain an entry whose value for {@code format} is {@link VK10#VK_FORMAT_UNDEFINED FORMAT_UNDEFINED}.

* *

If {@code pSurfaceFormats} includes an entry whose value for {@code colorSpace} is {@link #VK_COLOR_SPACE_SRGB_NONLINEAR_KHR COLOR_SPACE_SRGB_NONLINEAR_KHR} and whose value for {@code format} is a UNORM (or SRGB) format and the corresponding SRGB (or UNORM) format is a color renderable format for {@link VK10#VK_IMAGE_TILING_OPTIMAL IMAGE_TILING_OPTIMAL}, then {@code pSurfaceFormats} must also contain an entry with the same value for {@code colorSpace} and {@code format} equal to the corresponding SRGB (or UNORM) format.

* *
Valid Usage
* *
    *
  • {@code surface} must be supported by {@code physicalDevice}, as reported by {@link #vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR} or an equivalent platform-specific mechanism
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
  • *
  • {@code surface} must be a valid {@code VkSurfaceKHR} handle
  • *
  • {@code pSurfaceFormatCount} must be a valid pointer to a {@code uint32_t} value
  • *
  • If the value referenced by {@code pSurfaceFormatCount} is not 0, and {@code pSurfaceFormats} is not {@code NULL}, {@code pSurfaceFormats} must be a valid pointer to an array of {@code pSurfaceFormatCount} {@link VkSurfaceFormatKHR} structures
  • *
  • Both of {@code physicalDevice}, and {@code surface} must have been created, allocated, or retrieved from the same {@code VkInstance}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
  • {@link VK10#VK_INCOMPLETE INCOMPLETE}
  • *
*
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_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
  • *
*
* *
See Also
* *

{@link VkSurfaceFormatKHR}

* * @param physicalDevice the physical device that will be associated with the swapchain to be created, as described for {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}. * @param surface the surface that will be associated with the swapchain. * @param pSurfaceFormatCount a pointer to an integer related to the number of format pairs available or queried, as described below. * @param pSurfaceFormats either {@code NULL} or a pointer to an array of {@link VkSurfaceFormatKHR} structures. */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, @NativeType("VkSurfaceKHR") long surface, @NativeType("uint32_t *") IntBuffer pSurfaceFormatCount, @Nullable @NativeType("VkSurfaceFormatKHR *") VkSurfaceFormatKHR.Buffer pSurfaceFormats) { if (CHECKS) { check(pSurfaceFormatCount, 1); checkSafe(pSurfaceFormats, pSurfaceFormatCount.get(pSurfaceFormatCount.position())); } return nvkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, memAddress(pSurfaceFormatCount), memAddressSafe(pSurfaceFormats)); } // --- [ vkGetPhysicalDeviceSurfacePresentModesKHR ] --- /** * Unsafe version of: {@link #vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR} * * @param pPresentModeCount a pointer to an integer related to the number of presentation modes available or queried, as described below. */ public static int nvkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, long pPresentModeCount, long pPresentModes) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfacePresentModesKHR; if (CHECKS) { check(__functionAddress); } return callPJPPI(physicalDevice.address(), surface, pPresentModeCount, pPresentModes, __functionAddress); } /** * Query supported presentation modes. * *
C Specification
* *

To query the supported presentation modes for a surface, call:

* *

     * VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
     *     VkPhysicalDevice                            physicalDevice,
     *     VkSurfaceKHR                                surface,
     *     uint32_t*                                   pPresentModeCount,
     *     VkPresentModeKHR*                           pPresentModes);
* *
Description
* *

If {@code pPresentModes} is {@code NULL}, then the number of presentation modes supported for the given {@code surface} is returned in {@code pPresentModeCount}. Otherwise, {@code pPresentModeCount} must point to a variable set by the user to the number of elements in the {@code pPresentModes} array, and on return the variable is overwritten with the number of values actually written to {@code pPresentModes}. If the value of {@code pPresentModeCount} is less than the number of presentation modes supported, at most {@code pPresentModeCount} values will be written, and {@link VK10#VK_INCOMPLETE INCOMPLETE} will be returned instead of {@link VK10#VK_SUCCESS SUCCESS}, to indicate that not all the available modes were returned.

* *
Valid Usage
* *
    *
  • {@code surface} must be supported by {@code physicalDevice}, as reported by {@link #vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR} or an equivalent platform-specific mechanism
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
  • *
  • {@code surface} must be a valid {@code VkSurfaceKHR} handle
  • *
  • {@code pPresentModeCount} must be a valid pointer to a {@code uint32_t} value
  • *
  • If the value referenced by {@code pPresentModeCount} is not 0, and {@code pPresentModes} is not {@code NULL}, {@code pPresentModes} must be a valid pointer to an array of {@code pPresentModeCount} {@code VkPresentModeKHR} values
  • *
  • Both of {@code physicalDevice}, and {@code surface} must have been created, allocated, or retrieved from the same {@code VkInstance}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
  • {@link VK10#VK_INCOMPLETE INCOMPLETE}
  • *
*
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_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
  • *
*
* * @param physicalDevice the physical device that will be associated with the swapchain to be created, as described for {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}. * @param surface the surface that will be associated with the swapchain. * @param pPresentModeCount a pointer to an integer related to the number of presentation modes available or queried, as described below. * @param pPresentModes either {@code NULL} or a pointer to an array of {@code VkPresentModeKHR} values, indicating the supported presentation modes. */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, @NativeType("VkSurfaceKHR") long surface, @NativeType("uint32_t *") IntBuffer pPresentModeCount, @Nullable @NativeType("VkPresentModeKHR *") IntBuffer pPresentModes) { if (CHECKS) { check(pPresentModeCount, 1); checkSafe(pPresentModes, pPresentModeCount.get(pPresentModeCount.position())); } return nvkGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, memAddress(pPresentModeCount), memAddressSafe(pPresentModes)); } /** Array version of: {@link #vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR} */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, @NativeType("uint32_t") int queueFamilyIndex, @NativeType("VkSurfaceKHR") long surface, @NativeType("VkBool32 *") int[] pSupported) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceSupportKHR; if (CHECKS) { check(__functionAddress); check(pSupported, 1); } return callPJPI(physicalDevice.address(), queueFamilyIndex, surface, pSupported, __functionAddress); } /** Array version of: {@link #vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR} */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, @NativeType("VkSurfaceKHR") long surface, @NativeType("uint32_t *") int[] pSurfaceFormatCount, @Nullable @NativeType("VkSurfaceFormatKHR *") VkSurfaceFormatKHR.Buffer pSurfaceFormats) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceFormatsKHR; if (CHECKS) { check(__functionAddress); check(pSurfaceFormatCount, 1); checkSafe(pSurfaceFormats, pSurfaceFormatCount[0]); } return callPJPPI(physicalDevice.address(), surface, pSurfaceFormatCount, memAddressSafe(pSurfaceFormats), __functionAddress); } /** Array version of: {@link #vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR} */ @NativeType("VkResult") public static int vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, @NativeType("VkSurfaceKHR") long surface, @NativeType("uint32_t *") int[] pPresentModeCount, @Nullable @NativeType("VkPresentModeKHR *") int[] pPresentModes) { long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfacePresentModesKHR; if (CHECKS) { check(__functionAddress); check(pPresentModeCount, 1); checkSafe(pPresentModes, pPresentModeCount[0]); } return callPJPPI(physicalDevice.address(), surface, pPresentModeCount, pPresentModes, __functionAddress); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy