vkCreateAccelerationStructure2KHR
To create an acceleration structure using a device address, call:
VkResult vkCreateAccelerationStructure2KHR(
VkDevice device,
const VkAccelerationStructureCreateInfo2KHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkAccelerationStructureKHR* pAccelerationStructure);
pub fn create_acceleration_structure2_khr(
device: vk::Device,
p_create_info: *const vk::AccelerationStructureCreateInfo2KHR,
p_allocator: *const vk::AllocationCallbacks,
p_acceleration_structure: *mut vk::AccelerationStructureKHR,
) -> vk::Result;
deviceis the logical device that creates the acceleration structure object.pCreateInfois a pointer to a VkAccelerationStructureCreateInfo2KHR structure containing parameters affecting creation of the acceleration structure.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pAccelerationStructureis a pointer to aVkAccelerationStructureKHRhandle in which the resulting acceleration structure object is returned.
Similar to other objects in Vulkan, the acceleration structure creation
merely creates an object with a specific shape.
The type and quantity of geometry that can be built into an acceleration
structure is determined by the parameters of
VkAccelerationStructureCreateInfo2KHR.
The acceleration structure data is stored in the object referred to by
VkAccelerationStructureCreateInfo2KHR::addressRange.address.
Once the VkAccelerationStructureKHR object has been created, it must
be populated by acceleration structure build or acceleration structure copy
commands such as vkCmdBuildAccelerationStructuresKHR and
vkCmdCopyAccelerationStructureKHR.
Acceleration structures created with this command must not be used by host
commands.
mode of
VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR, and
vkCmdCopyMemoryToAccelerationStructureKHR with a mode of
VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR during replay.Valid Usage
VUID-vkCreateAccelerationStructure2KHR-accelerationStructure-03611
The VkPhysicalDeviceAccelerationStructureFeaturesKHR::accelerationStructure
feature must be enabled
VUID-vkCreateAccelerationStructure2KHR-device-03489
If device was created with multiple physical devices, then the
bufferDeviceAddressMultiDevice feature must be enabled
Valid Usage (Implicit)
VUID-vkCreateAccelerationStructure2KHR-device-parameter
device must be a valid VkDevice handle
VUID-vkCreateAccelerationStructure2KHR-pCreateInfo-parameter
pCreateInfo must be a valid pointer to a valid VkAccelerationStructureCreateInfo2KHR structure
VUID-vkCreateAccelerationStructure2KHR-pAllocator-parameter
If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
VUID-vkCreateAccelerationStructure2KHR-pAccelerationStructure-parameter
pAccelerationStructure must be a valid pointer to a VkAccelerationStructureKHR handle
VUID-vkCreateAccelerationStructure2KHR-device-queuecount
The device must have been created with at least 1 queue