VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV
The VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV structure is defined as:
typedef struct VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV {
// The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout.;
uint32_t clusterID;
VkClusterAccelerationStructureClusterFlagsNV clusterFlags;
uint32_t triangleCount:9;
uint32_t vertexCount:9;
uint32_t positionTruncateBitCount:6;
uint32_t indexType:4;
uint32_t opacityMicromapIndexType:4;
VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV baseGeometryIndexAndGeometryFlags;
uint16_t indexBufferStride;
uint16_t vertexBufferStride;
uint16_t geometryIndexAndFlagsBufferStride;
uint16_t opacityMicromapIndexBufferStride;
VkDeviceAddress indexBuffer;
VkDeviceAddress vertexBuffer;
VkDeviceAddress geometryIndexAndFlagsBuffer;
VkDeviceAddress opacityMicromapArray;
VkDeviceAddress opacityMicromapIndexBuffer;
VkDeviceAddress instantiationBoundingBoxLimit;
} VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV;
pub struct ClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV {
/// The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout.
cluster_id: u32,
cluster_flags: vk::ClusterAccelerationStructureClusterFlagsNV,
triangle_count: u32,
vertex_count: u32,
position_truncate_bit_count: u32,
index_type: u32,
opacity_micromap_index_type: u32,
base_geometry_index_and_geometry_flags: vk::ClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV,
index_buffer_stride: u16,
vertex_buffer_stride: u16,
geometry_index_and_flags_buffer_stride: u16,
opacity_micromap_index_buffer_stride: u16,
index_buffer: vk::DeviceAddress,
vertex_buffer: vk::DeviceAddress,
geometry_index_and_flags_buffer: vk::DeviceAddress,
opacity_micromap_array: vk::DeviceAddress,
opacity_micromap_index_buffer: vk::DeviceAddress,
instantiation_bounding_box_limit: vk::DeviceAddress,
}
clusterIDis a user specified identifier assigned to this cluster template.clusterFlagsis a bitmask of VkClusterAccelerationStructureClusterFlagBitsNV values describing flags how the cluster template should be built.triangleCountis the number of triangles in this cluster.vertexCountis the number of unique vertices in this cluster.positionTruncateBitCountis the number of bits starting at the lowest bit (i.e. the LSBs of the mantissa), of each vertex position that will be truncated to zero to improve floating-point compression.indexTypeis a single VkClusterAccelerationStructureIndexFormatFlagBitsNV value specifying the index type inindexBuffer.opacityMicromapIndexTypeis a single VkClusterAccelerationStructureIndexFormatFlagBitsNV value specifying the index type inopacityMicromapIndexBuffer.baseGeometryIndexAndGeometryFlagsis a VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV value specifying the base geometry index and flags for all triangles in the cluster template.indexBufferStrideis the stride in bytes inindexBuffer.vertexBufferStrideis the stride in bytes invertexBuffer.geometryIndexAndFlagsBufferStrideis the stride in bytes ingeometryIndexAndFlagsBuffer.opacityMicromapIndexBufferStrideis the stride in bytes inopacityMicromapIndexBuffer.indexBuffercontains the indices of vertices in the cluster and is of typeindexType.vertexBufferis either0or specifies the vertex data of the triangles in the cluster template with format specified in VkClusterAccelerationStructureTriangleClusterInputNV::vertexFormat.geometryIndexAndFlagsBufferis either0or an address containing strided VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV values specifying the geometry index and flag for every triangle in the cluster.opacityMicromapArrayis either0or specifies the address of a valid opacity micromap array to reference from the cluster acceleration structure. If it is0, then opacity micromaps will be disabled for this cluster acceleration structure.opacityMicromapIndexBufferis either0or specifies the address of a strided array with size equal to the number of triangles or indices into the opacity micromap array. IfopacityMicromapIndexBufferis0then the index used is the index of the triangle in the geometry.instantiationBoundingBoxLimitis either0or specifies the address of a bounding box within which all instantiated clusters must lie. The bounding box is specified by six 32-bit floating-point values in the order MinX, MinY, MinZ, MaxX, MaxY, MaxZ.
The C language specification does not define the ordering of bit-fields, but in practice, this structure produces the correct layout with existing compilers. The intended bit pattern is the following:
triangleCount,vertexCount,positionTruncateBitCount,indexTypeandopacityMicromapIndexTypeoccupy the same memory as if a singleuint32_twas specified in their placetriangleCountoccupies the 9 least significant bits of that memoryvertexCountoccupies the next 9 least significant bits of that memorypositionTruncateBitCountoccupies the next 6 least significant bits of that memoryindexTypeoccupies the next 4 least significant bits of that memoryopacityMicromapIndexTypeoccupies the 4 most significant bits of that memory
If a compiler produces code that diverges from that pattern, applications must employ another method to set values according to the correct bit pattern.
Cluster templates cannot be directly used to build bottom level acceleration structures, instead, they must be instantiated into CLAS objects.
Valid Usage
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-clusterID-10497
clusterID must not be 0xFFFFFFFF
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-triangleCount-10498
triangleCount must be less than or equal to
VkPhysicalDeviceClusterAccelerationStructurePropertiesNV::maxTrianglesPerCluster
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-vertexCount-10499
vertexCount must be less than or equal to
VkPhysicalDeviceClusterAccelerationStructurePropertiesNV::maxVerticesPerCluster
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-indexType-10500
indexType must only have a single bit set
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-opacityMicromapIndexType-10501
opacityMicromapIndexType must only have a single bit set
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-positionTruncateBitCount-10502
positionTruncateBitCount must be greater than or equal to
VkClusterAccelerationStructureTriangleClusterInputNV::minPositionTruncateBitCount
and less than or equal to 32
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-indexBufferStride-10503
indexBufferStride must be 0 or a multiple of indexType
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-vertexBufferStride-10504
vertexBufferStride must be 0 or a multiple of value specified
in
VkClusterAccelerationStructureTriangleClusterInputNV::vertexFormat
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-instantiationBoundingBoxLimit-10505
instantiationBoundingBoxLimit must be aligned to
VkPhysicalDeviceClusterAccelerationStructurePropertiesNV::clusterTemplateBoundsByteAlignment
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-baseGeometryIndex-10506
The maximum geometry index after using the values in
baseGeometryIndex and geometryIndexBuffer must be less than
VkPhysicalDeviceClusterAccelerationStructurePropertiesNV::maxClusterGeometryIndex
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-opacityMicromapArray-10882
If opacityMicromapArray is not 0, then the template cluster
acceleration structure must have been built with
VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_CLUSTER_OPACITY_MICROMAPS_BIT_NV
flag set in VkClusterAccelerationStructureInputInfoNV::flags
Valid Usage (Implicit)
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-clusterFlags-parameter
clusterFlags must be a valid combination of VkClusterAccelerationStructureClusterFlagBitsNV values
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-indexBuffer-parameter
indexBuffer must be a valid VkDeviceAddress value
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-vertexBuffer-parameter
If vertexBuffer is not 0, vertexBuffer must be a valid VkDeviceAddress value
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-geometryIndexAndFlagsBuffer-parameter
If geometryIndexAndFlagsBuffer is not 0, geometryIndexAndFlagsBuffer must be a valid VkDeviceAddress value
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-opacityMicromapArray-parameter
If opacityMicromapArray is not 0, opacityMicromapArray must be a valid VkDeviceAddress value
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-opacityMicromapIndexBuffer-parameter
If opacityMicromapIndexBuffer is not 0, opacityMicromapIndexBuffer must be a valid VkDeviceAddress value
VUID-VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV-instantiationBoundingBoxLimit-parameter
If instantiationBoundingBoxLimit is not 0, instantiationBoundingBoxLimit must be a valid VkDeviceAddress value