MTLResourceStateCommandEncoder

Trait MTLResourceStateCommandEncoder 

Source
pub unsafe trait MTLResourceStateCommandEncoder: MTLCommandEncoder {
    // Provided methods
    unsafe fn updateTextureMappings_mode_regions_mipLevels_slices_numRegions(
        &self,
        texture: &ProtocolObject<dyn MTLTexture>,
        mode: MTLSparseTextureMappingMode,
        regions: NonNull<MTLRegion>,
        mip_levels: NonNull<NSUInteger>,
        slices: NonNull<NSUInteger>,
        num_regions: NSUInteger,
    )
       where Self: Sized + Message { ... }
    unsafe fn updateTextureMapping_mode_region_mipLevel_slice(
        &self,
        texture: &ProtocolObject<dyn MTLTexture>,
        mode: MTLSparseTextureMappingMode,
        region: MTLRegion,
        mip_level: NSUInteger,
        slice: NSUInteger,
    )
       where Self: Sized + Message { ... }
    unsafe fn updateTextureMapping_mode_indirectBuffer_indirectBufferOffset(
        &self,
        texture: &ProtocolObject<dyn MTLTexture>,
        mode: MTLSparseTextureMappingMode,
        indirect_buffer: &ProtocolObject<dyn MTLBuffer>,
        indirect_buffer_offset: 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 moveTextureMappingsFromTexture_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 MTLCommandEncoder and MTLResourceStateCommandEncoder only.
Expand description

Provided Methods§

Source

unsafe fn updateTextureMappings_mode_regions_mipLevels_slices_numRegions( &self, texture: &ProtocolObject<dyn MTLTexture>, mode: MTLSparseTextureMappingMode, regions: NonNull<MTLRegion>, mip_levels: NonNull<NSUInteger>, slices: NonNull<NSUInteger>, num_regions: NSUInteger, )
where Self: Sized + Message,

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

Updates multiple regions within a sparse texture.

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
  • regions must be a valid pointer.
  • mip_levels must be a valid pointer.
  • slices must be a valid pointer.
Source

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

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

Updates mapping for given sparse 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 updateTextureMapping_mode_indirectBuffer_indirectBufferOffset( &self, texture: &ProtocolObject<dyn MTLTexture>, mode: MTLSparseTextureMappingMode, indirect_buffer: &ProtocolObject<dyn MTLBuffer>, indirect_buffer_offset: NSUInteger, )
where Self: Sized + Message,

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

Updates mapping for given sparse texture. Updates are driven via a MTLBuffer with the structure format defined by MTLMapIndirectBufferFormat.

struct MTLMapIndirectBufferFormat{ uint32_t numMappings; MTLMapIndirectArguments mappings[numMappings]; }

§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
  • indirect_buffer may need to be synchronized.
  • indirect_buffer may be unretained, you must ensure it is kept alive while in use.
  • indirect_buffer contents should be of the correct type.
  • indirectBufferOffset 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 moveTextureMappingsFromTexture_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.

Move sparse page mappings from one sparse texture to another from the same heap.

The tile mapping is moved from the source texture only if the destination texture tile is unmapped. The textures must also have matching a texture format, texture type, sample count, usage and resource options.

§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.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLResourceStateCommandEncoder

Source§

const NAME: &'static str = "MTLResourceStateCommandEncoder"

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 MTLResourceStateCommandEncoder

Implementations on Foreign Types§

Source§

impl<T> MTLResourceStateCommandEncoder for ProtocolObject<T>

Implementors§