replace(commandBuffer:)
Returns a Metal texture you populate on the GPU with the new contents of the texture resource.
Declaration
final func replace(commandBuffer: (any MTLCommandBuffer)?) -> any MTLTextureParameters
- commandBuffer:
The command buffer that writes to this texture, or
nilto skip synchronization.
Return Value
A MTLTexture ready for GPU write operations.
Discussion
Upon return the texture’s contents are undefined; the caller is responsible for populating it with valid data. The renderer waits for the provided command buffer to complete before using the texture for rendering.