Structures

VkAccelerationStructureBuildRangeInfoKHR

Structure specifying build offsets and counts for acceleration structure builds

VkAccelerationStructureBuildRangeInfoKHR is defined as:

typedef struct VkAccelerationStructureBuildRangeInfoKHR {
    uint32_t primitiveCount;
    uint32_t primitiveOffset;
    uint32_t firstVertex;
    uint32_t transformOffset;
} VkAccelerationStructureBuildRangeInfoKHR;
  • primitiveCount defines the number of primitives for a corresponding acceleration structure geometry.
  • primitiveOffset defines an offset in bytes into the memory where primitive data is defined.
  • firstVertex is the index of the first vertex to build from for triangle geometry.
  • transformOffset defines an offset in bytes into the memory where a transform matrix is defined.

The primitive count and primitive offset are interpreted differently depending on the VkGeometryTypeKHR used:

Valid Usage

VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03656

For geometries of type VK_GEOMETRY_TYPE_TRIANGLES_KHR, if the geometry uses indices, the offset primitiveOffset from VkAccelerationStructureGeometryTrianglesDataKHR::indexDatamust be a multiple of the element size of VkAccelerationStructureGeometryTrianglesDataKHR::indexType

VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03657

For geometries of type VK_GEOMETRY_TYPE_TRIANGLES_KHR, if the geometry does not use indices, the offset primitiveOffset from VkAccelerationStructureGeometryTrianglesDataKHR::vertexDatamust be a multiple of the component size of VkAccelerationStructureGeometryTrianglesDataKHR::vertexFormat

VUID-VkAccelerationStructureBuildRangeInfoKHR-transformOffset-03658

For geometries of type VK_GEOMETRY_TYPE_TRIANGLES_KHR, the offset transformOffset from VkAccelerationStructureGeometryTrianglesDataKHR::transformDatamust be a multiple of 16

VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03659

For geometries of type VK_GEOMETRY_TYPE_AABBS_KHR, the offset primitiveOffset from VkAccelerationStructureGeometryAabbsDataKHR::data must be a multiple of 8

VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03660

For geometries of type VK_GEOMETRY_TYPE_INSTANCES_KHR, the offset primitiveOffset from VkAccelerationStructureGeometryInstancesDataKHR::data must be a multiple of 16