Contents

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 MTLTexture

Parameters

  • commandBuffer:

    The command buffer that writes to this texture, or nil to 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.

See Also

Reading and writing texture data