Structures
VkAccelerationStructureSRTMotionInstanceNV
Structure specifying a single acceleration structure SRT motion instance for building into an acceleration structure geometry
An acceleration structure SRT motion instance is defined by the structure:
typedef struct VkAccelerationStructureSRTMotionInstanceNV {
// The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout.;
VkSRTDataNV transformT0;
VkSRTDataNV transformT1;
uint32_t instanceCustomIndex:24;
uint32_t mask:8;
uint32_t instanceShaderBindingTableRecordOffset:24;
VkGeometryInstanceFlagsKHR flags:8;
uint64_t accelerationStructureReference;
} VkAccelerationStructureSRTMotionInstanceNV;
transformT0is a VkSRTDataNV structure describing a transformation to be applied to the acceleration structure at time 0.transformT1is a VkSRTDataNV structure describing a transformation to be applied to the acceleration structure at time 1.instanceCustomIndexis a 24-bit application-specified index value accessible to ray shaders in theInstanceCustomIndexKHRbuilt-in.maskis an 8-bit visibility mask for the geometry. The instance may only be hit ifCull Mask & instance.mask != 0instanceShaderBindingTableRecordOffsetis a 24-bit offset used in calculating the hit shader binding table index.flagsis an 8-bit mask of VkGeometryInstanceFlagBitsKHR values to apply to this instance.accelerationStructureReferenceis either:- a device address containing the value obtained from vkGetAccelerationStructureDeviceAddressKHR or vkGetAccelerationStructureHandleNV (used by device operations which reference acceleration structures) or,
- a VkAccelerationStructureKHR object (used by host operations which reference acceleration structures).
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 for the following:
instanceCustomIndexandmaskoccupy the same memory as if a singleuint32_twas specified in their placeinstanceCustomIndexoccupies the 24 least significant bits of that memorymaskoccupies the 8 most significant bits of that memory
instanceShaderBindingTableRecordOffsetandflagsoccupy the same memory as if a singleuint32_twas specified in their placeinstanceShaderBindingTableRecordOffsetoccupies the 24 least significant bits of that memoryflagsoccupies the 8 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.
The transform for a SRT motion instance at a point in time is derived from
component-wise linear interpolation of the two SRT transforms.
That is, for a time in [0,1] the resulting transform is
transformT0× (1 -time) +transformT1×time
Valid Usage (Implicit)
VUID-VkAccelerationStructureSRTMotionInstanceNV-flags-parameter
flags must be a valid combination of VkGeometryInstanceFlagBitsKHR values