makeCommandBuffer()
Returns a command buffer from the command queue that maintains strong references to resources.
Declaration
func makeCommandBuffer() -> (any MTLCommandBuffer)?Mentioned in
Discussion
The command buffers you create with this method maintain strong references to the resources you encode into it, including buffers, textures, samplers, and pipeline states. The command buffer releases these references after it finishes running on the GPU.
This method sets the retainedReferences property to true for the command buffer it creates.
Each command queue has a fixed number of command buffers for its lifetime (see makeCommandQueue(maxCommandBufferCount:)). This method blocks the calling CPU thread when the queue doesn’t have any free command buffers, and returns after the GPU finishes executing one.