Instance Method


Creates a command buffer.



func makeCommandBuffer() -> MTLCommandBuffer?

Return Value

A command buffer object.


This method returns a command buffer that follows normal memory management conventions and is guaranteed to hold strong references to objects (such as buffers, textures, samplers, and state objects) that are referenced by any command encoders that it creates. These references are held until command execution is completed.

This method sets the retainedReferences property of the returned command buffer to true.

If the command queue was instantiated with a maximum number of command buffers and the app already has that many buffers waiting to be executed, then this method blocks until one of those buffers becomes available.

See Also

Creating Command Buffers

func makeCommandBufferWithUnretainedReferences() -> MTLCommandBuffer?

Creates a command buffer that doesn't hold strong references to any objects required to execute the command buffer.