Contents

updateVertices(at:_:)

Updates a vertex buffer in place synchronously on the CPU.

Declaration

final func updateVertices<R, E>(at index: Int, _ body: @_lifetime(0: copy 0) (inout MutableRawSpan) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable

Parameters

  • index:

    The vertex buffer index to update.

  • body:

    A closure that receives a mutable span over the buffer’s bytes for in-place modification.

Discussion

You pass a closure that receives a mutable span representing the contents of the vertex buffer, which the closure may modify. This span is valid only for the duration of the closure.

See Also

Accessing vertex data