org.lwjgl.vulkan.KHRBufferDeviceAddress 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 org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
/**
* This extension allows the application to query a 64-bit buffer device address value for a buffer, which can be used to access the buffer memory via the {@code PhysicalStorageBuffer} storage class in the {@code GL_EXT_buffer_reference} GLSL extension and {@code SPV_KHR_physical_storage_buffer} SPIR-V extension.
*
* Another way to describe this extension is that it adds “{@code pointers to buffer memory in shaders}”. By calling {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress} with a {@code VkBuffer}, it will return a {@code VkDeviceAddress} value which represents the address of the start of the buffer.
*
* {@link VK12#vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress} and {@link VK12#vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress} allow opaque addresses for buffers and memory objects to be queried for the current process. A trace capture and replay tool can then supply these addresses to be used at replay time to match the addresses used when the trace was captured. To enable tools to insert these queries, new memory allocation flags must be specified for memory objects that will be bound to buffers accessed via the {@code PhysicalStorageBuffer} storage class. Note that this mechanism is intended only to support capture/replay tools, and is not recommended for use in other applications.
*
* There are various use cases this extension is designed for. It is required for ray tracing, useful for DX12 portability, and by allowing buffer addresses to be stored in memory it enables more complex data structures to be created.
*
* This extension can also be used to hardcode a dedicated debug channel into all shaders by querying a pointer at startup and pushing that into shaders as a run-time constant (e.g. specialization constant) that avoids impacting other descriptor limits.
*
* There are examples of usage in the {@code GL_EXT_buffer_reference} spec for how to use this in a high-level shading language such as GLSL. The {@code GL_EXT_buffer_reference2} and {@code GL_EXT_buffer_reference_uvec2} extensions were also added to help cover a few additional edge cases.
*
* Promotion to Vulkan 1.2
*
* All functionality in this extension is included in core Vulkan 1.2, with the KHR suffix omitted. However, if Vulkan 1.2 is supported and this extension is not, the {@code bufferDeviceAddress} capability is optional. The original type, enum and command names are still available as aliases of the core functionality.
*
* VK_KHR_buffer_device_address
*
*
* - Name String
* - {@code VK_KHR_buffer_device_address}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 258
* - Revision
* - 1
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@link KHRGetPhysicalDeviceProperties2 VK_KHR_get_physical_device_properties2}
*
* - Deprecation state
*
* - Promoted to Vulkan 1.2
*
* - Contact
*
* - Jeff Bolz jeffbolznv
*
*
*
* Other Extension Metadata
*
*
* - Last Modified Date
* - 2019-06-24
* - IP Status
* - No known IP claims.
* - Interactions and External Dependencies
*
* - Promoted to Vulkan 1.2 Core
* - This extension requires {@code SPV_KHR_physical_storage_buffer}
* - This extension provides API support for {@code GL_EXT_buffer_reference} and {@code GL_EXT_buffer_reference2} and {@code GL_EXT_buffer_reference_uvec2}
*
* - Contributors
*
* - Jeff Bolz, NVIDIA
* - Neil Henning, AMD
* - Tobias Hector, AMD
* - Jason Ekstrand, Intel
* - Baldur Karlsson, Valve
* - Jan-Harald Fredriksen, Arm
*
*
*/
public class KHRBufferDeviceAddress {
/** The extension specification version. */
public static final int VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME = "VK_KHR_buffer_device_address";
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR}
* - {@link #VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR}
*
*/
public static final int
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR = 1000257000,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR = 1000244001,
VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR = 1000257002,
VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR = 1000257003,
VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR = 1000257004;
/** Extends {@code VkBufferUsageFlagBits}. */
public static final int VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR = 0x20000;
/** Extends {@code VkBufferCreateFlagBits}. */
public static final int VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x10;
/**
* Extends {@code VkMemoryAllocateFlagBits}.
*
* Enum values:
*
*
* - {@link #VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR}
* - {@link #VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR}
*
*/
public static final int
VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR = 0x2,
VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x4;
/** Extends {@code VkResult}. */
public static final int VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR = -1000257000;
protected KHRBufferDeviceAddress() {
throw new UnsupportedOperationException();
}
// --- [ vkGetBufferDeviceAddressKHR ] ---
/** Unsafe version of: {@link #vkGetBufferDeviceAddressKHR GetBufferDeviceAddressKHR} */
public static long nvkGetBufferDeviceAddressKHR(VkDevice device, long pInfo) {
long __functionAddress = device.getCapabilities().vkGetBufferDeviceAddressKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPJ(device.address(), pInfo, __functionAddress);
}
/**
* See {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}.
*
* @param device the logical device that the buffer was created on.
* @param pInfo a pointer to a {@link VkBufferDeviceAddressInfo} structure specifying the buffer to retrieve an address for.
*/
@NativeType("VkDeviceAddress")
public static long vkGetBufferDeviceAddressKHR(VkDevice device, @NativeType("VkBufferDeviceAddressInfo const *") VkBufferDeviceAddressInfo pInfo) {
return nvkGetBufferDeviceAddressKHR(device, pInfo.address());
}
// --- [ vkGetBufferOpaqueCaptureAddressKHR ] ---
/** Unsafe version of: {@link #vkGetBufferOpaqueCaptureAddressKHR GetBufferOpaqueCaptureAddressKHR} */
public static long nvkGetBufferOpaqueCaptureAddressKHR(VkDevice device, long pInfo) {
long __functionAddress = device.getCapabilities().vkGetBufferOpaqueCaptureAddressKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPJ(device.address(), pInfo, __functionAddress);
}
/**
* See {@link VK12#vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress}.
*
* @param device the logical device that the buffer was created on.
* @param pInfo a pointer to a {@link VkBufferDeviceAddressInfo} structure specifying the buffer to retrieve an address for.
*/
@NativeType("uint64_t")
public static long vkGetBufferOpaqueCaptureAddressKHR(VkDevice device, @NativeType("VkBufferDeviceAddressInfo const *") VkBufferDeviceAddressInfo pInfo) {
return nvkGetBufferOpaqueCaptureAddressKHR(device, pInfo.address());
}
// --- [ vkGetDeviceMemoryOpaqueCaptureAddressKHR ] ---
/** Unsafe version of: {@link #vkGetDeviceMemoryOpaqueCaptureAddressKHR GetDeviceMemoryOpaqueCaptureAddressKHR} */
public static long nvkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, long pInfo) {
long __functionAddress = device.getCapabilities().vkGetDeviceMemoryOpaqueCaptureAddressKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPJ(device.address(), pInfo, __functionAddress);
}
/**
* See {@link VK12#vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress}.
*
* @param device the logical device that the memory object was allocated on.
* @param pInfo a pointer to a {@link VkDeviceMemoryOpaqueCaptureAddressInfo} structure specifying the memory object to retrieve an address for.
*/
@NativeType("uint64_t")
public static long vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, @NativeType("VkDeviceMemoryOpaqueCaptureAddressInfo const *") VkDeviceMemoryOpaqueCaptureAddressInfo pInfo) {
return nvkGetDeviceMemoryOpaqueCaptureAddressKHR(device, pInfo.address());
}
}