MTLCommandBuffer

A container that stores a sequence of GPU commands that you encode into it.

Members

Functions

GPUEndTime
CFTimeInterval GPUEndTime()

The host time, in seconds, when the GPU finishes execution of the command buffer.

GPUStartTime
CFTimeInterval GPUStartTime()

The host time, in seconds, when the GPU starts command buffer execution.

addCompletedHandler
void addCompletedHandler(MTLCommandBufferHandler )

Registers a completion handler the GPU device calls immediately after the GPU finishes running the commands in the command buffer.

addScheduleHandler
void addScheduleHandler(MTLCommandBufferHandler )

Registers a completion handler the GPU device calls immediately after it schedules the command buffer to run on the GPU.

blitCommandEncoder
MTLBlitCommandEncoder blitCommandEncoder()

Creates a block information transfer (blit) encoder.

blitCommandEncoderWithDescriptor
MTLBlitCommandEncoder blitCommandEncoderWithDescriptor(MTLBlitPassDescriptor )

Creates a block information transfer (blit) encoder from a descriptor.

commandQueue
MTLCommandQueue commandQueue()

The command queue that creates the command buffer.

commandQueue
MTLCommandQueue commandQueue(MTLCommandQueue )
Undocumented in source.
commit
void commit()

Submits the command buffer to run on the GPU.

encodeSignalEvent
void encodeSignalEvent(MTLEvent event, ulong value)

Encodes a command into the command buffer that pauses the GPU from running subsequent passes until the event equals or exceeds a value.

encodeWaitForEvent
void encodeWaitForEvent(MTLEvent event, ulong value)

Encodes a command into the command buffer that pauses the GPU from running subsequent passes until the event equals or exceeds a value.

enqueue
void enqueue()

Reserves the next available place for the command buffer in its command queue.

error
NSError error()

A description of an error when the GPU encounters an issue as it runs the command buffer.

error
NSError error(NSError )
Undocumented in source.
errorOptions
MTLCommandBufferErrorOption errorOptions()

Settings that determine which information the command buffer records about execution errors, and how it does it.

errorOptions
MTLCommandBufferErrorOption errorOptions(MTLCommandBufferErrorOption )
Undocumented in source.
kernelEndTime
CFTimeInterval kernelEndTime()

The host time, in seconds, when the CPU finishes scheduling the command buffer.

kernelStartTime
CFTimeInterval kernelStartTime()

The host time, in seconds, when the CPU begins to schedule the command buffer.

label
NSString label()

A string to help identify this object

label
NSString label(NSString )
Undocumented in source.
logs
MTLLogContainer logs()

The messages the command buffer records as the GPU runs its commands.

popDebugGroup
void popDebugGroup()

Marks the end of a debug group and, if applicable, restores the previous group from a stack.

presentDrawable
void presentDrawable(MTLDrawable drawable)

Presents a drawable as early as possible.

presentDrawable
void presentDrawable(MTLDrawable drawable, CFTimeInterval presentationTime)

Presents a drawable at a specific time.

presentDrawableAfterMinimumDuration
void presentDrawableAfterMinimumDuration(MTLDrawable drawable, CFTimeInterval duration)

Presents a drawable after the system presents the previous drawable for an amount of time.

pushDebugGroup
void pushDebugGroup(NSString )

Marks the beginning of a debug group and gives it an identifying label, which temporarily replaces the previous group, if applicable.

renderCommandEncoderWithDescriptor
MTLRenderCommandEncoder renderCommandEncoderWithDescriptor(MTLRenderPassDescriptor renderPassDescriptor)
Undocumented in source.
status
MTLCommandBufferStatus status()

The command buffer’s current state.

waitUntilCompleted
void waitUntilCompleted()

Synchronously waits for the GPU to finish running the command buffer, which can block the current thread’s execution.

waitUntilScheduled
void waitUntilScheduled()

Synchronously waits for the command queue to schedule the buffer, which can block the current thread’s execution.

Meta