MTLBlitCommandEncoder

Trait MTLBlitCommandEncoder 

Source
pub unsafe trait MTLBlitCommandEncoder: MTLCommandEncoder {
Show 26 methods // Provided methods fn synchronizeResource(&self, resource: &ProtocolObject<dyn MTLResource>) where Self: Sized + Message { ... } unsafe fn synchronizeTexture_slice_level( &self, texture: &ProtocolObject<dyn MTLTexture>, slice: NSUInteger, level: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, source_origin: MTLOrigin, source_size: MTLSize, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, destination_origin: MTLOrigin, ) where Self: Sized + Message { ... } unsafe fn copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin( &self, source_buffer: &ProtocolObject<dyn MTLBuffer>, source_offset: NSUInteger, source_bytes_per_row: NSUInteger, source_bytes_per_image: NSUInteger, source_size: MTLSize, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, destination_origin: MTLOrigin, ) where Self: Sized + Message { ... } unsafe fn copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_options( &self, source_buffer: &ProtocolObject<dyn MTLBuffer>, source_offset: NSUInteger, source_bytes_per_row: NSUInteger, source_bytes_per_image: NSUInteger, source_size: MTLSize, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, destination_origin: MTLOrigin, options: MTLBlitOption, ) where Self: Sized + Message { ... } unsafe fn copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, source_origin: MTLOrigin, source_size: MTLSize, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, destination_bytes_per_row: NSUInteger, destination_bytes_per_image: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_options( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, source_origin: MTLOrigin, source_size: MTLSize, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, destination_bytes_per_row: NSUInteger, destination_bytes_per_image: NSUInteger, options: MTLBlitOption, ) where Self: Sized + Message { ... } fn generateMipmapsForTexture( &self, texture: &ProtocolObject<dyn MTLTexture>, ) where Self: Sized + Message { ... } fn fillBuffer_range_value( &self, buffer: &ProtocolObject<dyn MTLBuffer>, range: NSRange, value: u8, ) where Self: Sized + Message { ... } unsafe fn copyFromTexture_sourceSlice_sourceLevel_toTexture_destinationSlice_destinationLevel_sliceCount_levelCount( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, slice_count: NSUInteger, level_count: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn copyFromTexture_toTexture( &self, source_texture: &ProtocolObject<dyn MTLTexture>, destination_texture: &ProtocolObject<dyn MTLTexture>, ) where Self: Sized + Message { ... } unsafe fn copyFromBuffer_sourceOffset_toBuffer_destinationOffset_size( &self, source_buffer: &ProtocolObject<dyn MTLBuffer>, source_offset: NSUInteger, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, size: NSUInteger, ) 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 { ... } unsafe fn getTextureAccessCounters_region_mipLevel_slice_resetCounters_countersBuffer_countersBufferOffset( &self, texture: &ProtocolObject<dyn MTLTexture>, region: MTLRegion, mip_level: NSUInteger, slice: NSUInteger, reset_counters: bool, counters_buffer: &ProtocolObject<dyn MTLBuffer>, counters_buffer_offset: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn resetTextureAccessCounters_region_mipLevel_slice( &self, texture: &ProtocolObject<dyn MTLTexture>, region: MTLRegion, mip_level: NSUInteger, slice: NSUInteger, ) where Self: Sized + Message { ... } fn optimizeContentsForGPUAccess( &self, texture: &ProtocolObject<dyn MTLTexture>, ) where Self: Sized + Message { ... } unsafe fn optimizeContentsForGPUAccess_slice_level( &self, texture: &ProtocolObject<dyn MTLTexture>, slice: NSUInteger, level: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn optimizeContentsForCPUAccess( &self, texture: &ProtocolObject<dyn MTLTexture>, ) where Self: Sized + Message { ... } unsafe fn optimizeContentsForCPUAccess_slice_level( &self, texture: &ProtocolObject<dyn MTLTexture>, slice: NSUInteger, level: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn resetCommandsInBuffer_withRange( &self, buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>, range: NSRange, ) where Self: Sized + Message { ... } unsafe fn copyIndirectCommandBuffer_sourceRange_destination_destinationIndex( &self, source: &ProtocolObject<dyn MTLIndirectCommandBuffer>, source_range: NSRange, destination: &ProtocolObject<dyn MTLIndirectCommandBuffer>, destination_index: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn optimizeIndirectCommandBuffer_withRange( &self, indirect_command_buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>, range: NSRange, ) where Self: Sized + Message { ... } unsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier( &self, sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>, sample_index: NSUInteger, barrier: bool, ) where Self: Sized + Message { ... } unsafe fn resolveCounters_inRange_destinationBuffer_destinationOffset( &self, sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>, range: NSRange, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, ) where Self: Sized + Message { ... } unsafe fn copyFromTensor_sourceOrigin_sourceDimensions_toTensor_destinationOrigin_destinationDimensions( &self, source_tensor: &ProtocolObject<dyn MTLTensor>, source_origin: &MTLTensorExtents, source_dimensions: &MTLTensorExtents, destination_tensor: &ProtocolObject<dyn MTLTensor>, destination_origin: &MTLTensorExtents, destination_dimensions: &MTLTensorExtents, ) where Self: Sized + Message { ... }
}
Available on crate features MTLBlitCommandEncoder and MTLCommandEncoder only.
Expand description

