Contents

readVertices(at:commandBuffer:)

Returns a Metal buffer containing the current contents of the vertex buffer for GPU read operations.

Declaration

final func readVertices(at index: Int, commandBuffer: (any MTLCommandBuffer)?) -> any MTLBuffer

Parameters

  • index:

    The vertex buffer index to read.

  • commandBuffer:

    The command buffer that reads from this buffer, or nil to skip synchronization.

Return Value

A MTLBuffer ready for GPU read operations.

Discussion

The renderer waits for the provided command buffer to complete before discarding the buffer.

See Also

Accessing vertex data