Contents

LowLevelInstanceTransformResource

A GPU-managed buffer that stores an array of per-instance transforms for GPU instancing.

Declaration

final class LowLevelInstanceTransformResource

Overview

Assign a LowLevelInstanceTransformResource to a LowLevelMeshInstance via setInstanceTransforms(_:) to issue a single instanced draw call that renders multiple copies of the mesh. Each entry in the buffer is a float4x4 model-to-local transform. The renderer computes the final world transform for each instance as meshInstance.transform * instanceTransforms[i].

Create a LowLevelInstanceTransformResource using makeInstanceTransformResource(instanceCapacity:).

Topics

Inspecting instance counts

Reading transform data

Replacing transform data

Instance Methods

See Also

GPU resources