Contents

read(commandBuffer:)

Retrieves the Metal buffer for GPU reading.

Declaration

final func read(commandBuffer: (any MTLCommandBuffer)?) -> any MTLBuffer

Parameters

  • commandBuffer:

    The command buffer using this buffer, or nil to skip synchronization.

Return Value

The underlying MTLBuffer for reading.

Discussion

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

See Also

Reading buffer contents