Syntax
Members
TransformType: FLOAT[3][4] A 3x4 transform matrix in row-major layout representing the instance-to-world transformation. Implementations transform rays, as opposed to transforming all of the geometry or AABBs.
The layout of
Transform is a transpose of how affine matrices are typically stored in memory. Instead of four 3-vectors, Transform is laid out as three 4-vectors.Type: UINT An arbitrary 24-bit value that can be accessed using the
InstanceID intrinsic function in supported shader types.
InstanceMaskType: UINT An 8-bit mask assigned to the instance, which can be used to include/reject groups of instances on a per-ray basis. If the value is zero, then the instance will never be included, so typically this should be set to some non-zero value. For more information see, the
InstanceInclusionMask parameter to the TraceRay function.
InstanceContributionToHitGroupIndexType: UINT An arbitrary 24-bit value representing per-instance contribution to add into shader table indexing to select the hit group to use. Flags
Type: UINT An 8-bit mask representing flags from D3D12_RAYTRACING_INSTANCE_FLAGS to apply to the instance. AccelerationStructure
Type: D3D12_GPU_VIRTUAL_ADDRESS Address of the bottom-level acceleration structure that is being instanced. The address must be aligned to 256 bytes, defined as D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BYTE_ALIGNMENT. Any existing acceleration structure passed in here would already have been required to be placed with such alignment. The memory pointed to must be in state D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE.
Remarks
This C++ struct definition is useful if you’re generating instance data on the CPU first, then uploading to the GPU. But your application is also free to generate instance descriptions directly into GPU memory (from compute shaders, for instance) following the same layout.Requirements
Header: d3d12_xs.hLibrary: d3d12_xs.lib
Supported Platforms: XBOX Series consoles
