bindVertexData method

  1. @override
void bindVertexData(
  1. ByteData bytes,
  2. int vertexCount, {
  3. int slot = 0,
})
override

Binds vertices built this frame.

The bytes are consumed by the time this returns; where they live until the GPU has read them is the backend's problem, which is the whole reason this takes bytes rather than a buffer the caller had to allocate.

This is where per-instance data goes: it is built every frame from a simulation, which is exactly what this method is for.

Implementation

@override
void bindVertexData(ByteData bytes, int vertexCount, {int slot = 0}) =>
    commands.add(RecordedVertices(vertexCount, transient: true, slot: slot));