Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRAccelerationStructure

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

In order to be efficient, rendering techniques such as ray tracing need a quick way to identify which primitives may be intersected by a ray traversing the geometries. Acceleration structures are the most common way to represent the geometry spatially sorted, in order to quickly identify such potential intersections.

This extension adds new functionalities:

VK_KHR_acceleration_structure
Name String
VK_KHR_acceleration_structure
Extension Type
Device extension
Registered Extension Number
151
Revision
13
Extension and Version Dependencies
Version 1.1 and VK_EXT_descriptor_indexing and VK_KHR_buffer_device_address and VK_KHR_deferred_host_operations
Contact
Other Extension Metadata
Last Modified Date
2021-09-30
Contributors
  • Samuel Bourasseau, Adobe
  • Matthäus Chajdas, AMD
  • Greg Grebe, AMD
  • Nicolai Hähnle, AMD
  • Tobias Hector, AMD
  • Dave Oldcorn, AMD
  • Skyler Saleh, AMD
  • Mathieu Robart, Arm
  • Marius Bjorge, Arm
  • Tom Olson, Arm
  • Sebastian Tafuri, EA
  • Henrik Rydgard, Embark
  • Juan Cañada, Epic Games
  • Patrick Kelly, Epic Games
  • Yuriy O’Donnell, Epic Games
  • Michael Doggett, Facebook/Oculus
  • Ricardo Garcia, Igalia
  • Andrew Garrard, Imagination
  • Don Scorgie, Imagination
  • Dae Kim, Imagination
  • Joshua Barczak, Intel
  • Slawek Grajewski, Intel
  • Jeff Bolz, NVIDIA
  • Pascal Gautron, NVIDIA
  • Daniel Koch, NVIDIA
  • Christoph Kubisch, NVIDIA
  • Ashwin Lele, NVIDIA
  • Robert Stepinski, NVIDIA
  • Martin Stich, NVIDIA
  • Nuno Subtil, NVIDIA
  • Eric Werness, NVIDIA
  • Jon Leech, Khronos
  • Jeroen van Schijndel, OTOY
  • Juul Joosten, OTOY
  • Alex Bourd, Qualcomm
  • Roman Larionov, Qualcomm
  • David McAllister, Qualcomm
  • Lewis Gordon, Samsung
  • Ralph Potter, Samsung
  • Jasper Bekkers, Traverse Research
  • Jesse Barker, Unity
  • Baldur Karlsson, Valve

Field Summary

Modifier and TypeField and Description
public static final int
VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR

VkAccelerationStructureBuildTypeKHR - Acceleration structure build type Description

public static final int
VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR

VkAccelerationStructureBuildTypeKHR - Acceleration structure build type Description

public static final int
VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR

VkAccelerationStructureBuildTypeKHR - Acceleration structure build type Description

public static final int
VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR

VkAccelerationStructureCompatibilityKHR - Acceleration structure compatibility Description

public static final int
VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR

VkAccelerationStructureCompatibilityKHR - Acceleration structure compatibility Description

public static final int
VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR

VkAccelerationStructureCreateFlagBitsKHR - Bitmask specifying additional creation parameters for acceleration structure Description

public static final int
VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR

VkAccelerationStructureTypeKHR - Type of acceleration structure Description

public static final int
VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR

VkAccelerationStructureTypeKHR - Type of acceleration structure Description

public static final int
VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR

VkAccelerationStructureTypeKHR - Type of acceleration structure Description

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

VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds Description

public static final int
VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR

VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds Description

public static final int
VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR

VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds Description

public static final int
VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR

VkBuildAccelerationStructureModeKHR - Enum specifying the type of build operation to perform Description

public static final int
VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR

VkBuildAccelerationStructureModeKHR - Enum specifying the type of build operation to perform Description

public static final int
VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR

VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds Description

public static final int
VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR

VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds Description

public static final int
VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR

VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode Description

public static final int
VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR

VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode Description

public static final int
VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR

VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode Description

public static final int
VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR

VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode Description

public static final int
public static final int
public static final long
public static final int
public static final int
VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR

VkGeometryInstanceFlagBitsKHR - Instance flag bits Description

public static final int
VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR

VkGeometryInstanceFlagBitsKHR - Instance flag bits Description

public static final int
VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR

VkGeometryInstanceFlagBitsKHR - Instance flag bits Description

public static final int
VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR

VkGeometryInstanceFlagBitsKHR - Instance flag bits Description

