Interface MTLCommandBuffer

  • All Known Implementing Classes:
    MPSCommandBuffer

    public interface MTLCommandBuffer
    [@protocol] MTLCommandBuffer A serial list of commands for the device to execute. API-Since: 8.0
    • Method Detail

      • addCompletedHandler

        void addCompletedHandler​(@NotNull
                                 @NotNull MTLCommandBuffer.Block_addCompletedHandler block)
        addCompletedHandler:block: Add a block to be called when this command buffer has completed execution.
      • addScheduledHandler

        void addScheduledHandler​(@NotNull
                                 @NotNull MTLCommandBuffer.Block_addScheduledHandler block)
        addScheduledHandler:block: Adds a block to be called when this command buffer has been scheduled for execution.
      • blitCommandEncoder

        @Nullable
        @Nullable MTLBlitCommandEncoder blitCommandEncoder()
        blitCommandEncoder returns a blit command encoder to encode into this command buffer.
      • commandQueue

        @NotNull
        @NotNull 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

        @Nullable
        @Nullable MTLComputeCommandEncoder computeCommandEncoder()
        computeCommandEncoder returns a compute command encoder to encode into this command buffer.
      • device

        @NotNull
        @NotNull 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

        @Nullable
        @Nullable NSError error()
        [@property] error If an error occurred during execution, the NSError may contain more details about the problem.
      • label

        @Nullable
        @Nullable java.lang.String label()
        [@property] label A string to help identify this object.
      • parallelRenderCommandEncoderWithDescriptor

        @Nullable
        @Nullable MTLParallelRenderCommandEncoder parallelRenderCommandEncoderWithDescriptor​(@NotNull
                                                                                             @NotNull MTLRenderPassDescriptor renderPassDescriptor)
        parallelRenderCommandEncoderWithDescriptor: returns a parallel render pass encoder to encode into this command buffer.
      • presentDrawable

        void presentDrawable​(@NotNull
                             @NotNull 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​(@NotNull
                                   @NotNull 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

        @Nullable
        @Nullable MTLRenderCommandEncoder renderCommandEncoderWithDescriptor​(@NotNull
                                                                             @NotNull 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​(@Nullable
                      @Nullable 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. API-Since: 10.3
      • 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. API-Since: 10.3
      • kernelEndTime

        double kernelEndTime()
        API-Since: 10.3
      • kernelStartTime

        double kernelStartTime()
        API-Since: 10.3
      • popDebugGroup

        void popDebugGroup()
        popDebugGroup Pop the latest named string off of the stack. API-Since: 11.0
      • presentDrawableAfterMinimumDuration

        void presentDrawableAfterMinimumDuration​(@NotNull
                                                 @NotNull 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 API-Since: 10.3
        Parameters:
        drawable - The drawable to be presented
        duration - The minimum time that previous frame should be displayed. The time is double preceision floating point in the unit of seconds.
      • pushDebugGroup

        void pushDebugGroup​(@NotNull
                            @NotNull java.lang.String string)
        pushDebugGroup: Push a new named string onto a stack of string labels. API-Since: 11.0
      • computeCommandEncoderWithDispatchType

        @Nullable
        @Nullable 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 API-Since: 12.0
      • encodeSignalEventValue

        void encodeSignalEventValue​(@NotNull
                                    @NotNull 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. API-Since: 12.0
      • encodeWaitForEventValue

        void encodeWaitForEventValue​(@NotNull
                                     @NotNull 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. API-Since: 12.0
      • blitCommandEncoderWithDescriptor

        @Nullable
        @Nullable MTLBlitCommandEncoder blitCommandEncoderWithDescriptor​(@NotNull
                                                                         @NotNull MTLBlitPassDescriptor blitPassDescriptor)
        blitCommandEncoderWithDescriptor: returns a blit command endcoder to encode into this command buffer. API-Since: 14.0
      • computeCommandEncoderWithDescriptor

        @Nullable
        @Nullable MTLComputeCommandEncoder computeCommandEncoderWithDescriptor​(@NotNull
                                                                               @NotNull MTLComputePassDescriptor computePassDescriptor)
        computeCommandEncoderWithDescriptor: returns a compute command endcoder to encode into this command buffer. API-Since: 14.0
      • errorOptions

        long errorOptions()
        The set of options configuring the error reporting of the created command buffer. API-Since: 14.0
      • logs

        @NotNull
        @NotNull MTLLogContainer logs()
        [@property] logs Logs generated by the command buffer during execution of the GPU commands. Valid after GPU execution is completed API-Since: 14.0