A command encoder that performs basic copies and blits between buffers and textures.

See also Apple’s documentation

Provided Methods§

Source

fn synchronizeResource(&self, resource: &ProtocolObject<dyn MTLResource>)
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource only.

Flush any copy of this resource from the device’s caches, and invalidate any CPU caches if needed.

Parameter resource: The resource to page off.

When the device writes to a resource with a storage mode of MTLResourceStorageModeManaged, those writes may be cached (for example, in VRAM or on chip renderer cache), making any CPU access (either MTLBuffer.contents or -[MTLTexture getBytes:…] and -[MTLTexture replaceRegion:]) produce undefined results. To allow the CPU to see what the device has written, a CommandBuffer containing this synchronization must be executed. After completion of the CommandBuffer, the CPU can access the contents of the resource safely.

Source

unsafe fn synchronizeTexture_slice_level( &self, texture: &ProtocolObject<dyn MTLTexture>, slice: NSUInteger, level: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Flush any copy of this image from the device’s caches, and invalidate CPU caches if needed.

Parameter texture: The texture to page off.

Parameter slice: The slice of the texture to page off.

Parameter level: The mipmap level of the texture to flush.

See the discussion of -synchronizeResource. -synchronizeTexture:slice:mipmapLevel performs the same role, except it may flush only a subset of the texture storage, rather than the entire texture.

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, source_origin: MTLOrigin, source_size: MTLSize, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, destination_origin: MTLOrigin, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture and MTLTypes only.

Copy a rectangle of pixels between textures.

§Safety
  • source_texture may need to be synchronized.
  • source_texture may be unretained, you must ensure it is kept alive while in use.
  • sourceSize might not be bounds-checked.
  • destination_texture may need to be synchronized.
  • destination_texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin( &self, source_buffer: &ProtocolObject<dyn MTLBuffer>, source_offset: NSUInteger, source_bytes_per_row: NSUInteger, source_bytes_per_image: NSUInteger, source_size: MTLSize, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, destination_origin: MTLOrigin, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTexture and MTLTypes only.

Copy an image from a buffer into a texture.

§Safety
  • source_buffer may need to be synchronized.
  • source_buffer may be unretained, you must ensure it is kept alive while in use.
  • source_buffer contents should be of the correct type.
  • sourceOffset might not be bounds-checked.
  • sourceSize might not be bounds-checked.
  • destination_texture may need to be synchronized.
  • destination_texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn copyFromBuffer_sourceOffset_sourceBytesPerRow_sourceBytesPerImage_sourceSize_toTexture_destinationSlice_destinationLevel_destinationOrigin_options( &self, source_buffer: &ProtocolObject<dyn MTLBuffer>, source_offset: NSUInteger, source_bytes_per_row: NSUInteger, source_bytes_per_image: NSUInteger, source_size: MTLSize, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, destination_origin: MTLOrigin, options: MTLBlitOption, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTexture and MTLTypes only.

Copy an image from a buffer into a texture.

§Safety
  • source_buffer may need to be synchronized.
  • source_buffer may be unretained, you must ensure it is kept alive while in use.
  • source_buffer contents should be of the correct type.
  • sourceOffset might not be bounds-checked.
  • sourceSize might not be bounds-checked.
  • destination_texture may need to be synchronized.
  • destination_texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, source_origin: MTLOrigin, source_size: MTLSize, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, destination_bytes_per_row: NSUInteger, destination_bytes_per_image: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTexture and MTLTypes only.

Copy an image from a texture into a buffer.

§Safety
  • source_texture may need to be synchronized.
  • source_texture may be unretained, you must ensure it is kept alive while in use.
  • sourceSize might not be bounds-checked.
  • destination_buffer may need to be synchronized.
  • destination_buffer may be unretained, you must ensure it is kept alive while in use.
  • destination_buffer contents should be of the correct type.
  • destinationOffset might not be bounds-checked.
Source

unsafe fn copyFromTexture_sourceSlice_sourceLevel_sourceOrigin_sourceSize_toBuffer_destinationOffset_destinationBytesPerRow_destinationBytesPerImage_options( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, source_origin: MTLOrigin, source_size: MTLSize, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, destination_bytes_per_row: NSUInteger, destination_bytes_per_image: NSUInteger, options: MTLBlitOption, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTexture and MTLTypes only.

Copy an image from a texture into a buffer.

§Safety
  • source_texture may need to be synchronized.
  • source_texture may be unretained, you must ensure it is kept alive while in use.
  • sourceSize might not be bounds-checked.
  • destination_buffer may need to be synchronized.
  • destination_buffer may be unretained, you must ensure it is kept alive while in use.
  • destination_buffer contents should be of the correct type.
  • destinationOffset might not be bounds-checked.
Source

fn generateMipmapsForTexture(&self, texture: &ProtocolObject<dyn MTLTexture>)
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Generate mipmaps for a texture from the base level up to the max level.

Source

fn fillBuffer_range_value( &self, buffer: &ProtocolObject<dyn MTLBuffer>, range: NSRange, value: u8, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource only.

Fill a buffer with a fixed value in each byte.

Source

unsafe fn copyFromTexture_sourceSlice_sourceLevel_toTexture_destinationSlice_destinationLevel_sliceCount_levelCount( &self, source_texture: &ProtocolObject<dyn MTLTexture>, source_slice: NSUInteger, source_level: NSUInteger, destination_texture: &ProtocolObject<dyn MTLTexture>, destination_slice: NSUInteger, destination_level: NSUInteger, slice_count: NSUInteger, level_count: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Copy whole surfaces between textures.

Convenience function to copy sliceCount * levelCount whole surfaces between textures The source and destination pixel format must be identical. The source and destination sample count must be identical. The sourceLevel mip in sourceTexture must have the same dimension as the destinationLevel mip in destinationTexture. The sourceTexture must have at least sourceLevel + levelCount mips The destinationTexture must have at least destinationLevel + levelCount mips The sourceTexture must have at least sourceSlice + sliceCount array slices The destinationTexture must have at least destinationSlice + sliceCount array slices

§Safety
  • source_texture may need to be synchronized.
  • source_texture may be unretained, you must ensure it is kept alive while in use.
  • destination_texture may need to be synchronized.
  • destination_texture may be unretained, you must ensure it is kept alive while in use.
  • sliceCount might not be bounds-checked.
  • levelCount might not be bounds-checked.
Source

unsafe fn copyFromTexture_toTexture( &self, source_texture: &ProtocolObject<dyn MTLTexture>, destination_texture: &ProtocolObject<dyn MTLTexture>, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Copy as many whole surfaces as possible between textures.

Convenience function that calls copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount: The source and destination pixel format must be identical. The source and destination sample count must be identical. Either:

  • sourceTexture must have a mip M with identical dimensions as the first mip of destinationTexture: sourceLevel = M, destinationLevel = 0
  • destinationTexture must have a mip M with identical dimensions as the first mip of sourceTexture: sourceLevel = 0, destinationLevel = M Computes: levelCount = min(sourceTexture.mipmapLevelCount - sourceLevel, destinationTexture.mipmapLevelCount - destinationLevel) sliceCount = min(sourceTexture.arrayLength, destinationTexture.arrayLength) Then invokes the method above using the computed parameters.
§Safety
  • source_texture may need to be synchronized.
  • source_texture may be unretained, you must ensure it is kept alive while in use.
  • destination_texture may need to be synchronized.
  • destination_texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn copyFromBuffer_sourceOffset_toBuffer_destinationOffset_size( &self, source_buffer: &ProtocolObject<dyn MTLBuffer>, source_offset: NSUInteger, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, size: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource only.

Basic memory copy between buffers.

§Safety
  • source_buffer may need to be synchronized.
  • source_buffer may be unretained, you must ensure it is kept alive while in use.
  • source_buffer contents should be of the correct type.
  • sourceOffset might not be bounds-checked.
  • destination_buffer may need to be synchronized.
  • destination_buffer may be unretained, you must ensure it is kept alive while in use.
  • destination_buffer contents should be of the correct type.
  • destinationOffset might not be bounds-checked.
  • size might not be bounds-checked.
Source

fn updateFence(&self, fence: &ProtocolObject<dyn MTLFence>)
where Self: Sized + Message,

Available on crate feature 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.

Source

fn waitForFence(&self, fence: &ProtocolObject<dyn MTLFence>)
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn getTextureAccessCounters_region_mipLevel_slice_resetCounters_countersBuffer_countersBufferOffset( &self, texture: &ProtocolObject<dyn MTLTexture>, region: MTLRegion, mip_level: NSUInteger, slice: NSUInteger, reset_counters: bool, counters_buffer: &ProtocolObject<dyn MTLBuffer>, counters_buffer_offset: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTexture and MTLTypes only.

Copies tile access counters within specified region into provided buffer

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
  • counters_buffer may need to be synchronized.
  • counters_buffer may be unretained, you must ensure it is kept alive while in use.
  • counters_buffer contents should be of the correct type.
  • countersBufferOffset might not be bounds-checked.
Source

unsafe fn resetTextureAccessCounters_region_mipLevel_slice( &self, texture: &ProtocolObject<dyn MTLTexture>, region: MTLRegion, mip_level: NSUInteger, slice: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture and MTLTypes only.

Resets tile access counters within specified region

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
  • This might not be bounds-checked.
Source

fn optimizeContentsForGPUAccess(&self, texture: &ProtocolObject<dyn MTLTexture>)
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Optimizes the texture data to ensure the best possible performance when accessing content on the GPU at the expense of CPU-access performance.

Source

unsafe fn optimizeContentsForGPUAccess_slice_level( &self, texture: &ProtocolObject<dyn MTLTexture>, slice: NSUInteger, level: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Optimizes a subset of the texture data to ensure the best possible performance when accessing content on the GPU at the expense of CPU-access performance.

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn optimizeContentsForCPUAccess( &self, texture: &ProtocolObject<dyn MTLTexture>, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Optimizes the texture data to ensure the best possible performance when accessing content on the CPU at the expense of GPU-access performance.

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn optimizeContentsForCPUAccess_slice_level( &self, texture: &ProtocolObject<dyn MTLTexture>, slice: NSUInteger, level: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTexture only.

Optimizes a subset of the texture data to ensure the best possible performance when accessing content on the CPU at the expense of GPU-access performance.

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
Source

unsafe fn resetCommandsInBuffer_withRange( &self, buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>, range: NSRange, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLIndirectCommandBuffer and MTLResource only.

reset commands in a indirect command buffer using the GPU

§Safety
  • buffer may need to be synchronized.
  • buffer may be unretained, you must ensure it is kept alive while in use.
  • range might not be bounds-checked.
Source

unsafe fn copyIndirectCommandBuffer_sourceRange_destination_destinationIndex( &self, source: &ProtocolObject<dyn MTLIndirectCommandBuffer>, source_range: NSRange, destination: &ProtocolObject<dyn MTLIndirectCommandBuffer>, destination_index: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLIndirectCommandBuffer and MTLResource only.

copy a region of a buffer into a destination buffer starting at destinationIndex using the GPU

§Safety
  • source may need to be synchronized.
  • source may be unretained, you must ensure it is kept alive while in use.
  • sourceRange might not be bounds-checked.
  • destination may need to be synchronized.
  • destination may be unretained, you must ensure it is kept alive while in use.
  • destinationIndex might not be bounds-checked.
Source

unsafe fn optimizeIndirectCommandBuffer_withRange( &self, indirect_command_buffer: &ProtocolObject<dyn MTLIndirectCommandBuffer>, range: NSRange, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLIndirectCommandBuffer and MTLResource only.

Encodes a command that can improve the performance of a range of commands within an indirect command buffer.

§Safety
  • indirect_command_buffer may need to be synchronized.
  • indirect_command_buffer may be unretained, you must ensure it is kept alive while in use.
  • range might not be bounds-checked.
Source

unsafe fn sampleCountersInBuffer_atSampleIndex_withBarrier( &self, sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>, sample_index: NSUInteger, barrier: bool, )
where Self: Sized + Message,

Available on crate feature MTLCounters only.

Sample hardware counters at this point in the blit 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 MTLCounterSamplingPointAtBlitBoundary is unsupported, this method is not available and will generate an error if called.

§Safety

sampleIndex might not be bounds-checked.

Source

unsafe fn resolveCounters_inRange_destinationBuffer_destinationOffset( &self, sample_buffer: &ProtocolObject<dyn MTLCounterSampleBuffer>, range: NSRange, destination_buffer: &ProtocolObject<dyn MTLBuffer>, destination_offset: NSUInteger, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLBuffer and MTLCounters and MTLResource only.

Parameter sampleBuffer: The sample buffer to resolve.

Parameter range: The range of indices to resolve.

Parameter destinationBuffer: The buffer to resolve values into.

Parameter destinationOffset: The offset to begin writing values out to. This must be a multiple of the minimum constant buffer alignment.

Resolve the counters from the raw buffer to a processed buffer.

Samples that encountered an error during resolve will be set to MTLCounterErrorValue.

§Safety
  • range might not be bounds-checked.
  • destination_buffer may need to be synchronized.
  • destination_buffer may be unretained, you must ensure it is kept alive while in use.
  • destination_buffer contents should be of the correct type.
  • destinationOffset might not be bounds-checked.
Source

unsafe fn copyFromTensor_sourceOrigin_sourceDimensions_toTensor_destinationOrigin_destinationDimensions( &self, source_tensor: &ProtocolObject<dyn MTLTensor>, source_origin: &MTLTensorExtents, source_dimensions: &MTLTensorExtents, destination_tensor: &ProtocolObject<dyn MTLTensor>, destination_origin: &MTLTensorExtents, destination_dimensions: &MTLTensorExtents, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLResource and MTLTensor only.

Encodes a command to copy data from a slice of one tensor into a slice of another tensor.

This command applies reshapes if sourceTensor and destinationTensor are not aliasable.

  • Parameters:
  • sourceTensor: A tensor instance that this command copies data from.
  • sourceOrigin: An array of offsets, in elements, to the first element of the slice of sourceTensor that this command copies data from.
  • sourceDimensions: An array of sizes, in elements, of the slice sourceTensor that this command copies data from.
  • destinationTensor: A tensor instance that this command copies data to.
  • destinationOrigin: An array of offsets, in elements, to the first element of the slice of destinationTensor that this command copies data to.
  • destinationDimensions: An array of sizes, in elements, of the slice of destinationTensor that this command copies data to.
§Safety
  • source_tensor may need to be synchronized.
  • source_tensor may be unretained, you must ensure it is kept alive while in use.
  • destination_tensor may need to be synchronized.
  • destination_tensor may be unretained, you must ensure it is kept alive while in use.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLBlitCommandEncoder

Source§

const NAME: &'static str = "MTLBlitCommandEncoder"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MTLBlitCommandEncoder

Implementations on Foreign Types§

Source§

impl<T> MTLBlitCommandEncoder for ProtocolObject<T>

Implementors§