Package apple.metal.protocol
Interface MTLCommandBuffer
-
- All Known Implementing Classes:
MPSCommandBuffer
public interface MTLCommandBuffer[@protocol] MTLCommandBuffer A serial list of commands for the device to execute.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMTLCommandBuffer.Block_addCompletedHandlerstatic interfaceMTLCommandBuffer.Block_addScheduledHandler
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MTLAccelerationStructureCommandEncoderaccelerationStructureCommandEncoder()voidaddCompletedHandler(MTLCommandBuffer.Block_addCompletedHandler block)addCompletedHandler:block: Add a block to be called when this command buffer has completed execution.voidaddScheduledHandler(MTLCommandBuffer.Block_addScheduledHandler block)addScheduledHandler:block: Adds a block to be called when this command buffer has been scheduled for execution.MTLBlitCommandEncoderblitCommandEncoder()blitCommandEncoder returns a blit command encoder to encode into this command buffer.MTLBlitCommandEncoderblitCommandEncoderWithDescriptor(MTLBlitPassDescriptor blitPassDescriptor)blitCommandEncoderWithDescriptor: returns a blit command endcoder to encode into this command buffer.MTLCommandQueuecommandQueue()[@property] commandQueue The command queue this command buffer was created from.voidcommit()commit Commit a command buffer so it can be executed as soon as possible.MTLComputeCommandEncodercomputeCommandEncoder()computeCommandEncoder returns a compute command encoder to encode into this command buffer.MTLComputeCommandEncodercomputeCommandEncoderWithDescriptor(MTLComputePassDescriptor computePassDescriptor)computeCommandEncoderWithDescriptor: returns a compute command endcoder to encode into this command buffer.MTLComputeCommandEncodercomputeCommandEncoderWithDispatchType(long dispatchType)computeCommandEncoderWithDispatchType returns a compute command encoder to encode into this command buffer.MTLDevicedevice()[@property] device The device this resource was created against.voidencodeSignalEventValue(MTLEvent event, long value)encodeSignalEvent:value: Encodes a command that signals an event with a given value.voidencodeWaitForEventValue(MTLEvent event, long value)encodeWaitForEvent:value: Encodes a command that pauses execution of this command buffer until the specified event reaches a given value.voidenqueue()enqueue Append this command buffer to the end of its MTLCommandQueue.NSErrorerror()[@property] error If an error occurred during execution, the NSError may contain more details about the problem.longerrorOptions()The set of options configuring the error reporting of the created command buffer.doubleGPUEndTime()[@property] GPUEndTime The host time in seconds that GPU finishes executing this command buffer.doubleGPUStartTime()[@property] GPUStartTime The host time in seconds that GPU starts executing this command buffer.doublekernelEndTime()doublekernelStartTime()java.lang.Stringlabel()[@property] label A string to help identify this object.MTLLogContainerlogs()[@property] logs Logs generated by the command buffer during execution of the GPU commands.MTLParallelRenderCommandEncoderparallelRenderCommandEncoderWithDescriptor(MTLRenderPassDescriptor renderPassDescriptor)parallelRenderCommandEncoderWithDescriptor: returns a parallel render pass encoder to encode into this command buffer.voidpopDebugGroup()popDebugGroup Pop the latest named string off of the stack.voidpresentDrawable(MTLDrawable drawable)presentDrawable: Add a drawable present that will be invoked when this command buffer has been scheduled for execution.voidpresentDrawableAfterMinimumDuration(MTLDrawable drawable, double duration)presentDrawable:afterMinimumDuration: Add a drawable present for a specific host time that allows previous frame to be on screen for at least duration time.voidpresentDrawableAtTime(MTLDrawable drawable, double presentationTime)presentDrawable:atTime: Add a drawable present for a specific host time that will be invoked when this command buffer has been scheduled for execution.voidpushDebugGroup(java.lang.String string)pushDebugGroup: Push a new named string onto a stack of string labels.MTLRenderCommandEncoderrenderCommandEncoderWithDescriptor(MTLRenderPassDescriptor renderPassDescriptor)renderCommandEncoderWithDescriptor: returns a render command endcoder to encode into this command buffer.MTLResourceStateCommandEncoderresourceStateCommandEncoder()MTLResourceStateCommandEncoderresourceStateCommandEncoderWithDescriptor(MTLResourceStatePassDescriptor resourceStatePassDescriptor)booleanretainedReferences()[@property] retainedReferences If YES, this command buffer holds strong references to objects needed to execute this command buffer.voidsetLabel(java.lang.String value)[@property] label A string to help identify this object.longstatus()[@property] status status reports the current stage in the lifetime of MTLCommandBuffer, as it proceeds to enqueued, committed, scheduled, and completed.voidwaitUntilCompleted()waitUntilCompleted Synchronously wait for this command buffer to complete.voidwaitUntilScheduled()waitUntilScheduled Synchronously wait for this command buffer to be scheduled.
-
-
-
Method Detail
-
addCompletedHandler
void addCompletedHandler(MTLCommandBuffer.Block_addCompletedHandler block)
addCompletedHandler:block: Add a block to be called when this command buffer has completed execution.
-
addScheduledHandler
void addScheduledHandler(MTLCommandBuffer.Block_addScheduledHandler block)
addScheduledHandler:block: Adds a block to be called when this command buffer has been scheduled for execution.
-
blitCommandEncoder
MTLBlitCommandEncoder blitCommandEncoder()
blitCommandEncoder returns a blit command encoder to encode into this command buffer.
-
commandQueue
MTLCommandQueue commandQueue()
[@property] commandQueue The command queue this command buffer was created from.
-
commit
void commit()
commit Commit a command buffer so it can be executed as soon as possible.
-
computeCommandEncoder
MTLComputeCommandEncoder computeCommandEncoder()
computeCommandEncoder returns a compute command encoder to encode into this command buffer.
-
device
MTLDevice device()
[@property] device The device this resource was created against.
-
enqueue
void enqueue()
enqueue Append this command buffer to the end of its MTLCommandQueue.
-
error
NSError error()
[@property] error If an error occurred during execution, the NSError may contain more details about the problem.
-
label
java.lang.String label()
[@property] label A string to help identify this object.
-
parallelRenderCommandEncoderWithDescriptor
MTLParallelRenderCommandEncoder parallelRenderCommandEncoderWithDescriptor(MTLRenderPassDescriptor renderPassDescriptor)
parallelRenderCommandEncoderWithDescriptor: returns a parallel render pass encoder to encode into this command buffer.
-
presentDrawable
void presentDrawable(MTLDrawable drawable)
presentDrawable: Add a drawable present that will be invoked when this command buffer has been scheduled for execution. The submission thread will be lock stepped with present call been serviced by window server
-
presentDrawableAtTime
void presentDrawableAtTime(MTLDrawable drawable, double presentationTime)
presentDrawable:atTime: Add a drawable present for a specific host time that will be invoked when this command buffer has been scheduled for execution. The submission thread will be lock stepped with present call been serviced by window server
-
renderCommandEncoderWithDescriptor
MTLRenderCommandEncoder renderCommandEncoderWithDescriptor(MTLRenderPassDescriptor renderPassDescriptor)
renderCommandEncoderWithDescriptor: returns a render command endcoder to encode into this command buffer.
-
retainedReferences
boolean retainedReferences()
[@property] retainedReferences If YES, this command buffer holds strong references to objects needed to execute this command buffer.
-
setLabel
void setLabel(java.lang.String value)
[@property] label A string to help identify this object.
-
status
long status()
[@property] status status reports the current stage in the lifetime of MTLCommandBuffer, as it proceeds to enqueued, committed, scheduled, and completed.
-
waitUntilCompleted
void waitUntilCompleted()
waitUntilCompleted Synchronously wait for this command buffer to complete.
-
waitUntilScheduled
void waitUntilScheduled()
waitUntilScheduled Synchronously wait for this command buffer to be scheduled.
-
GPUEndTime
double GPUEndTime()
[@property] GPUEndTime The host time in seconds that GPU finishes executing this command buffer. Returns zero if CPU has not received completion notification. This usually can be called in command buffer completion handler.
-
GPUStartTime
double GPUStartTime()
[@property] GPUStartTime The host time in seconds that GPU starts executing this command buffer. Returns zero if it has not started. This usually can be called in command buffer completion handler.
-
kernelEndTime
double kernelEndTime()
-
kernelStartTime
double kernelStartTime()
-
popDebugGroup
void popDebugGroup()
popDebugGroup Pop the latest named string off of the stack.
-
presentDrawableAfterMinimumDuration
void presentDrawableAfterMinimumDuration(MTLDrawable drawable, double duration)
presentDrawable:afterMinimumDuration: Add a drawable present for a specific host time that allows previous frame to be on screen for at least duration time. The difference of this API versus presentDrawable:atTime is that this API defers calculation of the presentation time until the previous frame's actual presentation time is known, thus to be able to maintain a more consistent and stable frame time. This also provides an easy way to set frame rate. The submission thread will be lock stepped with present call been serviced by window server- Parameters:
drawable- The drawable to be presentedduration- The minimum time that previous frame should be displayed. The time is double preceision floating point in the unit of seconds.
-
pushDebugGroup
void pushDebugGroup(java.lang.String string)
pushDebugGroup: Push a new named string onto a stack of string labels.
-
computeCommandEncoderWithDispatchType
MTLComputeCommandEncoder computeCommandEncoderWithDispatchType(long dispatchType)
computeCommandEncoderWithDispatchType returns a compute command encoder to encode into this command buffer. Optionally allow this command encoder to execute dispatches concurrently. On devices that do not support concurrent command encoders, this call is equivalent to computeCommandEncoder
-
encodeSignalEventValue
void encodeSignalEventValue(MTLEvent event, long value)
encodeSignalEvent:value: Encodes a command that signals an event with a given value. This method may only be called if there is no current command encoder on the receiver.
-
encodeWaitForEventValue
void encodeWaitForEventValue(MTLEvent event, long value)
encodeWaitForEvent:value: Encodes a command that pauses execution of this command buffer until the specified event reaches a given value. This method may only be called if there is no current command encoder on the receiver.
-
resourceStateCommandEncoder
MTLResourceStateCommandEncoder resourceStateCommandEncoder()
-
accelerationStructureCommandEncoder
MTLAccelerationStructureCommandEncoder accelerationStructureCommandEncoder()
-
blitCommandEncoderWithDescriptor
MTLBlitCommandEncoder blitCommandEncoderWithDescriptor(MTLBlitPassDescriptor blitPassDescriptor)
blitCommandEncoderWithDescriptor: returns a blit command endcoder to encode into this command buffer.
-
computeCommandEncoderWithDescriptor
MTLComputeCommandEncoder computeCommandEncoderWithDescriptor(MTLComputePassDescriptor computePassDescriptor)
computeCommandEncoderWithDescriptor: returns a compute command endcoder to encode into this command buffer.
-
errorOptions
long errorOptions()
The set of options configuring the error reporting of the created command buffer.
-
logs
MTLLogContainer logs()
[@property] logs Logs generated by the command buffer during execution of the GPU commands. Valid after GPU execution is completed
-
resourceStateCommandEncoderWithDescriptor
MTLResourceStateCommandEncoder resourceStateCommandEncoderWithDescriptor(MTLResourceStatePassDescriptor resourceStatePassDescriptor)
-
-