public static final int
VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR

VkGeometryInstanceFlagBitsKHR - Instance flag bits Description

public static final int
VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR

VkGeometryFlagBitsKHR - Bitmask specifying additional parameters for a geometry Description

  • GEOMETRY_OPAQUE_BIT_KHR indicates that this geometry does not invoke the any-hit shaders even if present in a hit group.
  • GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR indicates that the implementation must only call the any-hit shader a single time for each primitive in this geometry. If this bit is absent an implementation may invoke the any-hit shader more than once for this geometry.
public static final int
VK_GEOMETRY_OPAQUE_BIT_KHR

VkGeometryFlagBitsKHR - Bitmask specifying additional parameters for a geometry Description

  • GEOMETRY_OPAQUE_BIT_KHR indicates that this geometry does not invoke the any-hit shaders even if present in a hit group.
  • GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR indicates that the implementation must only call the any-hit shader a single time for each primitive in this geometry. If this bit is absent an implementation may invoke the any-hit shader more than once for this geometry.
public static final int
VK_GEOMETRY_TYPE_AABBS_KHR

VkGeometryTypeKHR - Enum specifying which type of geometry is provided Description

public static final int
VK_GEOMETRY_TYPE_INSTANCES_KHR

VkGeometryTypeKHR - Enum specifying which type of geometry is provided Description

public static final int
VK_GEOMETRY_TYPE_TRIANGLES_KHR

VkGeometryTypeKHR - Enum specifying which type of geometry is provided Description

public static final int
VK_INDEX_TYPE_NONE_KHR

Extends VkIndexType.

public static final String
public static final int
VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION

The extension specification version.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
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 int
nvkBuildAccelerationStructuresKHR(VkDevice device, long deferredOperation, int
the number of acceleration structures to build. It specifies the number of the pInfos structures and ppBuildRangeInfos pointers that must be provided.
infoCount
,
long pInfos, long ppBuildRangeInfos)

Unsafe version of: BuildAccelerationStructuresKHR

public static void
nvkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, int
the number of acceleration structures to build.
infoCount
,
long pInfos, long pIndirectDeviceAddresses, long pIndirectStrides, long ppMaxPrimitiveCounts)

Unsafe version of: CmdBuildAccelerationStructuresIndirectKHR

public static void
nvkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, int
the number of acceleration structures to build. It specifies the number of the pInfos structures and ppBuildRangeInfos pointers that must be provided.
infoCount
,
long pInfos, long ppBuildRangeInfos)

Unsafe version of: CmdBuildAccelerationStructuresKHR

public static void
public static void
public static void
public static void
nvkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, int
the count of acceleration structures for which to query the property.
accelerationStructureCount
,
long pAccelerationStructures, int queryType, long queryPool, int firstQuery)

Unsafe version of: CmdWriteAccelerationStructuresPropertiesKHR

public static int
nvkCopyAccelerationStructureKHR(VkDevice device, long deferredOperation, long pInfo)

Unsafe version of: CopyAccelerationStructureKHR

public static int
nvkCopyAccelerationStructureToMemoryKHR(VkDevice device, long deferredOperation, long pInfo)

Unsafe version of: CopyAccelerationStructureToMemoryKHR

public static int
nvkCopyMemoryToAccelerationStructureKHR(VkDevice device, long deferredOperation, long pInfo)

Unsafe version of: CopyMemoryToAccelerationStructureKHR

public static int
nvkCreateAccelerationStructureKHR(VkDevice device, long pCreateInfo, long pAllocator, long pAccelerationStructure)

Unsafe version of: CreateAccelerationStructureKHR

public static void
nvkDestroyAccelerationStructureKHR(VkDevice device, long accelerationStructure, long pAllocator)

Unsafe version of: DestroyAccelerationStructureKHR

public static void
nvkGetAccelerationStructureBuildSizesKHR(VkDevice device, int buildType, long pBuildInfo, long pMaxPrimitiveCounts, long pSizeInfo)

Unsafe version of: GetAccelerationStructureBuildSizesKHR

public static long
public static void
nvkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, long pVersionInfo, long pCompatibility)

Unsafe version of: GetDeviceAccelerationStructureCompatibilityKHR

public static int
nvkWriteAccelerationStructuresPropertiesKHR(VkDevice device, int
the count of acceleration structures for which to query the property.
accelerationStructureCount
,
long pAccelerationStructures, int queryType, long
the size in bytes of the buffer pointed to by pData.
dataSize
,
long pData, long stride)

