Package apple.metalperformanceshaders
Class MPSCommandBuffer
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.metalperformanceshaders.MPSCommandBuffer
-
- All Implemented Interfaces:
MTLCommandBuffer,NSObject
public class MPSCommandBuffer extends NSObject implements MTLCommandBuffer
MPSCommandBuffer [@dependency] This depends on Metal.framework A MPSCommandBuffer object is used to wrap an existing command buffer with MPS specific options. A MPS kernel typically operates between a fixed set of inputs and outputs. The MPSCommandBuffer class provides a way to add further encode-time parameters to the encode call using the command buffer. Currently the only parameter included in the MPSCommandBuffer that all MPS kernels support is the the predicate option, which can be used to pre-empt the kernel from the GPU side. NOTE: the options that contain metal resources will be referenced by this object and therefore it is advisable to make the lifetime of this object as short as possible as is the case for all command buffers. API-Since: 13.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Block_accessibilityActivateBlock_ret, NSObject.Block_accessibilityActivationPointBlock_ret, NSObject.Block_accessibilityAttributedHintBlock_ret, NSObject.Block_accessibilityAttributedLabelBlock_ret, NSObject.Block_accessibilityAttributedUserInputLabelsBlock_ret, NSObject.Block_accessibilityAttributedValueBlock_ret, NSObject.Block_accessibilityContainerTypeBlock_ret, NSObject.Block_accessibilityCustomActionsBlock_ret, NSObject.Block_accessibilityCustomRotorsBlock_ret, NSObject.Block_accessibilityDecrementBlock_ret, NSObject.Block_accessibilityElementsBlock_ret, NSObject.Block_accessibilityElementsHiddenBlock_ret, NSObject.Block_accessibilityFrameBlock_ret, NSObject.Block_accessibilityHeaderElementsBlock_ret, NSObject.Block_accessibilityHintBlock_ret, NSObject.Block_accessibilityIdentifierBlock_ret, NSObject.Block_accessibilityIncrementBlock_ret, NSObject.Block_accessibilityLabelBlock_ret, NSObject.Block_accessibilityLanguageBlock_ret, NSObject.Block_accessibilityMagicTapBlock_ret, NSObject.Block_accessibilityNavigationStyleBlock_ret, NSObject.Block_accessibilityPathBlock_ret, NSObject.Block_accessibilityPerformEscapeBlock_ret, NSObject.Block_accessibilityRespondsToUserInteractionBlock_ret, NSObject.Block_accessibilityShouldGroupAccessibilityChildrenBlock_ret, NSObject.Block_accessibilityTextualContextBlock_ret, NSObject.Block_accessibilityTraitsBlock_ret, NSObject.Block_accessibilityUserInputLabelsBlock_ret, NSObject.Block_accessibilityValueBlock_ret, NSObject.Block_accessibilityViewIsModalBlock_ret, NSObject.Block_automationElementsBlock_ret, NSObject.Block_isAccessibilityElementBlock_ret, NSObject.Block_setAccessibilityActivateBlock, NSObject.Block_setAccessibilityActivationPointBlock, NSObject.Block_setAccessibilityAttributedHintBlock, NSObject.Block_setAccessibilityAttributedLabelBlock, NSObject.Block_setAccessibilityAttributedUserInputLabelsBlock, NSObject.Block_setAccessibilityAttributedValueBlock, NSObject.Block_setAccessibilityContainerTypeBlock, NSObject.Block_setAccessibilityCustomActionsBlock, NSObject.Block_setAccessibilityCustomRotorsBlock, NSObject.Block_setAccessibilityDecrementBlock, NSObject.Block_setAccessibilityElementsBlock, NSObject.Block_setAccessibilityElementsHiddenBlock, NSObject.Block_setAccessibilityFrameBlock, NSObject.Block_setAccessibilityHeaderElementsBlock, NSObject.Block_setAccessibilityHintBlock, NSObject.Block_setAccessibilityIdentifierBlock, NSObject.Block_setAccessibilityIncrementBlock, NSObject.Block_setAccessibilityLabelBlock, NSObject.Block_setAccessibilityLanguageBlock, NSObject.Block_setAccessibilityMagicTapBlock, NSObject.Block_setAccessibilityNavigationStyleBlock, NSObject.Block_setAccessibilityPathBlock, NSObject.Block_setAccessibilityPerformEscapeBlock, NSObject.Block_setAccessibilityRespondsToUserInteractionBlock, NSObject.Block_setAccessibilityShouldGroupAccessibilityChildrenBlock, NSObject.Block_setAccessibilityTextualContextBlock, NSObject.Block_setAccessibilityTraitsBlock, NSObject.Block_setAccessibilityUserInputLabelsBlock, NSObject.Block_setAccessibilityValueBlock, NSObject.Block_setAccessibilityViewIsModalBlock, NSObject.Block_setAutomationElementsBlock, NSObject.Block_setIsAccessibilityElementBlock, NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
Nested classes/interfaces inherited from interface apple.metal.protocol.MTLCommandBuffer
MTLCommandBuffer.Block_addCompletedHandler, MTLCommandBuffer.Block_addScheduledHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMPSCommandBuffer(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @Nullable MTLAccelerationStructureCommandEncoderaccelerationStructureCommandEncoder()API-Since: 14.0@NotNull MTLAccelerationStructureCommandEncoderaccelerationStructureCommandEncoderWithDescriptor(@NotNull MTLAccelerationStructurePassDescriptor descriptor)API-Since: 16.0static booleanaccessInstanceVariablesDirectly()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.static MPSCommandBufferalloc()static MPSCommandBufferallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(@NotNull java.lang.String key)@Nullable MTLBlitCommandEncoderblitCommandEncoder()blitCommandEncoder returns a blit command encoder to encode into this command buffer.@Nullable MTLBlitCommandEncoderblitCommandEncoderWithDescriptor(@NotNull MTLBlitPassDescriptor blitPassDescriptor)blitCommandEncoderWithDescriptor: returns a blit command endcoder to encode into this command buffer.static voidcancelPreviousPerformRequestsWithTarget(@NotNull java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull java.lang.Object aTarget, @NotNull org.moe.natj.objc.SEL aSelector, @Nullable java.lang.Object anArgument)static @NotNull NSArray<java.lang.String>classFallbacksForKeyedArchiver()static @NotNull org.moe.natj.objc.ClassclassForKeyedUnarchiver()@NotNull MTLCommandBuffercommandBuffer()[@property] commandBuffer The Metal Command Buffer that was used to initialize this object.static MPSCommandBuffercommandBufferFromCommandQueue(@NotNull MTLCommandQueue commandQueue)Initializes a MPSCommandBuffer object from a given command queue.static MPSCommandBuffercommandBufferWithCommandBuffer(@NotNull MTLCommandBuffer commandBuffer)Initializes a MPSCommandBuffer object with given MTLCommandBuffer.@NotNull 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.voidcommitAndContinue()Commit work encoded so far and continue with a new underlying command buffer This method commits the underlying root MTLCommandBuffer, and makes a new one on the same command queue.@Nullable MTLComputeCommandEncodercomputeCommandEncoder()computeCommandEncoder returns a compute command encoder to encode into this command buffer.@Nullable MTLComputeCommandEncodercomputeCommandEncoderWithDescriptor(@NotNull MTLComputePassDescriptor computePassDescriptor)computeCommandEncoderWithDescriptor: returns a compute command endcoder to encode into this command buffer.@Nullable MTLComputeCommandEncodercomputeCommandEncoderWithDispatchType(long dispatchType)computeCommandEncoderWithDispatchType returns a compute command encoder to encode into this command buffer.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()@NotNull MTLDevicedevice()[@property] device The device this resource was created against.voidencodeSignalEventValue(@NotNull MTLEvent event, long value)encodeSignalEvent:value: Encodes a command that signals an event with a given value.voidencodeWaitForEventValue(@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.voidenqueue()enqueue Append this command buffer to the end of its MTLCommandQueue.@Nullable 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.static longhash_static()@Nullable MPSHeapProviderheapProvider()[@property] heapProvider A application supplied object to allocate MTLHeaps for MPS By default this is nil, which will use MPS' device level global heap cache to allocate the heaps.MPSCommandBufferinit()MPSCommandBufferinitWithCommandBuffer(@NotNull MTLCommandBuffer commandBuffer)Initializes an empty MPSCommandBuffer object with given MTLCommandBuffer.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)doublekernelEndTime()API-Since: 10.3doublekernelStartTime()API-Since: 10.3static @NotNull NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(@NotNull java.lang.String key)@Nullable java.lang.Stringlabel()[@property] label A string to help identify this object.@NotNull MTLLogContainerlogs()[@property] logs Logs generated by the command buffer during execution of the GPU commands.static MPSCommandBuffernew_objc()@Nullable MTLParallelRenderCommandEncoderparallelRenderCommandEncoderWithDescriptor(@NotNull 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.@Nullable MPSPredicatepredicate()[@property] predicate A GPU predicate object.voidprefetchHeapForWorkloadSize(long size)Prefetch heap into the MPS command buffer heap cache.voidpresentDrawable(@NotNull MTLDrawable drawable)presentDrawable: Add a drawable present that will be invoked when this command buffer has been scheduled for execution.voidpresentDrawableAfterMinimumDuration(@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.voidpresentDrawableAtTime(@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.voidpushDebugGroup(@NotNull java.lang.String string)pushDebugGroup: Push a new named string onto a stack of string labels.@Nullable MTLRenderCommandEncoderrenderCommandEncoderWithDescriptor(@NotNull MTLRenderPassDescriptor renderPassDescriptor)renderCommandEncoderWithDescriptor: returns a render command endcoder to encode into this command buffer.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)@Nullable MTLResourceStateCommandEncoderresourceStateCommandEncoder()API-Since: 13.0@Nullable MTLResourceStateCommandEncoderresourceStateCommandEncoderWithDescriptor(@NotNull MTLResourceStatePassDescriptor resourceStatePassDescriptor)API-Since: 14.0booleanretainedReferences()[@property] retainedReferences If YES, this command buffer holds strong references to objects needed to execute this command buffer.@NotNull MTLCommandBufferrootCommandBuffer()[@property] rootCommandBuffer The base MTLCommandBuffer underlying the MPSCommandBuffer MPSCommandBuffers may wrap other MPSCommandBuffers, in the process creating what is in effect a stack of predicate objects that may be pushed or popped by making new MPSCommandBuffers or by calling -commandBuffer.voidsetHeapProvider(@Nullable MPSHeapProvider value)[@property] heapProvider A application supplied object to allocate MTLHeaps for MPS By default this is nil, which will use MPS' device level global heap cache to allocate the heaps.voidsetLabel(@Nullable java.lang.String value)[@property] label A string to help identify this object.voidsetPredicate(@Nullable MPSPredicate value)[@property] predicate A GPU predicate object.static voidsetVersion_static(long aVersion)longstatus()[@property] status status reports the current stage in the lifetime of MTLCommandBuffer, as it proceeds to enqueued, committed, scheduled, and completed.static org.moe.natj.objc.Classsuperclass_static()static booleanuseStoredAccessor()Deprecated.static longversion_static()voidwaitUntilCompleted()waitUntilCompleted Synchronously wait for this command buffer to complete.voidwaitUntilScheduled()waitUntilScheduled Synchronously wait for this command buffer to be scheduled.-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivateBlock, accessibilityActivationPoint, accessibilityActivationPointBlock, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedHintBlock, accessibilityAttributedLabel, accessibilityAttributedLabelBlock, accessibilityAttributedUserInputLabels, accessibilityAttributedUserInputLabelsBlock, accessibilityAttributedValue, accessibilityAttributedValueBlock, accessibilityContainerType, accessibilityContainerTypeBlock, accessibilityCustomActions, accessibilityCustomActionsBlock, accessibilityCustomRotors, accessibilityCustomRotorsBlock, accessibilityDecrement, accessibilityDecrementBlock, accessibilityDirectTouchOptions, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsBlock, accessibilityElementsHidden, accessibilityElementsHiddenBlock, accessibilityFrame, accessibilityFrameBlock, accessibilityHeaderElementsBlock, accessibilityHint, accessibilityHintBlock, accessibilityIdentifierBlock, accessibilityIncrement, accessibilityIncrementBlock, accessibilityLabel, accessibilityLabelBlock, accessibilityLanguage, accessibilityLanguageBlock, accessibilityMagicTapBlock, accessibilityNavigationStyle, accessibilityNavigationStyleBlock, accessibilityPath, accessibilityPathBlock, accessibilityPerformEscape, accessibilityPerformEscapeBlock, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityRespondsToUserInteractionBlock, accessibilityScroll, accessibilityShouldGroupAccessibilityChildrenBlock, accessibilityTextualContext, accessibilityTextualContextBlock, accessibilityTraits, accessibilityTraitsBlock, accessibilityUserInputLabels, accessibilityUserInputLabelsBlock, accessibilityValue, accessibilityValueBlock, accessibilityViewIsModal, accessibilityViewIsModalBlock, accessibilityZoomInAtPoint, accessibilityZoomOutAtPoint, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, automationElements, automationElementsBlock, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hash, indexOfAccessibilityElement, isAccessibilityElement, isAccessibilityElementBlock, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivateBlock, setAccessibilityActivationPoint, setAccessibilityActivationPointBlock, setAccessibilityAttributedHint, setAccessibilityAttributedHintBlock, setAccessibilityAttributedLabel, setAccessibilityAttributedLabelBlock, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedUserInputLabelsBlock, setAccessibilityAttributedValue, setAccessibilityAttributedValueBlock, setAccessibilityContainerType, setAccessibilityContainerTypeBlock, setAccessibilityCustomActions, setAccessibilityCustomActionsBlock, setAccessibilityCustomRotors, setAccessibilityCustomRotorsBlock, setAccessibilityDecrementBlock, setAccessibilityDirectTouchOptions, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsBlock, setAccessibilityElementsHidden, setAccessibilityElementsHiddenBlock, setAccessibilityFrame, setAccessibilityFrameBlock, setAccessibilityHeaderElementsBlock, setAccessibilityHint, setAccessibilityHintBlock, setAccessibilityIdentifierBlock, setAccessibilityIncrementBlock, setAccessibilityLabel, setAccessibilityLabelBlock, setAccessibilityLanguage, setAccessibilityLanguageBlock, setAccessibilityMagicTapBlock, setAccessibilityNavigationStyle, setAccessibilityNavigationStyleBlock, setAccessibilityPath, setAccessibilityPathBlock, setAccessibilityPerformEscapeBlock, setAccessibilityRespondsToUserInteraction, setAccessibilityRespondsToUserInteractionBlock, setAccessibilityShouldGroupAccessibilityChildrenBlock, setAccessibilityTextualContext, setAccessibilityTextualContextBlock, setAccessibilityTraits, setAccessibilityTraitsBlock, setAccessibilityUserInputLabels, setAccessibilityUserInputLabelsBlock, setAccessibilityValue, setAccessibilityValueBlock, setAccessibilityViewIsModal, setAccessibilityViewIsModalBlock, setAutomationElements, setAutomationElementsBlock, setIsAccessibilityElement, setIsAccessibilityElementBlock, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, storedValueForKey, superclass, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, unableToSetNilForKey, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, valuesForKeys, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
GPUEndTime
public double GPUEndTime()
Description copied from interface:MTLCommandBuffer[@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- Specified by:
GPUEndTimein interfaceMTLCommandBuffer
-
GPUStartTime
public double GPUStartTime()
Description copied from interface:MTLCommandBuffer[@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- Specified by:
GPUStartTimein interfaceMTLCommandBuffer
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
addCompletedHandler
public void addCompletedHandler(@NotNull MTLCommandBuffer.Block_addCompletedHandler block)Description copied from interface:MTLCommandBufferaddCompletedHandler:block: Add a block to be called when this command buffer has completed execution.- Specified by:
addCompletedHandlerin interfaceMTLCommandBuffer
-
addScheduledHandler
public void addScheduledHandler(@NotNull MTLCommandBuffer.Block_addScheduledHandler block)Description copied from interface:MTLCommandBufferaddScheduledHandler:block: Adds a block to be called when this command buffer has been scheduled for execution.- Specified by:
addScheduledHandlerin interfaceMTLCommandBuffer
-
alloc
public static MPSCommandBuffer alloc()
-
allocWithZone
public static MPSCommandBuffer allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(@NotNull @NotNull java.lang.String key)
-
blitCommandEncoder
@Nullable public @Nullable MTLBlitCommandEncoder blitCommandEncoder()
Description copied from interface:MTLCommandBufferblitCommandEncoder returns a blit command encoder to encode into this command buffer.- Specified by:
blitCommandEncoderin interfaceMTLCommandBuffer
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(@NotNull @NotNull java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull @NotNull java.lang.Object aTarget, @NotNull @NotNull org.moe.natj.objc.SEL aSelector, @Nullable @Nullable java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
@NotNull public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
@NotNull public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
-
commandBuffer
@NotNull public @NotNull MTLCommandBuffer commandBuffer()
[@property] commandBuffer The Metal Command Buffer that was used to initialize this object.
-
commandBufferFromCommandQueue
public static MPSCommandBuffer commandBufferFromCommandQueue(@NotNull @NotNull MTLCommandQueue commandQueue)
Initializes a MPSCommandBuffer object from a given command queue.- Returns:
- A pointer to the newly initialized MPSCommandBuffer object.
-
commandBufferWithCommandBuffer
public static MPSCommandBuffer commandBufferWithCommandBuffer(@NotNull @NotNull MTLCommandBuffer commandBuffer)
Initializes a MPSCommandBuffer object with given MTLCommandBuffer. Once we create this MPSCommandBuffer, any methods utilizing it could call commitAndContinue and so the users original commandBuffer may have been committed. Please use the rootCommandBuffer method to get the current alive underlying MTLCommandBuffer.- Returns:
- A pointer to the newly initialized MPSCommandBuffer object.
-
commandQueue
@NotNull public @NotNull MTLCommandQueue commandQueue()
Description copied from interface:MTLCommandBuffer[@property] commandQueue The command queue this command buffer was created from.- Specified by:
commandQueuein interfaceMTLCommandBuffer
-
commit
public void commit()
Description copied from interface:MTLCommandBuffercommit Commit a command buffer so it can be executed as soon as possible.- Specified by:
commitin interfaceMTLCommandBuffer
-
commitAndContinue
public void commitAndContinue()
Commit work encoded so far and continue with a new underlying command buffer This method commits the underlying root MTLCommandBuffer, and makes a new one on the same command queue. The MPS heap is moved forward to the new command buffer such that temporary objects used by the previous command buffer can be still be used with the new one. This provides a way to move work already encoded into consideration by the Metal back end sooner. For large workloads, e.g. a neural networking graph periodically calling -commitAndContinue may allow you to improve CPU / GPU parallelism without the substantial memory increases associated with double buffering. It will also help decrease overall latency. Any Metal schedule or completion callbacks previously attached to this object will remain attached to the old command buffer and will fire as expected as the old command buffer is scheduled and completes. If your application is relying on such callbacks to coordinate retain / release of important objects that are needed for work encoded after -commitAndContinue, your application should retain these objects before calling commitAndContinue, and attach new release callbacks to this object with a new completion handler so that they persist through the lifetime of the new underlying command buffer. You may do this, for example by adding the objects to a mutable array before calling -commitAndContinue, then release the mutable array in a new completion callback added after -commitAndContinue. Because -commitAndContinue commits the old command buffer then switches to a new one, some aspects of command buffer completion may surprise unwary developers. For example, -waitUntilCompleted called immediately after -commitAndContinue asks Metal to wait for the new command buffer to finish, not the old one. Since the new command buffer presumably hasn't been committed yet, it is formally a deadlock, resources may leak and Metal may complain. Your application should ether call -commit before -waitUntilCompleted, or capture the -rootCommandBuffer from before the call to -commitAndContinue and wait on that. Similarly, your application should be sure to use the appropriate command buffer when querying the [MTLCommandBuffer status] property. If the underlying MTLCommandBuffer also implements -commitAndContinue, then the message will be forwarded to that object instead. In this way, underlying predicate objects and other state will be preserved.
-
computeCommandEncoder
@Nullable public @Nullable MTLComputeCommandEncoder computeCommandEncoder()
Description copied from interface:MTLCommandBuffercomputeCommandEncoder returns a compute command encoder to encode into this command buffer.- Specified by:
computeCommandEncoderin interfaceMTLCommandBuffer
-
computeCommandEncoderWithDispatchType
@Nullable public @Nullable MTLComputeCommandEncoder computeCommandEncoderWithDispatchType(long dispatchType)
Description copied from interface:MTLCommandBuffercomputeCommandEncoderWithDispatchType 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- Specified by:
computeCommandEncoderWithDispatchTypein interfaceMTLCommandBuffer
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
device
@NotNull public @NotNull MTLDevice device()
Description copied from interface:MTLCommandBuffer[@property] device The device this resource was created against.- Specified by:
devicein interfaceMTLCommandBuffer
-
encodeSignalEventValue
public void encodeSignalEventValue(@NotNull @NotNull MTLEvent event, long value)Description copied from interface:MTLCommandBufferencodeSignalEvent: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- Specified by:
encodeSignalEventValuein interfaceMTLCommandBuffer
-
encodeWaitForEventValue
public void encodeWaitForEventValue(@NotNull @NotNull MTLEvent event, long value)Description copied from interface:MTLCommandBufferencodeWaitForEvent: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- Specified by:
encodeWaitForEventValuein interfaceMTLCommandBuffer
-
enqueue
public void enqueue()
Description copied from interface:MTLCommandBufferenqueue Append this command buffer to the end of its MTLCommandQueue.- Specified by:
enqueuein interfaceMTLCommandBuffer
-
error
@Nullable public @Nullable NSError error()
Description copied from interface:MTLCommandBuffer[@property] error If an error occurred during execution, the NSError may contain more details about the problem.- Specified by:
errorin interfaceMTLCommandBuffer
-
hash_static
public static long hash_static()
-
heapProvider
@Nullable public @Nullable MPSHeapProvider heapProvider()
[@property] heapProvider A application supplied object to allocate MTLHeaps for MPS By default this is nil, which will use MPS' device level global heap cache to allocate the heaps. This is a reasonable choice. However, it may be inefficient if you are keeping your own MTLHeap, since there will be two pessimistically sized free stores which may be larger than is strictly necessary, and of course fragmentation across multiple heaps. In such cases, the problem may be solved either by using MPS' automatically managed heap (simple) or having MPS use your heap. The heapProvider allows you to implement the second case. To use the MPS heap, simply make temporary MPSImages, vectors and matrices. If multiple MPSCommandBuffers reference the same MTLCommandBuffer, changing the heapProvider on one will change the heap provider for all of them.
-
init
public MPSCommandBuffer init()
-
initWithCommandBuffer
public MPSCommandBuffer initWithCommandBuffer(@NotNull @NotNull MTLCommandBuffer commandBuffer)
Initializes an empty MPSCommandBuffer object with given MTLCommandBuffer. Once we create this MPSCommandBuffer, any methods utilizing it could call commitAndContinue and so the users original commandBuffer may have been committed. Please use the rootCommandBuffer method to get the current alive underlying MTLCommandBuffer.- Returns:
- A pointer to the newly initialized MPSCommandBuffer object.
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
kernelEndTime
public double kernelEndTime()
Description copied from interface:MTLCommandBufferAPI-Since: 10.3- Specified by:
kernelEndTimein interfaceMTLCommandBuffer
-
kernelStartTime
public double kernelStartTime()
Description copied from interface:MTLCommandBufferAPI-Since: 10.3- Specified by:
kernelStartTimein interfaceMTLCommandBuffer
-
keyPathsForValuesAffectingValueForKey
@NotNull public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(@NotNull @NotNull java.lang.String key)
-
label
@Nullable public @Nullable java.lang.String label()
Description copied from interface:MTLCommandBuffer[@property] label A string to help identify this object.- Specified by:
labelin interfaceMTLCommandBuffer
-
new_objc
public static MPSCommandBuffer new_objc()
-
parallelRenderCommandEncoderWithDescriptor
@Nullable public @Nullable MTLParallelRenderCommandEncoder parallelRenderCommandEncoderWithDescriptor(@NotNull @NotNull MTLRenderPassDescriptor renderPassDescriptor)
Description copied from interface:MTLCommandBufferparallelRenderCommandEncoderWithDescriptor: returns a parallel render pass encoder to encode into this command buffer.- Specified by:
parallelRenderCommandEncoderWithDescriptorin interfaceMTLCommandBuffer
-
popDebugGroup
public void popDebugGroup()
Description copied from interface:MTLCommandBufferpopDebugGroup Pop the latest named string off of the stack. API-Since: 11.0- Specified by:
popDebugGroupin interfaceMTLCommandBuffer
-
predicate
@Nullable public @Nullable MPSPredicate predicate()
[@property] predicate A GPU predicate object. Default: nil.
-
prefetchHeapForWorkloadSize
public void prefetchHeapForWorkloadSize(long size)
Prefetch heap into the MPS command buffer heap cache. If there is not sufficient free storage in the MPS heap for the command buffer for allocations of total size size, pre-warm the MPS heap with a new MTLHeap allocation of sufficient size. If this size turns out to be too small MPS may ask for more heaps later to cover additional allocations. If heapProvider is not nil, the heapProvider will be used.- Parameters:
size- The minimum size of the free store needed
-
presentDrawable
public void presentDrawable(@NotNull @NotNull MTLDrawable drawable)Description copied from interface:MTLCommandBufferpresentDrawable: 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- Specified by:
presentDrawablein interfaceMTLCommandBuffer
-
presentDrawableAfterMinimumDuration
public void presentDrawableAfterMinimumDuration(@NotNull @NotNull MTLDrawable drawable, double duration)Description copied from interface:MTLCommandBufferpresentDrawable: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- Specified by:
presentDrawableAfterMinimumDurationin interfaceMTLCommandBuffer- 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.
-
presentDrawableAtTime
public void presentDrawableAtTime(@NotNull @NotNull MTLDrawable drawable, double presentationTime)Description copied from interface:MTLCommandBufferpresentDrawable: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- Specified by:
presentDrawableAtTimein interfaceMTLCommandBuffer
-
pushDebugGroup
public void pushDebugGroup(@NotNull @NotNull java.lang.String string)Description copied from interface:MTLCommandBufferpushDebugGroup: Push a new named string onto a stack of string labels. API-Since: 11.0- Specified by:
pushDebugGroupin interfaceMTLCommandBuffer
-
renderCommandEncoderWithDescriptor
@Nullable public @Nullable MTLRenderCommandEncoder renderCommandEncoderWithDescriptor(@NotNull @NotNull MTLRenderPassDescriptor renderPassDescriptor)
Description copied from interface:MTLCommandBufferrenderCommandEncoderWithDescriptor: returns a render command endcoder to encode into this command buffer.- Specified by:
renderCommandEncoderWithDescriptorin interfaceMTLCommandBuffer
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
resourceStateCommandEncoder
@Nullable public @Nullable MTLResourceStateCommandEncoder resourceStateCommandEncoder()
Description copied from interface:MTLCommandBufferAPI-Since: 13.0- Specified by:
resourceStateCommandEncoderin interfaceMTLCommandBuffer
-
retainedReferences
public boolean retainedReferences()
Description copied from interface:MTLCommandBuffer[@property] retainedReferences If YES, this command buffer holds strong references to objects needed to execute this command buffer.- Specified by:
retainedReferencesin interfaceMTLCommandBuffer
-
rootCommandBuffer
@NotNull public @NotNull MTLCommandBuffer rootCommandBuffer()
[@property] rootCommandBuffer The base MTLCommandBuffer underlying the MPSCommandBuffer MPSCommandBuffers may wrap other MPSCommandBuffers, in the process creating what is in effect a stack of predicate objects that may be pushed or popped by making new MPSCommandBuffers or by calling -commandBuffer. In some circumstances, it is preferable to use the root command buffer, particularly when trying to identify the command buffer that will be commited by -commitAndContinue.
-
setHeapProvider
public void setHeapProvider(@Nullable @Nullable MPSHeapProvider value)[@property] heapProvider A application supplied object to allocate MTLHeaps for MPS By default this is nil, which will use MPS' device level global heap cache to allocate the heaps. This is a reasonable choice. However, it may be inefficient if you are keeping your own MTLHeap, since there will be two pessimistically sized free stores which may be larger than is strictly necessary, and of course fragmentation across multiple heaps. In such cases, the problem may be solved either by using MPS' automatically managed heap (simple) or having MPS use your heap. The heapProvider allows you to implement the second case. To use the MPS heap, simply make temporary MPSImages, vectors and matrices. If multiple MPSCommandBuffers reference the same MTLCommandBuffer, changing the heapProvider on one will change the heap provider for all of them.
-
setLabel
public void setLabel(@Nullable @Nullable java.lang.String value)Description copied from interface:MTLCommandBuffer[@property] label A string to help identify this object.- Specified by:
setLabelin interfaceMTLCommandBuffer
-
setPredicate
public void setPredicate(@Nullable @Nullable MPSPredicate value)[@property] predicate A GPU predicate object. Default: nil.
-
setVersion_static
public static void setVersion_static(long aVersion)
-
status
public long status()
Description copied from interface:MTLCommandBuffer[@property] status status reports the current stage in the lifetime of MTLCommandBuffer, as it proceeds to enqueued, committed, scheduled, and completed.- Specified by:
statusin interfaceMTLCommandBuffer
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
waitUntilCompleted
public void waitUntilCompleted()
Description copied from interface:MTLCommandBufferwaitUntilCompleted Synchronously wait for this command buffer to complete.- Specified by:
waitUntilCompletedin interfaceMTLCommandBuffer
-
waitUntilScheduled
public void waitUntilScheduled()
Description copied from interface:MTLCommandBufferwaitUntilScheduled Synchronously wait for this command buffer to be scheduled.- Specified by:
waitUntilScheduledin interfaceMTLCommandBuffer
-
accelerationStructureCommandEncoder
@Nullable public @Nullable MTLAccelerationStructureCommandEncoder accelerationStructureCommandEncoder()
Description copied from interface:MTLCommandBufferAPI-Since: 14.0- Specified by:
accelerationStructureCommandEncoderin interfaceMTLCommandBuffer
-
blitCommandEncoderWithDescriptor
@Nullable public @Nullable MTLBlitCommandEncoder blitCommandEncoderWithDescriptor(@NotNull @NotNull MTLBlitPassDescriptor blitPassDescriptor)
Description copied from interface:MTLCommandBufferblitCommandEncoderWithDescriptor: returns a blit command endcoder to encode into this command buffer. API-Since: 14.0- Specified by:
blitCommandEncoderWithDescriptorin interfaceMTLCommandBuffer
-
computeCommandEncoderWithDescriptor
@Nullable public @Nullable MTLComputeCommandEncoder computeCommandEncoderWithDescriptor(@NotNull @NotNull MTLComputePassDescriptor computePassDescriptor)
Description copied from interface:MTLCommandBuffercomputeCommandEncoderWithDescriptor: returns a compute command endcoder to encode into this command buffer. API-Since: 14.0- Specified by:
computeCommandEncoderWithDescriptorin interfaceMTLCommandBuffer
-
errorOptions
public long errorOptions()
Description copied from interface:MTLCommandBufferThe set of options configuring the error reporting of the created command buffer. API-Since: 14.0- Specified by:
errorOptionsin interfaceMTLCommandBuffer
-
logs
@NotNull public @NotNull MTLLogContainer logs()
Description copied from interface:MTLCommandBuffer[@property] logs Logs generated by the command buffer during execution of the GPU commands. Valid after GPU execution is completed API-Since: 14.0- Specified by:
logsin interfaceMTLCommandBuffer
-
resourceStateCommandEncoderWithDescriptor
@Nullable public @Nullable MTLResourceStateCommandEncoder resourceStateCommandEncoderWithDescriptor(@NotNull @NotNull MTLResourceStatePassDescriptor resourceStatePassDescriptor)
Description copied from interface:MTLCommandBufferAPI-Since: 14.0- Specified by:
resourceStateCommandEncoderWithDescriptorin interfaceMTLCommandBuffer
-
accelerationStructureCommandEncoderWithDescriptor
@NotNull public @NotNull MTLAccelerationStructureCommandEncoder accelerationStructureCommandEncoderWithDescriptor(@NotNull @NotNull MTLAccelerationStructurePassDescriptor descriptor)
Description copied from interface:MTLCommandBufferAPI-Since: 16.0- Specified by:
accelerationStructureCommandEncoderWithDescriptorin interfaceMTLCommandBuffer
-
useStoredAccessor
@Deprecated public static boolean useStoredAccessor()
Deprecated.
-
-