read(commandBuffer:)
Returns a Metal texture containing the current contents of the texture resource for GPU read operations.
Declaration
final func read(commandBuffer: (any MTLCommandBuffer)?) -> any MTLTextureParameters
- commandBuffer:
The command buffer that reads from this texture, or
nilto skip synchronization.
Return Value
A MTLTexture ready for GPU read operations.
Discussion
The renderer waits for the provided command buffer to complete before discarding the texture.