Unsafe version of: WriteAccelerationStructuresPropertiesKHR

public static int
vkBuildAccelerationStructuresKHR(VkDevice
the VkDevice for which the acceleration structures are being built.
device
,
long
an optional VkDeferredOperationKHR to request deferral for this command.
deferredOperation
,
VkAccelerationStructureBuildGeometryInfoKHR.Buffer
a pointer to an array of infoCount VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure.
pInfos
,
PointerBuffer
a pointer to an array of infoCount pointers to arrays of VkAccelerationStructureBuildRangeInfoKHR structures. Each ppBuildRangeInfos[i] is a pointer to an array of pInfos[i].geometryCount VkAccelerationStructureBuildRangeInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined by pInfos[i].
ppBuildRangeInfos
)

Build an acceleration structure on the host.

public static void
vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
VkAccelerationStructureBuildGeometryInfoKHR.Buffer
a pointer to an array of infoCount VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure.
pInfos
,
LongBuffer
a pointer to an array of infoCount buffer device addresses which point to pInfos[i].geometryCount VkAccelerationStructureBuildRangeInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined by pInfos[i].
pIndirectDeviceAddresses
,
IntBuffer
a pointer to an array of infoCount byte strides between elements of pIndirectDeviceAddresses.
pIndirectStrides
,
PointerBuffer
a pointer to an array of infoCount pointers to arrays of pInfos[i].geometryCount values indicating the maximum number of primitives that will be built by this command for each geometry.
ppMaxPrimitiveCounts
)

Build an acceleration structure with some parameters provided on the device.

public static void
vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, VkAccelerationStructureBuildGeometryInfoKHR.Buffer pInfos, long[] pIndirectDeviceAddresses, int[] pIndirectStrides, PointerBuffer ppMaxPrimitiveCounts)

Array version of: CmdBuildAccelerationStructuresIndirectKHR

public static void
vkCmdBuildAccelerationStructuresKHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
VkAccelerationStructureBuildGeometryInfoKHR.Buffer
a pointer to an array of infoCount VkAccelerationStructureBuildGeometryInfoKHR structures defining the geometry used to build each acceleration structure.
pInfos
,
PointerBuffer
a pointer to an array of infoCount pointers to arrays of VkAccelerationStructureBuildRangeInfoKHR structures. Each ppBuildRangeInfos[i] is a pointer to an array of pInfos[i].geometryCount VkAccelerationStructureBuildRangeInfoKHR structures defining dynamic offsets to the addresses where geometry data is stored, as defined by pInfos[i].
ppBuildRangeInfos
)

Build an acceleration structure.

public static void
vkCmdCopyAccelerationStructureKHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
VkCopyAccelerationStructureInfoKHR
a pointer to a VkCopyAccelerationStructureInfoKHR structure defining the copy operation.
pInfo
)

Copy an acceleration structure.

public static void
vkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
VkCopyAccelerationStructureToMemoryInfoKHR
an a pointer to a VkCopyAccelerationStructureToMemoryInfoKHR structure defining the copy operation.
pInfo
)

Copy an acceleration structure to device memory.

public static void
vkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
VkCopyMemoryToAccelerationStructureInfoKHR
a pointer to a VkCopyMemoryToAccelerationStructureInfoKHR structure defining the copy operation.
pInfo
)

Copy device memory to an acceleration structure.

public static void
vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer
the command buffer into which the command will be recorded.
commandBuffer
,
LongBuffer
a pointer to an array of existing previously built acceleration structures.
pAccelerationStructures
,
int
a VkQueryType value specifying the type of queries managed by the pool.
queryType
,
long
the query pool that will manage the results of the query.
queryPool
,
int
the first query index within the query pool that will contain the accelerationStructureCount number of results.
firstQuery
)

Write acceleration structure result parameters to query results.

public static void
vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, long[] pAccelerationStructures, int queryType, long queryPool, int firstQuery)

Array version of: CmdWriteAccelerationStructuresPropertiesKHR

public static int
vkCopyAccelerationStructureKHR(VkDevice
the device which owns the acceleration structures.
device
,
long
an optional VkDeferredOperationKHR to request deferral for this command.
deferredOperation
,
VkCopyAccelerationStructureInfoKHR
a pointer to a VkCopyAccelerationStructureInfoKHR structure defining the copy operation.
pInfo
)

Copy an acceleration structure on the host.

