MTLTextureViewPool

Trait MTLTextureViewPool 

Source
pub unsafe trait MTLTextureViewPool: MTLResourceViewPool {
    // Provided methods
    unsafe fn setTextureView_atIndex(
        &self,
        texture: &ProtocolObject<dyn MTLTexture>,
        index: NSUInteger,
    ) -> MTLResourceID
       where Self: Sized + Message { ... }
    unsafe fn setTextureView_descriptor_atIndex(
        &self,
        texture: &ProtocolObject<dyn MTLTexture>,
        descriptor: &MTLTextureViewDescriptor,
        index: NSUInteger,
    ) -> MTLResourceID
       where Self: Sized + Message { ... }
    unsafe fn setTextureViewFromBuffer_descriptor_offset_bytesPerRow_atIndex(
        &self,
        buffer: &ProtocolObject<dyn MTLBuffer>,
        descriptor: &MTLTextureDescriptor,
        offset: NSUInteger,
        bytes_per_row: NSUInteger,
        index: NSUInteger,
    ) -> MTLResourceID
       where Self: Sized + Message { ... }
}
Available on crate features MTLResourceViewPool and MTLTextureViewPool only.
Expand description

A pool of lightweight texture views.

Use texture view pools to create lightweight texture view objects of MTLTexture and MTLBuffer instances.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn setTextureView_atIndex( &self, texture: &ProtocolObject<dyn MTLTexture>, index: NSUInteger, ) -> MTLResourceID
where Self: Sized + Message,

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

Copies a default texture view to a slot in this texture view pool at an index provided.

  • Parameters:
  • texture: An MTLTexture instance for which to copy its texture view.
  • index: An index of a slot in this texture pool into which this method copies the texture view.
  • Returns: The MTLResourceID of a newly created texture view in this pool.
§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
  • index might not be bounds-checked.
Source

unsafe fn setTextureView_descriptor_atIndex( &self, texture: &ProtocolObject<dyn MTLTexture>, descriptor: &MTLTextureViewDescriptor, index: NSUInteger, ) -> MTLResourceID
where Self: Sized + Message,

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

Creates a new lightweight texture view.

This method creates a lightweight texture view over a texture according to a descriptor you provide. It then associates the texture view with a slot in this texture view pool at the index you specify.

  • Parameters:
  • texture: An MTLTexture instance for which to create a new lightweight texture view.
  • descriptor: A descriptor specifying properties of the texture view to create.
  • index: An index of a slot in the texture pool into which this method writes the new texture view.
  • Returns: The MTLResourceID of a newly created texture view in this pool.
§Safety
  • texture may need to be synchronized.
  • texture may be unretained, you must ensure it is kept alive while in use.
  • index might not be bounds-checked.
Source

unsafe fn setTextureViewFromBuffer_descriptor_offset_bytesPerRow_atIndex( &self, buffer: &ProtocolObject<dyn MTLBuffer>, descriptor: &MTLTextureDescriptor, offset: NSUInteger, bytes_per_row: NSUInteger, index: NSUInteger, ) -> MTLResourceID
where Self: Sized + Message,

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

Creates a new lightweight texture view of a buffer.

This method creates a lightweight texture view over a buffer, according to a descriptor you provide. It then associates the texture view with a slot in this texture view pool at the index you specify.

  • Parameters:
  • buffer: An MTLBuffer instance for which to create a new texture view.
  • descriptor: A descriptor specifying properties of the texture view to create.
  • offset: A byte offset, within the buffer parameter, at which the data for the texture view starts.
  • bytesPerRow: The number of bytes between adjacent rows of pixels in the source buffer’s memory.
  • index: An index of a slot in the table into which this method writes the new texture view.
  • Returns: The MTLResourceID of a new buffer view in this pool.
§Safety
  • buffer may need to be synchronized.
  • buffer may be unretained, you must ensure it is kept alive while in use.
  • buffer contents should be of the correct type.
  • offset might not be bounds-checked.
  • index might not be bounds-checked.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLTextureViewPool

Source§

const NAME: &'static str = "MTLTextureViewPool"

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 MTLTextureViewPool

Implementations on Foreign Types§

Source§

impl<T> MTLTextureViewPool for ProtocolObject<T>

Implementors§