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§
Sourceunsafe fn setTextureView_atIndex(
&self,
texture: &ProtocolObject<dyn MTLTexture>,
index: NSUInteger,
) -> MTLResourceID
Available on crate features MTLAllocation and MTLResource and MTLTexture and MTLTypes only.
unsafe fn setTextureView_atIndex( &self, texture: &ProtocolObject<dyn MTLTexture>, index: NSUInteger, ) -> MTLResourceID
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
MTLTextureinstance 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
MTLResourceIDof a newly created texture view in this pool.
§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 setTextureView_descriptor_atIndex(
&self,
texture: &ProtocolObject<dyn MTLTexture>,
descriptor: &MTLTextureViewDescriptor,
index: NSUInteger,
) -> MTLResourceID
Available on crate features MTLAllocation and MTLResource and MTLTexture and MTLTypes only.
unsafe fn setTextureView_descriptor_atIndex( &self, texture: &ProtocolObject<dyn MTLTexture>, descriptor: &MTLTextureViewDescriptor, index: NSUInteger, ) -> MTLResourceID
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
MTLTextureinstance 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
MTLResourceIDof a newly created texture view in this pool.
§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 setTextureViewFromBuffer_descriptor_offset_bytesPerRow_atIndex(
&self,
buffer: &ProtocolObject<dyn MTLBuffer>,
descriptor: &MTLTextureDescriptor,
offset: NSUInteger,
bytes_per_row: NSUInteger,
index: NSUInteger,
) -> MTLResourceID
Available on crate features MTLAllocation and MTLBuffer and MTLResource and MTLTexture and MTLTypes only.
unsafe fn setTextureViewFromBuffer_descriptor_offset_bytesPerRow_atIndex( &self, buffer: &ProtocolObject<dyn MTLBuffer>, descriptor: &MTLTextureDescriptor, offset: NSUInteger, bytes_per_row: NSUInteger, index: NSUInteger, ) -> MTLResourceID
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
MTLBufferinstance 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
bufferparameter, 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
MTLResourceIDof a new buffer view in this pool.
§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.