public struct AccelerationStructureInstanceOne placed reference to a bottom-level structure, in the layout every API shares.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Sixty-four bytes, bit for bit VkAccelerationStructureInstanceKHR (and D3D12's D3D12_RAYTRACING_INSTANCE_DESC, which is the same layout — the vendors agreed for once): a 3×4 row-major world transform, a 24-bit custom index with an 8-bit visibility mask, a 24-bit hit-group offset with 8 flag bits, and the bottom-level structure's GPU address from GetAccelerationStructureAddress.
The transform's rows are the upper three rows of a column-vector matrix — each row is (basis.X, basis.Y, basis.Z, translation) for one world axis. Row-vector Matrix4x4 users transpose on the way in; FromRows spells the layout so the transposition happens in exactly one place.
Fields and properties (15)
public float R0XRow zero of the transform: world X from object space, then X translation.
public float R0YRow zero of the transform: world X from object space, then X translation.
public float R0ZRow zero of the transform: world X from object space, then X translation.
public float R0WRow zero of the transform: world X from object space, then X translation.
public float R1XRow one: world Y.
public float R1YRow one: world Y.
public float R1ZRow one: world Y.
public float R1WRow one: world Y.
public float R2XRow two: world Z.
public float R2YRow two: world Z.
public float R2ZRow two: world Z.
public float R2WRow two: world Z.
public uint IndexAndMaskLow 24 bits: the custom index a shader reads back. High 8: the visibility mask — zero is invisible to every ray.
public uint OffsetAndFlagsLow 24 bits: the hit-group offset (zero for ray queries). High 8: instance flags — zero is the default, and the queries here disable culling per query anyway.
public ulong BottomLevelThe bottom-level structure's GPU address.
Methods (2)
public static AccelerationStructureInstance Identity(ulong bottomLevel, int index = 0)An identity-placed, fully visible instance of one bottom-level structure.
public static AccelerationStructureInstance FromRows(ulong bottomLevel, ReadOnlySpan<float> rows, int index = 0)The transform from three explicit rows, each (basis, translation) for one world axis.
Used by (1)
- AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests