Function Kataglyphis::meshBaseOffsets

Function Kataglyphis::meshBaseOffsets#

Function Documentation#

inline std::vector<uint32_t> Kataglyphis::meshBaseOffsets(std::span<const uint32_t> meshCountPerModel)#

One entry per model: the running sum of preceding models’ mesh counts. This is the value written to VkAccelerationStructureInstanceKHR::instanceCustomIndex for each model’s TLAS instance, and read back by the traced shaders (via InstanceID()) as the object-index base they add GeometryIndex() to. It walks the same meshCountPerModel counts as assignTextureOffsets, just summing mesh counts instead of texture counts - the two must agree on model order.