Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRBufferDeviceAddress

extends Object
Class Inheritance
Imports
org.lwjgl.system.*

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 PhysicalStorageBuffer storage class in the GL_EXT_buffer_reference GLSL extension and SPV_KHR_physical_storage_buffer SPIR-V extension.

Another way to describe this extension is that it adds “pointers to buffer memory in shaders”. By calling GetBufferDeviceAddress with a VkBuffer, it will return a VkDeviceAddress value which represents the address of the start of the buffer.

GetBufferOpaqueCaptureAddress and 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 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 GL_EXT_buffer_reference spec for how to use this in a high-level shading language such as GLSL. The GL_EXT_buffer_reference2 and 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 bufferDeviceAddress feature 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 bufferDeviceAddress feature 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
VK_KHR_get_physical_device_properties2      and      VK_KHR_device_group or Version 1.1
Deprecation state
Contact
Other Extension Metadata
Last Modified Date
2019-06-24
IP Status
No known IP claims.
Interactions and External Dependencies
Contributors
  • Jeff Bolz, NVIDIA
  • Neil Henning, AMD
  • Tobias Hector, AMD
  • Faith Ekstrand, Intel
  • Baldur Karlsson, Valve
  • Jan-Harald Fredriksen, Arm

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR

Extends VkBufferUsageFlagBits.

public static final int
public static final String
public static final int
VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION

The extension specification version.

public static final int
VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR

Extends VkMemoryAllocateFlagBits.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long
nvkGetBufferDeviceAddressKHR(VkDevice device, long pInfo)

Unsafe version of: GetBufferDeviceAddressKHR

public static long
public static long
public static long
vkGetBufferDeviceAddressKHR(VkDevice
the logical device that the buffer was created on.
device
,
VkBufferDeviceAddressInfo
a pointer to a VkBufferDeviceAddressInfo structure specifying the buffer to retrieve an address for.
pInfo
)

See GetBufferDeviceAddress.

public static long
vkGetBufferOpaqueCaptureAddressKHR(VkDevice
the logical device that the buffer was created on.
device
,
VkBufferDeviceAddressInfo
a pointer to a VkBufferDeviceAddressInfo structure specifying the buffer to retrieve an address for.
pInfo
)

See GetBufferOpaqueCaptureAddress.

public static long
vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice
the logical device that the memory object was allocated on.
device
,
VkDeviceMemoryOpaqueCaptureAddressInfo
a pointer to a VkDeviceMemoryOpaqueCaptureAddressInfo structure specifying the memory object to retrieve an address for.
pInfo
)

See GetDeviceMemoryOpaqueCaptureAddress.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHRback to summary
public static final int VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR

Extends VkBufferCreateFlagBits.

VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHRback to summary
public static final int VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR

Extends VkBufferUsageFlagBits.

VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHRback to summary
public static final int VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR

Extends VkResult.

VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAMEback to summary
public static final String VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME

The extension name.

VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSIONback to summary
public static final int VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION

The extension specification version.

VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHRback to summary
public static final int VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR

Extends VkMemoryAllocateFlagBits.

Enum values:
VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHRback to summary
public static final int VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR

Extends VkMemoryAllocateFlagBits.

Enum values:
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHRback to summary
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR

Extends VkStructureType.

Enum values:

Constructor Detail

KHRBufferDeviceAddressback to summary
protected KHRBufferDeviceAddress()

Method Detail

nvkGetBufferDeviceAddressKHRback to summary
public static long nvkGetBufferDeviceAddressKHR(VkDevice device, long pInfo)

Unsafe version of: GetBufferDeviceAddressKHR

nvkGetBufferOpaqueCaptureAddressKHRback to summary
public static long nvkGetBufferOpaqueCaptureAddressKHR(VkDevice device, long pInfo)

Unsafe version of: GetBufferOpaqueCaptureAddressKHR

nvkGetDeviceMemoryOpaqueCaptureAddressKHRback to summary
public static long nvkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, long pInfo)

Unsafe version of: GetDeviceMemoryOpaqueCaptureAddressKHR

vkGetBufferDeviceAddressKHRback to summary
public static long vkGetBufferDeviceAddressKHR(VkDevice device, VkBufferDeviceAddressInfo pInfo)

See GetBufferDeviceAddress.

Parameters
device:VkDevice

the logical device that the buffer was created on.

pInfo:VkBufferDeviceAddressInfo

a pointer to a VkBufferDeviceAddressInfo structure specifying the buffer to retrieve an address for.

Annotations
@NativeType:VkDeviceAddress
vkGetBufferOpaqueCaptureAddressKHRback to summary
public static long vkGetBufferOpaqueCaptureAddressKHR(VkDevice device, VkBufferDeviceAddressInfo pInfo)

See GetBufferOpaqueCaptureAddress.

Parameters
device:VkDevice

the logical device that the buffer was created on.

pInfo:VkBufferDeviceAddressInfo

a pointer to a VkBufferDeviceAddressInfo structure specifying the buffer to retrieve an address for.

Annotations
@NativeType:uint64_t
vkGetDeviceMemoryOpaqueCaptureAddressKHRback to summary
public static long vkGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, VkDeviceMemoryOpaqueCaptureAddressInfo pInfo)

See GetDeviceMemoryOpaqueCaptureAddress.

Parameters
device:VkDevice

the logical device that the memory object was allocated on.

pInfo:VkDeviceMemoryOpaqueCaptureAddressInfo

a pointer to a VkDeviceMemoryOpaqueCaptureAddressInfo structure specifying the memory object to retrieve an address for.

Annotations
@NativeType:uint64_t