C Specification
To query acceleration structure size parameters call:
// Provided by VK_KHR_acceleration_structure
void vkCmdWriteAccelerationStructuresPropertiesKHR(
VkCommandBuffer commandBuffer,
uint32_t accelerationStructureCount,
const VkAccelerationStructureKHR* pAccelerationStructures,
VkQueryType queryType,
VkQueryPool queryPool,
uint32_t firstQuery);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
accelerationStructureCount
is the count of acceleration structures for which to query the property. -
pAccelerationStructures
is a pointer to an array of existing previously built acceleration structures. -
queryType
is a VkQueryType value specifying the type of queries managed by the pool. -
queryPool
is the query pool that will manage the results of the query. -
firstQuery
is the first query index within the query pool that will contain theaccelerationStructureCount
number of results.
Description
Accesses to any of the acceleration structures listed in
pAccelerationStructures
must be synchronized with the
VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR
pipeline stage or the
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR
pipeline stage, and an
access type of
VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR
.
-
If
queryType
isVK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR
, then the value written out is the number of bytes required by a compacted acceleration structure. -
If
queryType
isVK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR
, then the value written out is the number of bytes required by a serialized acceleration structure.
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.