public static int
vkCopyAccelerationStructureToMemoryKHR(VkDevice
the device which owns pInfo→src.
device
,
long
an optional VkDeferredOperationKHR to request deferral for this command.
deferredOperation
,
VkCopyAccelerationStructureToMemoryInfoKHR
a pointer to a VkCopyAccelerationStructureToMemoryInfoKHR structure defining the copy operation.
pInfo
)

Serialize an acceleration structure on the host.

public static int
vkCopyMemoryToAccelerationStructureKHR(VkDevice
the device which owns pInfo→dst.
device
,
long
an optional VkDeferredOperationKHR to request deferral for this command.
deferredOperation
,
VkCopyMemoryToAccelerationStructureInfoKHR
a pointer to a VkCopyMemoryToAccelerationStructureInfoKHR structure defining the copy operation.
pInfo
)

Deserialize an acceleration structure on the host.

public static int
vkCreateAccelerationStructureKHR(VkDevice
the logical device that creates the acceleration structure object.
device
,
VkAccelerationStructureCreateInfoKHR
a pointer to a VkAccelerationStructureCreateInfoKHR structure containing parameters affecting creation of the acceleration structure.
pCreateInfo
,
VkAllocationCallbacks
controls host memory allocation as described in the Memory Allocation chapter.
pAllocator
,
LongBuffer
a pointer to a VkAccelerationStructureKHR handle in which the resulting acceleration structure object is returned.
pAccelerationStructure
)

Create a new acceleration structure object.

public static int
vkCreateAccelerationStructureKHR(VkDevice device, VkAccelerationStructureCreateInfoKHR pCreateInfo, VkAllocationCallbacks pAllocator, long[] pAccelerationStructure)

Array version of: CreateAccelerationStructureKHR

public static void
vkDestroyAccelerationStructureKHR(VkDevice
the logical device that destroys the acceleration structure.
device
,
long
the acceleration structure to destroy.
accelerationStructure
,
VkAllocationCallbacks
controls host memory allocation as described in the Memory Allocation chapter.
pAllocator
)

Destroy an acceleration structure object.

public static void
vkGetAccelerationStructureBuildSizesKHR(VkDevice
the logical device that will be used for creating the acceleration structure.
device
,
int
defines whether host or device operations (or both) are being queried for.
buildType
,
VkAccelerationStructureBuildGeometryInfoKHR
a pointer to a VkAccelerationStructureBuildGeometryInfoKHR structure describing parameters of a build operation.
pBuildInfo
,
IntBuffer
a pointer to an array of pBuildInfo→geometryCount uint32_t values defining the number of primitives built into each geometry.
pMaxPrimitiveCounts
,
VkAccelerationStructureBuildSizesInfoKHR
a pointer to a VkAccelerationStructureBuildSizesInfoKHR structure which returns the size required for an acceleration structure and the sizes required for the scratch buffers, given the build parameters.
pSizeInfo
)

Retrieve the required size for an acceleration structure.

public static void
public static long
vkGetAccelerationStructureDeviceAddressKHR(VkDevice
the logical device that the acceleration structure was created on.
device
,
VkAccelerationStructureDeviceAddressInfoKHR
a pointer to a VkAccelerationStructureDeviceAddressInfoKHR structure specifying the acceleration structure to retrieve an address for.
pInfo
)

Query an address of a acceleration structure.

public static void
vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice
the device to check the version against.
device
,
VkAccelerationStructureVersionInfoKHR
a pointer to a VkAccelerationStructureVersionInfoKHR structure specifying version information to check against the device.
pVersionInfo
,
IntBuffer
a pointer to a VkAccelerationStructureCompatibilityKHR value in which compatibility information is returned.
pCompatibility
)

Check if a serialized acceleration structure is compatible with the current device.

public static void
public static int
vkWriteAccelerationStructuresPropertiesKHR(VkDevice
the device which owns the acceleration structures in pAccelerationStructures.
device
,
LongBuffer
a pointer to an array of existing previously built acceleration structures.
pAccelerationStructures
,
int
a VkQueryType value specifying the property to be queried.
queryType
,
ByteBuffer
a pointer to a user-allocated buffer where the results will be written.
pData
,
long
the stride in bytes between results for individual queries within pData.
stride
)

Query acceleration structure meta-data on the host.

public static int
vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, long[] pAccelerationStructures, int queryType, ByteBuffer pData, long stride)

Array version of: WriteAccelerationStructuresPropertiesKHR

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait