beginCommandBuffer(allocator:)
Prepares a command buffer for encoding.
Declaration
func beginCommandBuffer(allocator: any MTL4CommandAllocator)Parameters
- allocator:
Mtl4commandallocator to attach to.
Mentioned in
Discussion
Attaches the command buffer to the specified MTL4CommandAllocator and declares that the application is ready to encode commands into the command buffer.
Command allocators only service a single command buffer at a time. If you need to issue multiple calls to this method simultaneously, for example, in a multi-threaded command encoding scenario, create multiple instances of MTLCommandAllocator and use one for each call.
You can safely reuse command allocators after ending the command buffer using it by calling endCommandBuffer().
After calling this method, any prior calls to useResidencySet(_:) and useResidencySets:count: on this command buffer instance no longer apply. Make sure to call these methods again to signal your residency requirements to Metal.