C Specification
The VkAccelerationStructureCreateInfoKHR
structure is defined as:
// Provided by VK_KHR_acceleration_structure
typedef struct VkAccelerationStructureCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkAccelerationStructureCreateFlagsKHR createFlags;
VkBuffer buffer;
VkDeviceSize offset;
VkDeviceSize size;
VkAccelerationStructureTypeKHR type;
VkDeviceAddress deviceAddress;
} VkAccelerationStructureCreateInfoKHR;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
createFlags
is a bitmask of VkAccelerationStructureCreateFlagBitsKHR specifying additional creation parameters of the acceleration structure. -
buffer
is the buffer on which the acceleration structure will be stored. -
offset
is an offset in bytes from the base address of the buffer at which the acceleration structure will be stored, and must be a multiple of256
. -
size
is the size required for the acceleration structure. -
type
is a VkAccelerationStructureTypeKHR value specifying the type of acceleration structure that will be created. -
deviceAddress
is the device address requested for the acceleration structure if theaccelerationStructureCaptureReplay
feature is being used.
Description
If deviceAddress
is zero, no specific address is requested.
If deviceAddress
is not zero, deviceAddress
must be an address
retrieved from an identically created acceleration structure on the same
implementation.
The acceleration structure must also be placed on an identically created
buffer
and at the same offset
.
Applications should avoid creating acceleration structures with
application-provided addresses and implementation-provided addresses in the
same process, to reduce the likelihood of
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR
errors.
Note
The expected usage for this is that a trace capture/replay tool will add the
Implementations are expected to separate such buffers in the GPU address
space so normal allocations will avoid using these addresses.
Apps/tools should avoid mixing app-provided and implementation-provided
addresses for buffers created with
|
Applications should create an acceleration structure with a specific
VkAccelerationStructureTypeKHR other than
VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR
.
Note
|
If the acceleration structure will be the target of a build operation, the required size for an acceleration structure can be queried with vkGetAccelerationStructureBuildSizesKHR. If the acceleration structure is going to be the target of a compacting copy, vkCmdWriteAccelerationStructuresPropertiesKHR or vkWriteAccelerationStructuresPropertiesKHR can be used to obtain the compacted size required.
If the acceleration structure will be the target of a build operation with
VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV
it must include
VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV
in flags
and
include VkAccelerationStructureMotionInfoNV as an extension structure
in pNext
with the number of instances as metadata for the object.
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.