Contents

readVertices(at:_:)

Reads the current contents of a vertex buffer synchronously on the CPU.

Declaration

final func readVertices<R, E>(at index: Int, _ body: (RawSpan) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable

Parameters

  • index:

    The vertex buffer index to read.

  • body:

    A closure that receives a read-only span over the buffer’s bytes.

Discussion

You pass a closure that receives a read-only span representing the contents of the vertex buffer. This span is valid only for the duration of the closure.

See Also

Accessing vertex data