pub unsafe trait MTLComputeCommandEncoder: MTLCommandEncoder {
Show 39 methods
// Provided methods
fn dispatchType(&self) -> MTLDispatchType
where Self: Sized + Message { ... }
fn setComputePipelineState(
&self,
state: &ProtocolObject<dyn MTLComputePipelineState>,
)
where Self: Sized + Message { ... }
unsafe fn setBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setBufferOffset_atIndex(
&self,
offset: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setBuffer_offset_attributeStride_atIndex(
&self,
buffer: &ProtocolObject<dyn MTLBuffer>,
offset: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setBuffers_offsets_attributeStrides_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
strides: NonNull<NSUInteger>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setBufferOffset_attributeStride_atIndex(
&self,
offset: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setBytes_length_attributeStride_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setVisibleFunctionTable_atBufferIndex(
&self,
visible_function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>,
buffer_index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setVisibleFunctionTables_withBufferRange(
&self,
visible_function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setIntersectionFunctionTable_atBufferIndex(
&self,
intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>,
buffer_index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setIntersectionFunctionTables_withBufferRange(
&self,
intersection_function_tables: NonNull<*const ProtocolObject<dyn MTLIntersectionFunctionTable>>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setAccelerationStructure_atBufferIndex(
&self,
acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>,
buffer_index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn setSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setThreadgroupMemoryLength_atIndex(
&self,
length: NSUInteger,
index: NSUInteger,
)
where Self: Sized + Message { ... }
fn setImageblockWidth_height(&self, width: NSUInteger, height: NSUInteger)
where Self: Sized + Message { ... }
fn setStageInRegion(&self, region: MTLRegion)
where Self: Sized + Message { ... }
unsafe fn setStageInRegionWithIndirectBuffer_indirectBufferOffset(
&self,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
)
where Self: Sized + Message { ... }
fn dispatchThreadgroups_threadsPerThreadgroup(
&self,
threadgroups_per_grid: MTLSize,
threads_per_threadgroup: MTLSize,
)
where Self: Sized + Message { ... }
unsafe fn dispatchThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerThreadgroup(
&self,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
threads_per_threadgroup: MTLSize,
)
where Self: Sized + Message { ... }
fn dispatchThreads_threadsPerThreadgroup(
&self,
threads_per_grid: MTLSize,
threads_per_threadgroup: MTLSize,
)
where Self: Sized + Message { ... }
fn updateFence(&self, fence: &ProtocolObject<dyn MTLFence>)
where Self: Sized + Message { ... }
fn waitForFence(&self, fence: &ProtocolObject<dyn MTLFence>)
where Self: Sized + Message { ... }
fn useResource_usage(
&self,
resource: &ProtocolObject<dyn MTLResource>,
usage: MTLResourceUsage,
)
where Self: Sized + Message { ... }
unsafe fn useResources_count_usage(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
usage: MTLResourceUsage,
)
where Self: Sized + Message { ... }
fn useHeap(&self, heap: &ProtocolObject<dyn MTLHeap>)
where Self: Sized + Message { ... }
unsafe fn useHeaps_count(
&self,
heaps: NonNull<NonNull<ProtocolObject<dyn MTLHeap>>>,
count: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn executeCommandsInBuffer_withRange(
&self,
indirect_command_buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>,
execution_range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn executeCommandsInBuffer_indirectBuffer_indirectBufferOffset(
&self,
indirect_commandbuffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>,
indirect_range_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
)
where Self: Sized + Message { ... }
fn memoryBarrierWithScope(&self, scope: MTLBarrierScope)
where Self: Sized + Message { ... }
unsafe fn memoryBarrierWithResources_count(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
)
where Self: Sized + Message { ... }
unsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier(
&self,
sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>,
sample_index: NSUInteger,
barrier: bool,
)
where Self: Sized + Message { ... }
}MTLCommandEncoder and MTLComputeCommandEncoder only.Expand description
A command encoder that writes data parallel compute commands.
See also Apple’s documentation
Provided Methods§
Sourcefn dispatchType(&self) -> MTLDispatchType
Available on crate feature MTLCommandBuffer only.
fn dispatchType(&self) -> MTLDispatchType
MTLCommandBuffer only.The dispatch type of the compute command encoder.
Sourcefn setComputePipelineState(
&self,
state: &ProtocolObject<dyn MTLComputePipelineState>,
)
Available on crate features MTLAllocation and MTLComputePipeline only.
fn setComputePipelineState( &self, state: &ProtocolObject<dyn MTLComputePipelineState>, )
MTLAllocation and MTLComputePipeline only.Set the compute pipeline state that will be used.
Sourceunsafe fn setBytes_length_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
index: NSUInteger,
)
unsafe fn setBytes_length_atIndex( &self, bytes: NonNull<c_void>, length: NSUInteger, index: NSUInteger, )
Set the data (by copy) for a given buffer binding point. This will remove any existing MTLBuffer from the binding point.
§Safety
bytesmust be a valid pointer.indexmight not be bounds-checked.
Sourceunsafe fn setBuffer_offset_atIndex(
&self,
buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
offset: NSUInteger,
index: NSUInteger,
)
Available on crate features MTLAllocation and MTLBuffer and MTLResource only.
unsafe fn setBuffer_offset_atIndex( &self, buffer: Option<&ProtocolObject<dyn MTLBuffer>>, offset: NSUInteger, index: NSUInteger, )
MTLAllocation and MTLBuffer and MTLResource only.Set a global buffer for all compute kernels at the given bind point index.
§Safety
buffermay need to be synchronized.buffermay be unretained, you must ensure it is kept alive while in use.buffercontents should be of the correct type.offsetmight not be bounds-checked.indexmight not be bounds-checked.
Sourceunsafe fn setBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger)
unsafe fn setBufferOffset_atIndex(&self, offset: NSUInteger, index: NSUInteger)
Set the offset within the current global buffer for all compute kernels at the given bind point index.
§Safety
offsetmight not be bounds-checked.indexmight not be bounds-checked.
Sourceunsafe fn setBuffers_offsets_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
range: NSRange,
)
Available on crate features MTLAllocation and MTLBuffer and MTLResource only.
unsafe fn setBuffers_offsets_withRange( &self, buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>, offsets: NonNull<NSUInteger>, range: NSRange, )
MTLAllocation and MTLBuffer and MTLResource only.Set an array of global buffers for all compute kernels with the given bind point range.
§Safety
buffersmust be a valid pointer.offsetsmight not be bounds-checked.offsetsmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setBuffer_offset_attributeStride_atIndex(
&self,
buffer: &ProtocolObject<dyn MTLBuffer>,
offset: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
)
Available on crate features MTLAllocation and MTLBuffer and MTLResource only.
unsafe fn setBuffer_offset_attributeStride_atIndex( &self, buffer: &ProtocolObject<dyn MTLBuffer>, offset: NSUInteger, stride: NSUInteger, index: NSUInteger, )
MTLAllocation and MTLBuffer and MTLResource only.sets kernel buffer at specified index with provided offset and stride.
only call this when the kernel-buffer is part of the stageInputDescriptor
and has set its stride to MTLBufferLayoutStrideDynamic
§Safety
buffermay need to be synchronized.buffermay be unretained, you must ensure it is kept alive while in use.buffercontents should be of the correct type.offsetmight not be bounds-checked.stridemight not be bounds-checked.indexmight not be bounds-checked.
Sourceunsafe fn setBuffers_offsets_attributeStrides_withRange(
&self,
buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>,
offsets: NonNull<NSUInteger>,
strides: NonNull<NSUInteger>,
range: NSRange,
)
Available on crate features MTLAllocation and MTLBuffer and MTLResource only.
unsafe fn setBuffers_offsets_attributeStrides_withRange( &self, buffers: NonNull<*const ProtocolObject<dyn MTLBuffer>>, offsets: NonNull<NSUInteger>, strides: NonNull<NSUInteger>, range: NSRange, )
MTLAllocation and MTLBuffer and MTLResource only.sets an array of kernel buffers with provided offsets and strides with the
given bind point range. Only call this when at least one buffer is part of
the vertexDescriptor, other buffers must set MTLAttributeStrideStatic
§Safety
buffersmust be a valid pointer.offsetsmight not be bounds-checked.offsetsmust be a valid pointer.stridesmight not be bounds-checked.stridesmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setBufferOffset_attributeStride_atIndex(
&self,
offset: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
)
unsafe fn setBufferOffset_attributeStride_atIndex( &self, offset: NSUInteger, stride: NSUInteger, index: NSUInteger, )
only call this when the buffer-index is part of the stageInputDescriptor
and has set its stride to MTLBufferLayoutStrideDynamic
§Safety
offsetmight not be bounds-checked.stridemight not be bounds-checked.indexmight not be bounds-checked.
Sourceunsafe fn setBytes_length_attributeStride_atIndex(
&self,
bytes: NonNull<c_void>,
length: NSUInteger,
stride: NSUInteger,
index: NSUInteger,
)
unsafe fn setBytes_length_attributeStride_atIndex( &self, bytes: NonNull<c_void>, length: NSUInteger, stride: NSUInteger, index: NSUInteger, )
only call this when the buffer-index is part of the stageInputDescriptor
and has set its stride to MTLBufferLayoutStrideDynamic
§Safety
bytesmust be a valid pointer.stridemight not be bounds-checked.indexmight not be bounds-checked.
Sourceunsafe fn setVisibleFunctionTable_atBufferIndex(
&self,
visible_function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>,
buffer_index: NSUInteger,
)
Available on crate features MTLAllocation and MTLResource and MTLVisibleFunctionTable only.
unsafe fn setVisibleFunctionTable_atBufferIndex( &self, visible_function_table: Option<&ProtocolObject<dyn MTLVisibleFunctionTable>>, buffer_index: NSUInteger, )
MTLAllocation and MTLResource and MTLVisibleFunctionTable only.Set a visible function table at the given buffer index
§Safety
visible_function_tablemay need to be synchronized.visible_function_tablemay be unretained, you must ensure it is kept alive while in use.bufferIndexmight not be bounds-checked.
Sourceunsafe fn setVisibleFunctionTables_withBufferRange(
&self,
visible_function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>,
range: NSRange,
)
Available on crate features MTLAllocation and MTLResource and MTLVisibleFunctionTable only.
unsafe fn setVisibleFunctionTables_withBufferRange( &self, visible_function_tables: NonNull<*const ProtocolObject<dyn MTLVisibleFunctionTable>>, range: NSRange, )
MTLAllocation and MTLResource and MTLVisibleFunctionTable only.Set visible function tables at the given buffer index range
§Safety
visible_function_tablesmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setIntersectionFunctionTable_atBufferIndex(
&self,
intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>,
buffer_index: NSUInteger,
)
Available on crate features MTLAllocation and MTLIntersectionFunctionTable and MTLResource only.
unsafe fn setIntersectionFunctionTable_atBufferIndex( &self, intersection_function_table: Option<&ProtocolObject<dyn MTLIntersectionFunctionTable>>, buffer_index: NSUInteger, )
MTLAllocation and MTLIntersectionFunctionTable and MTLResource only.Set a visible function table at the given buffer index
§Safety
intersection_function_tablemay need to be synchronized.intersection_function_tablemay be unretained, you must ensure it is kept alive while in use.bufferIndexmight not be bounds-checked.
Sourceunsafe fn setIntersectionFunctionTables_withBufferRange(
&self,
intersection_function_tables: NonNull<*const ProtocolObject<dyn MTLIntersectionFunctionTable>>,
range: NSRange,
)
Available on crate features MTLAllocation and MTLIntersectionFunctionTable and MTLResource only.
unsafe fn setIntersectionFunctionTables_withBufferRange( &self, intersection_function_tables: NonNull<*const ProtocolObject<dyn MTLIntersectionFunctionTable>>, range: NSRange, )
MTLAllocation and MTLIntersectionFunctionTable and MTLResource only.Set visible function tables at the given buffer index range
§Safety
intersection_function_tablesmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setAccelerationStructure_atBufferIndex(
&self,
acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>,
buffer_index: NSUInteger,
)
Available on crate features MTLAccelerationStructure and MTLAllocation and MTLResource only.
unsafe fn setAccelerationStructure_atBufferIndex( &self, acceleration_structure: Option<&ProtocolObject<dyn MTLAccelerationStructure>>, buffer_index: NSUInteger, )
MTLAccelerationStructure and MTLAllocation and MTLResource only.Set a global raytracing acceleration structure for all compute kernels at the given buffer bind point index.
§Safety
acceleration_structuremay need to be synchronized.acceleration_structuremay be unretained, you must ensure it is kept alive while in use.bufferIndexmight not be bounds-checked.
Sourceunsafe fn setTexture_atIndex(
&self,
texture: Option<&ProtocolObject<dyn MTLTexture>>,
index: NSUInteger,
)
Available on crate features MTLAllocation and MTLResource and MTLTexture only.
unsafe fn setTexture_atIndex( &self, texture: Option<&ProtocolObject<dyn MTLTexture>>, index: NSUInteger, )
MTLAllocation and MTLResource and MTLTexture only.Set a global texture for all compute kernels at the given bind point index.
§Safety
texturemay need to be synchronized.texturemay be unretained, you must ensure it is kept alive while in use.indexmight not be bounds-checked.
Sourceunsafe fn setTextures_withRange(
&self,
textures: NonNull<*const ProtocolObject<dyn MTLTexture>>,
range: NSRange,
)
Available on crate features MTLAllocation and MTLResource and MTLTexture only.
unsafe fn setTextures_withRange( &self, textures: NonNull<*const ProtocolObject<dyn MTLTexture>>, range: NSRange, )
MTLAllocation and MTLResource and MTLTexture only.Set an array of global textures for all compute kernels with the given bind point range.
§Safety
texturesmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setSamplerState_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
index: NSUInteger,
)
Available on crate feature MTLSampler only.
unsafe fn setSamplerState_atIndex( &self, sampler: Option<&ProtocolObject<dyn MTLSamplerState>>, index: NSUInteger, )
MTLSampler only.Set a global sampler for all compute kernels at the given bind point index.
§Safety
index might not be bounds-checked.
Sourceunsafe fn setSamplerStates_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
range: NSRange,
)
Available on crate feature MTLSampler only.
unsafe fn setSamplerStates_withRange( &self, samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>, range: NSRange, )
MTLSampler only.Set an array of global samplers for all compute kernels with the given bind point range.
§Safety
samplersmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setSamplerState_lodMinClamp_lodMaxClamp_atIndex(
&self,
sampler: Option<&ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamp: c_float,
lod_max_clamp: c_float,
index: NSUInteger,
)
Available on crate feature MTLSampler only.
unsafe fn setSamplerState_lodMinClamp_lodMaxClamp_atIndex( &self, sampler: Option<&ProtocolObject<dyn MTLSamplerState>>, lod_min_clamp: c_float, lod_max_clamp: c_float, index: NSUInteger, )
MTLSampler only.Set a global sampler for all compute kernels at the given bind point index.
§Safety
index might not be bounds-checked.
Sourceunsafe fn setSamplerStates_lodMinClamps_lodMaxClamps_withRange(
&self,
samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>,
lod_min_clamps: NonNull<c_float>,
lod_max_clamps: NonNull<c_float>,
range: NSRange,
)
Available on crate feature MTLSampler only.
unsafe fn setSamplerStates_lodMinClamps_lodMaxClamps_withRange( &self, samplers: NonNull<*const ProtocolObject<dyn MTLSamplerState>>, lod_min_clamps: NonNull<c_float>, lod_max_clamps: NonNull<c_float>, range: NSRange, )
MTLSampler only.Set an array of global samplers for all compute kernels with the given bind point range.
§Safety
samplersmust be a valid pointer.lod_min_clampsmust be a valid pointer.lod_max_clampsmust be a valid pointer.rangemight not be bounds-checked.
Sourceunsafe fn setThreadgroupMemoryLength_atIndex(
&self,
length: NSUInteger,
index: NSUInteger,
)
unsafe fn setThreadgroupMemoryLength_atIndex( &self, length: NSUInteger, index: NSUInteger, )
Set the threadgroup memory byte length at the binding point specified by the index. This applies to all compute kernels.
§Safety
index might not be bounds-checked.
Sourcefn setImageblockWidth_height(&self, width: NSUInteger, height: NSUInteger)
fn setImageblockWidth_height(&self, width: NSUInteger, height: NSUInteger)
Set imageblock sizes.
fn setStageInRegion(&self, region: MTLRegion)
MTLTypes only.Sourceunsafe fn setStageInRegionWithIndirectBuffer_indirectBufferOffset(
&self,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
)
Available on crate features MTLAllocation and MTLBuffer and MTLResource only.
unsafe fn setStageInRegionWithIndirectBuffer_indirectBufferOffset( &self, indirect_buffer: &ProtocolObject<dyn MTLBuffer>, indirect_buffer_offset: NSUInteger, )
MTLAllocation and MTLBuffer and MTLResource only.§Safety
indirect_buffermay need to be synchronized.indirect_buffermay be unretained, you must ensure it is kept alive while in use.indirect_buffercontents should be of the correct type.indirectBufferOffsetmight not be bounds-checked.
fn dispatchThreadgroups_threadsPerThreadgroup( &self, threadgroups_per_grid: MTLSize, threads_per_threadgroup: MTLSize, )
MTLTypes only.Sourceunsafe fn dispatchThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerThreadgroup(
&self,
indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
threads_per_threadgroup: MTLSize,
)
Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTypes only.
unsafe fn dispatchThreadgroupsWithIndirectBuffer_indirectBufferOffset_threadsPerThreadgroup( &self, indirect_buffer: &ProtocolObject<dyn MTLBuffer>, indirect_buffer_offset: NSUInteger, threads_per_threadgroup: MTLSize, )
MTLAllocation and MTLBuffer and MTLResource and MTLTypes only.§Safety
indirect_buffermay need to be synchronized.indirect_buffermay be unretained, you must ensure it is kept alive while in use.indirect_buffercontents should be of the correct type.indirectBufferOffsetmight not be bounds-checked.
fn dispatchThreads_threadsPerThreadgroup( &self, threads_per_grid: MTLSize, threads_per_threadgroup: MTLSize, )
MTLTypes only.Sourcefn updateFence(&self, fence: &ProtocolObject<dyn MTLFence>)
Available on crate feature MTLFence only.
fn updateFence(&self, fence: &ProtocolObject<dyn MTLFence>)
MTLFence only.Update the fence to capture all GPU work so far enqueued by this encoder.
The fence is updated at kernel submission to maintain global order and prevent deadlock. Drivers may delay fence updates until the end of the encoder. Drivers may also wait on fences at the beginning of an encoder. It is therefore illegal to wait on a fence after it has been updated in the same encoder.
Sourcefn waitForFence(&self, fence: &ProtocolObject<dyn MTLFence>)
Available on crate feature MTLFence only.
fn waitForFence(&self, fence: &ProtocolObject<dyn MTLFence>)
MTLFence only.Prevent further GPU work until the fence is reached.
The fence is evaluated at kernel submission to maintain global order and prevent deadlock. Drivers may delay fence updates until the end of the encoder. Drivers may also wait on fences at the beginning of an encoder. It is therefore illegal to wait on a fence after it has been updated in the same encoder.
Sourcefn useResource_usage(
&self,
resource: &ProtocolObject<dyn MTLResource>,
usage: MTLResourceUsage,
)
Available on crate features MTLAllocation and MTLResource only.
fn useResource_usage( &self, resource: &ProtocolObject<dyn MTLResource>, usage: MTLResourceUsage, )
MTLAllocation and MTLResource only.Declare that a resource may be accessed by the command encoder through an argument buffer
For tracked MTLResources, this method protects against data hazards. This method must be called before encoding any dispatch commands which may access the resource through an argument buffer.
Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
Sourceunsafe fn useResources_count_usage(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
usage: MTLResourceUsage,
)
Available on crate features MTLAllocation and MTLResource only.
unsafe fn useResources_count_usage( &self, resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>, count: NSUInteger, usage: MTLResourceUsage, )
MTLAllocation and MTLResource only.Declare that an array of resources may be accessed through an argument buffer by the command encoder
For tracked MTL Resources, this method protects against data hazards. This method must be called before encoding any dispatch commands which may access the resources through an argument buffer.
Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
§Safety
resourcesmust be a valid pointer.countmight not be bounds-checked.
Sourcefn useHeap(&self, heap: &ProtocolObject<dyn MTLHeap>)
Available on crate features MTLAllocation and MTLHeap only.
fn useHeap(&self, heap: &ProtocolObject<dyn MTLHeap>)
MTLAllocation and MTLHeap only.Declare that the resources allocated from a heap may be accessed as readonly by the render pass through an argument buffer
For tracked MTLHeaps, this method protects against data hazards. This method must be called before encoding any dispatch commands which may access the resources allocated from the heap through an argument buffer. This method may cause all of the color attachments allocated from the heap to become decompressed. Therefore, it is recommended that the useResource:usage: or useResources:count:usage: methods be used for color attachments instead, with a minimal (i.e. read-only) usage.
Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
Sourceunsafe fn useHeaps_count(
&self,
heaps: NonNull<NonNull<ProtocolObject<dyn MTLHeap>>>,
count: NSUInteger,
)
Available on crate features MTLAllocation and MTLHeap only.
unsafe fn useHeaps_count( &self, heaps: NonNull<NonNull<ProtocolObject<dyn MTLHeap>>>, count: NSUInteger, )
MTLAllocation and MTLHeap only.Declare that the resources allocated from an array of heaps may be accessed as readonly by the render pass through an argument buffer
For tracked MTLHeaps, this method protects against data hazards. This method must be called before encoding any dispatch commands which may access the resources allocated from the heaps through an argument buffer. This method may cause all of the color attachments allocated from the heaps to become decompressed. Therefore, it is recommended that the useResource:usage: or useResources:count:usage: methods be used for color attachments instead, with a minimal (i.e. read-only) usage.
Warning: Prior to iOS 13, macOS 10.15, this method does not protect against data hazards. If you are deploying to older versions of macOS or iOS, use fences to ensure data hazards are resolved.
§Safety
heapsmust be a valid pointer.countmight not be bounds-checked.
Sourceunsafe fn executeCommandsInBuffer_withRange(
&self,
indirect_command_buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>,
execution_range: NSRange,
)
Available on crate features MTLAllocation and MTLIndirectCommandBuffer and MTLResource only.
unsafe fn executeCommandsInBuffer_withRange( &self, indirect_command_buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>, execution_range: NSRange, )
MTLAllocation and MTLIndirectCommandBuffer and MTLResource only.Execute commands in the buffer within the range specified.
The same indirect command buffer may be executed any number of times within the same encoder.
§Safety
indirect_command_buffermay need to be synchronized.indirect_command_buffermay be unretained, you must ensure it is kept alive while in use.executionRangemight not be bounds-checked.
Sourceunsafe fn executeCommandsInBuffer_indirectBuffer_indirectBufferOffset(
&self,
indirect_commandbuffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>,
indirect_range_buffer: &ProtocolObject<dyn MTLBuffer>,
indirect_buffer_offset: NSUInteger,
)
Available on crate features MTLAllocation and MTLBuffer and MTLIndirectCommandBuffer and MTLResource only.
unsafe fn executeCommandsInBuffer_indirectBuffer_indirectBufferOffset( &self, indirect_commandbuffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>, indirect_range_buffer: &ProtocolObject<dyn MTLBuffer>, indirect_buffer_offset: NSUInteger, )
MTLAllocation and MTLBuffer and MTLIndirectCommandBuffer and MTLResource only.Execute commands in the buffer within the range specified by the indirect range buffer.
Parameter indirectRangeBuffer: An indirect buffer from which the device reads the execution range parameter, as laid out in the MTLIndirectCommandBufferExecutionRange structure.
Parameter indirectBufferOffset: The byte offset within indirectBuffer where the execution range parameter is located. Must be a multiple of 4 bytes.
The same indirect command buffer may be executed any number of times within the same encoder.
§Safety
indirect_commandbuffermay need to be synchronized.indirect_commandbuffermay be unretained, you must ensure it is kept alive while in use.indirect_range_buffermay need to be synchronized.indirect_range_buffermay be unretained, you must ensure it is kept alive while in use.indirect_range_buffercontents should be of the correct type.indirectBufferOffsetmight not be bounds-checked.
Sourcefn memoryBarrierWithScope(&self, scope: MTLBarrierScope)
fn memoryBarrierWithScope(&self, scope: MTLBarrierScope)
Encodes a barrier between currently dispatched kernels in a concurrent compute command encoder and any subsequent ones on a specified resource group
This API ensures that all dispatches in the encoder have completed execution and their side effects are visible to subsequent dispatches in that encoder. Calling barrier on a serial encoder is allowed, but ignored.
Sourceunsafe fn memoryBarrierWithResources_count(
&self,
resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>,
count: NSUInteger,
)
Available on crate features MTLAllocation and MTLResource only.
unsafe fn memoryBarrierWithResources_count( &self, resources: NonNull<NonNull<ProtocolObject<dyn MTLResource>>>, count: NSUInteger, )
MTLAllocation and MTLResource only.Encodes a barrier between currently dispatched kernels in a concurrent compute command encoder and any subsequent ones on an array of resources.
This API ensures that all dispatches in the encoder have completed execution and side effects on the specified resources are visible to subsequent dispatches in that encoder. Calling barrier on a serial encoder is allowed, but ignored.
§Safety
resourcesmust be a valid pointer.countmight not be bounds-checked.
Sourceunsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier(
&self,
sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>,
sample_index: NSUInteger,
barrier: bool,
)
Available on crate feature MTLCounters only.
unsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier( &self, sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>, sample_index: NSUInteger, barrier: bool, )
MTLCounters only.Sample hardware counters at this point in the compute encoder and store the counter sample into the sample buffer at the specified index.
Parameter sampleBuffer: The sample buffer to sample into
Parameter sampleIndex: The index into the counter buffer to write the sample
Parameter barrier: Insert a barrier before taking the sample. Passing
YES will ensure that all work encoded before this operation in the encoder is
complete but does not isolate the work with respect to other encoders. Passing
NO will allow the sample to be taken concurrently with other operations in this
encoder.
In general, passing YES will lead to more repeatable counter results but
may negatively impact performance. Passing NO will generally be higher performance
but counter results may not be repeatable.
On devices where MTLCounterSamplingPointAtDispatchBoundary is unsupported, this method is not available and will generate an error if called.
§Safety
sampleIndex might not be bounds-checked.