Instance Method

commandBuffer

Creates a command buffer.

Required.

Declaration

- (id<MTLCommandBuffer>)commandBuffer;

Return Value

A command buffer object.

Discussion

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 YES.

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

- commandBufferWithUnretainedReferences

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

Required.