Class KHRBufferDeviceAddress
- java.lang.Object
-
- org.lwjgl.vulkan.KHRBufferDeviceAddress
-
public class KHRBufferDeviceAddress extends java.lang.ObjectThis 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 thePhysicalStorageBufferstorage class in theGL_EXT_buffer_referenceGLSL extension andSPV_KHR_physical_storage_bufferSPIR-V extension.Another way to describe this extension is that it adds “
pointers to buffer memory in shaders”. By callingGetBufferDeviceAddresswith aVkBuffer, it will return aVkDeviceAddressvalue which represents the address of the start of the buffer.GetBufferOpaqueCaptureAddressandGetDeviceMemoryOpaqueCaptureAddressallow 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 thePhysicalStorageBufferstorage 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
GL_EXT_buffer_referencespec for how to use this in a high-level shading language such as GLSL. TheGL_EXT_buffer_reference2andGL_EXT_buffer_reference_uvec2extensions 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
bufferDeviceAddressfeature is optional. The original type, enum and command names are still available as aliases of the core functionality.Promotion to Vulkan 1.3
Support for the
bufferDeviceAddressfeature is mandatory in Vulkan 1.3, regardless of whether this extension is supported.VK_KHR_buffer_device_address
- Name String
VK_KHR_buffer_device_address- Extension Type
- Device extension
- Registered Extension Number
- 258
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
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
SPV_KHR_physical_storage_buffer - This extension provides API support for
GL_EXT_buffer_referenceandGL_EXT_buffer_reference2andGL_EXT_buffer_reference_uvec2
- Contributors
- Jeff Bolz, NVIDIA
- Neil Henning, AMD
- Tobias Hector, AMD
- Jason Ekstrand, Intel
- Baldur Karlsson, Valve
- Jan-Harald Fredriksen, Arm
-
-
Field Summary
Fields Modifier and Type Field Description static intVK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHRExtendsVkBufferCreateFlagBits.static intVK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHRExtendsVkBufferUsageFlagBits.static intVK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHRExtendsVkResult.static java.lang.StringVK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAMEThe extension name.static intVK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSIONThe extension specification version.static intVK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR
VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHRExtendsVkMemoryAllocateFlagBits.static intVK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR
VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR
VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR
VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHRExtendsVkStructureType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longnvkGetBufferDeviceAddressKHR(org.lwjgl.vulkan.VkDevice device, long pInfo)Unsafe version of:GetBufferDeviceAddressKHRstatic longnvkGetBufferOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, long pInfo)Unsafe version of:GetBufferOpaqueCaptureAddressKHRstatic longnvkGetDeviceMemoryOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, long pInfo)Unsafe version of:GetDeviceMemoryOpaqueCaptureAddressKHRstatic longvkGetBufferDeviceAddressKHR(org.lwjgl.vulkan.VkDevice device, VkBufferDeviceAddressInfo pInfo)static longvkGetBufferOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, VkBufferDeviceAddressInfo pInfo)static longvkGetDeviceMemoryOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, VkDeviceMemoryOpaqueCaptureAddressInfo pInfo)
-
-
-
Field Detail
-
VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION
The extension specification version.
-
VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME
The extension name.
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR, VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR, VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR
ExtendsVkStructureType.Enum values:
-
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR
ExtendsVkBufferUsageFlagBits.
-
VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR
ExtendsVkBufferCreateFlagBits.
-
VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR, VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR
ExtendsVkMemoryAllocateFlagBits.Enum values:
-
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR
ExtendsVkResult.
-
-
Method Detail
-
nvkGetBufferDeviceAddressKHR
public static long nvkGetBufferDeviceAddressKHR(org.lwjgl.vulkan.VkDevice device, long pInfo)Unsafe version of:GetBufferDeviceAddressKHR
-
vkGetBufferDeviceAddressKHR
public static long vkGetBufferDeviceAddressKHR(org.lwjgl.vulkan.VkDevice device, VkBufferDeviceAddressInfo pInfo)- Parameters:
device- the logical device that the buffer was created on.pInfo- a pointer to aVkBufferDeviceAddressInfostructure specifying the buffer to retrieve an address for.
-
nvkGetBufferOpaqueCaptureAddressKHR
public static long nvkGetBufferOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, long pInfo)Unsafe version of:GetBufferOpaqueCaptureAddressKHR
-
vkGetBufferOpaqueCaptureAddressKHR
public static long vkGetBufferOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, VkBufferDeviceAddressInfo pInfo)- Parameters:
device- the logical device that the buffer was created on.pInfo- a pointer to aVkBufferDeviceAddressInfostructure specifying the buffer to retrieve an address for.
-
nvkGetDeviceMemoryOpaqueCaptureAddressKHR
public static long nvkGetDeviceMemoryOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, long pInfo)Unsafe version of:GetDeviceMemoryOpaqueCaptureAddressKHR
-
vkGetDeviceMemoryOpaqueCaptureAddressKHR
public static long vkGetDeviceMemoryOpaqueCaptureAddressKHR(org.lwjgl.vulkan.VkDevice device, VkDeviceMemoryOpaqueCaptureAddressInfo pInfo)- Parameters:
device- the logical device that the memory object was allocated on.pInfo- a pointer to aVkDeviceMemoryOpaqueCaptureAddressInfostructure specifying the memory object to retrieve an address for.
-
-