pub struct ResidentTexture { /* private fields */ }Expand description
A texture that is resident in video memory. This allows you to use bindless textures in your shaders.
Implementations§
Source§impl ResidentTexture
impl ResidentTexture
Sourcepub fn new(
texture: TextureAny,
) -> Result<ResidentTexture, BindlessTexturesNotSupportedError>
pub fn new( texture: TextureAny, ) -> Result<ResidentTexture, BindlessTexturesNotSupportedError>
Takes ownership of the given texture and makes it resident.
Sourcepub fn into_inner(self) -> TextureAny
pub fn into_inner(self) -> TextureAny
Unwraps the texture and restores it.
Methods from Deref<Target = TextureAny>§
Sourcepub fn get_height(&self) -> Option<u32>
pub fn get_height(&self) -> Option<u32>
Returns the height of the texture.
Sourcepub fn kind(&self) -> TextureKind
pub fn kind(&self) -> TextureKind
Returns the kind of texture.
Sourcepub fn dimensions(&self) -> Dimensions
pub fn dimensions(&self) -> Dimensions
Returns the dimensions of the texture.
Sourcepub fn get_array_size(&self) -> Option<u32>
pub fn get_array_size(&self) -> Option<u32>
Returns the array size of the texture.
Sourcepub fn get_samples(&self) -> Option<u32>
pub fn get_samples(&self) -> Option<u32>
Returns the number of samples of the texture if it is a multisampling texture.
Sourcepub fn first_layer(&self) -> TextureAnyLayer<'_>
pub fn first_layer(&self) -> TextureAnyLayer<'_>
Returns a structure that represents the first layer of the texture. All textures have a first layer.
Sourcepub fn layer(&self, layer: u32) -> Option<TextureAnyLayer<'_>>
pub fn layer(&self, layer: u32) -> Option<TextureAnyLayer<'_>>
Returns a structure that represents a specific layer of the texture.
Non-array textures have only one layer. The number of layers can be queried with
get_array_size.
Returns None if out of range.
Sourcepub fn get_texture_type(&self) -> Dimensions
pub fn get_texture_type(&self) -> Dimensions
Returns the type of the texture (1D, 2D, 3D, etc.).
Sourcepub fn get_internal_format(&self) -> Result<InternalFormat, GetFormatError>
pub fn get_internal_format(&self) -> Result<InternalFormat, GetFormatError>
Determines the internal format of this texture.
Sourcepub fn get_depth_stencil_bits(&self) -> (u16, u16)
pub fn get_depth_stencil_bits(&self) -> (u16, u16)
Determines the number of depth and stencil bits in the format of this texture.
Sourcepub fn get_mipmap_levels(&self) -> u32
pub fn get_mipmap_levels(&self) -> u32
Returns the number of mipmap levels of the texture.
Sourcepub fn main_level(&self) -> TextureAnyMipmap<'_>
pub fn main_level(&self) -> TextureAnyMipmap<'_>
Returns a structure that represents the main mipmap level of the texture.
Sourcepub fn mipmap(&self, level: u32) -> Option<TextureAnyMipmap<'_>>
pub fn mipmap(&self, level: u32) -> Option<TextureAnyMipmap<'_>>
Returns a structure that represents a specific mipmap of the texture.
Returns None if out of range.
Sourcepub unsafe fn generate_mipmaps(&self)
pub unsafe fn generate_mipmaps(&self)
Binds this texture and generates mipmaps.