org.lwjgl.vulkan.KHRGetSurfaceCapabilities2 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 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 new entry points to query device surface capabilities in a way that can be easily extended by other extensions, without introducing any further entry points. This extension can be considered the VK_KHR_surface equivalent of the VK_KHR_get_physical_device_properties2 extension.
*
*
* - Name String
* - {@code VK_KHR_get_surface_capabilities2}
* - Extension Type
* - Instance extension
* - Registered Extension Number
* - 120
* - Revision
* - 1
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@code VK_KHR_surface}
*
* - Contact
*
* - James Jones @cubanismo
*
* - Last Modified Date
* - 2017-02-27
* - IP Status
* - No known IP claims.
* - Contributors
*
* - Ian Elliott, Google
* - James Jones, NVIDIA
* - Alon Or-bach, Samsung
*
*
*/
public class KHRGetSurfaceCapabilities2 {
/** The extension specification version. */
public static final int VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME = "VK_KHR_get_surface_capabilities2";
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR}
* - {@link #VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR}
* - {@link #VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR}
*
*/
public static final int
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000,
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001,
VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002;
protected KHRGetSurfaceCapabilities2() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(VKCapabilitiesInstance caps) {
return checkFunctions(
caps.vkGetPhysicalDeviceSurfaceCapabilities2KHR, caps.vkGetPhysicalDeviceSurfaceFormats2KHR
);
}
// --- [ vkGetPhysicalDeviceSurfaceCapabilities2KHR ] ---
/** Unsafe version of: {@link #vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR} */
public static int nvkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, long pSurfaceInfo, long pSurfaceCapabilities) {
long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceCapabilities2KHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPPI(__functionAddress, physicalDevice.address(), pSurfaceInfo, pSurfaceCapabilities);
}
/**
* Reports capabilities of a surface on a physical device.
*
* C Specification
*
* To query the basic capabilities of a surface defined by the core or extensions, call:
*
*
* VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR(
* VkPhysicalDevice physicalDevice,
* const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
* VkSurfaceCapabilities2KHR* pSurfaceCapabilities);
*
* Description
*
* {@link #vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR} behaves similarly to {@link KHRSurface#vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR}, with the ability to specify extended inputs via chained input structures, and to return extended information via chained output structures.
*
* Valid Usage (Implicit)
*
*
* - {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
* - {@code pSurfaceInfo} must be a pointer to a valid {@link VkPhysicalDeviceSurfaceInfo2KHR} structure
* - {@code pSurfaceCapabilities} must be a pointer to a {@link VkSurfaceCapabilities2KHR} structure
*
*
* 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 KHRSurface#VK_ERROR_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
*
*
*
* See Also
*
* {@link VkPhysicalDeviceSurfaceInfo2KHR}, {@link VkSurfaceCapabilities2KHR}
*
* @param physicalDevice the physical device that will be associated with the swapchain to be created, as described for {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}.
* @param pSurfaceInfo points to an instance of the {@link VkPhysicalDeviceSurfaceInfo2KHR} structure, describing the surface and other fixed parameters that would be consumed by {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}.
* @param pSurfaceCapabilities points to an instance of the {@link VkSurfaceCapabilities2KHR} structure in which the capabilities are returned.
*/
@NativeType("VkResult")
public static int vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, @NativeType("const VkPhysicalDeviceSurfaceInfo2KHR *") VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo, @NativeType("VkSurfaceCapabilities2KHR *") VkSurfaceCapabilities2KHR pSurfaceCapabilities) {
return nvkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo.address(), pSurfaceCapabilities.address());
}
// --- [ vkGetPhysicalDeviceSurfaceFormats2KHR ] ---
/**
* Unsafe version of: {@link #vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR}
*
* @param pSurfaceFormatCount a pointer to an integer related to the number of format tuples available or queried, as described below.
*/
public static int nvkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, long pSurfaceInfo, long pSurfaceFormatCount, long pSurfaceFormats) {
long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceFormats2KHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPPPI(__functionAddress, physicalDevice.address(), pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
}
/**
* Query color formats supported by surface.
*
* C Specification
*
* To query the supported swapchain format tuples for a surface, call:
*
*
* VkResult vkGetPhysicalDeviceSurfaceFormats2KHR(
* VkPhysicalDevice physicalDevice,
* const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
* uint32_t* pSurfaceFormatCount,
* VkSurfaceFormat2KHR* pSurfaceFormats);
*
* Description
*
* If {@code pSurfaceFormats} is {@code NULL}, then the number of format tuples supported for the given {@code surface} is returned in {@code pSurfaceFormatCount}. The number of format tuples supported will be greater than or equal to 1. 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 tuples supported, at most {@code pSurfaceFormatCount} structures will be written. If {@code pSurfaceFormatCount} is smaller than the number of format tuples supported for the surface parameters described in {@code pSurfaceInfo}, {@link VK10#VK_INCOMPLETE INCOMPLETE} will be returned instead of {@link VK10#VK_SUCCESS SUCCESS} to indicate that not all the available values were returned.
*
* Valid Usage (Implicit)
*
*
* - {@code physicalDevice} must be a valid {@code VkPhysicalDevice} handle
* - {@code pSurfaceInfo} must be a pointer to a valid {@link VkPhysicalDeviceSurfaceInfo2KHR} structure
* - {@code pSurfaceFormatCount} must be a 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 pointer to an array of {@code pSurfaceFormatCount} {@link VkSurfaceFormat2KHR} structures
*
*
* 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 KHRSurface#VK_ERROR_SURFACE_LOST_KHR ERROR_SURFACE_LOST_KHR}
*
*
*
* See Also
*
* {@link VkPhysicalDeviceSurfaceInfo2KHR}, {@link VkSurfaceFormat2KHR}
*
* @param physicalDevice the physical device that will be associated with the swapchain to be created, as described for {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}.
* @param pSurfaceInfo points to an instance of the {@link VkPhysicalDeviceSurfaceInfo2KHR} structure, describing the surface and other fixed parameters that would be consumed by {@link KHRSwapchain#vkCreateSwapchainKHR CreateSwapchainKHR}.
* @param pSurfaceFormatCount a pointer to an integer related to the number of format tuples available or queried, as described below.
* @param pSurfaceFormats either {@code NULL} or a pointer to an array of {@link VkSurfaceFormat2KHR} structures.
*/
@NativeType("VkResult")
public static int vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, @NativeType("const VkPhysicalDeviceSurfaceInfo2KHR *") VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo, @NativeType("uint32_t *") IntBuffer pSurfaceFormatCount, @NativeType("VkSurfaceFormat2KHR *") VkSurfaceFormat2KHR.Buffer pSurfaceFormats) {
if (CHECKS) {
check(pSurfaceFormatCount, 1);
checkSafe(pSurfaceFormats, pSurfaceFormatCount.get(pSurfaceFormatCount.position()));
}
return nvkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo.address(), memAddress(pSurfaceFormatCount), memAddressSafe(pSurfaceFormats));
}
/** Array version of: {@link #vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR} */
@NativeType("VkResult")
public static int vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, @NativeType("const VkPhysicalDeviceSurfaceInfo2KHR *") VkPhysicalDeviceSurfaceInfo2KHR pSurfaceInfo, @NativeType("uint32_t *") int[] pSurfaceFormatCount, @NativeType("VkSurfaceFormat2KHR *") VkSurfaceFormat2KHR.Buffer pSurfaceFormats) {
long __functionAddress = physicalDevice.getCapabilities().vkGetPhysicalDeviceSurfaceFormats2KHR;
if (CHECKS) {
check(__functionAddress);
check(pSurfaceFormatCount, 1);
checkSafe(pSurfaceFormats, pSurfaceFormatCount[0]);
}
return callPPPPI(__functionAddress, physicalDevice.address(), pSurfaceInfo.address(), pSurfaceFormatCount, memAddressSafe(pSurfaceFormats));
}
}