Struct Texture2DArray

Source
pub struct Texture2DArray { /* private fields */ }
Expand description

2d array texture

Implementations§

Source§

impl Texture2DArray

Source

pub fn new_empty() -> Texture2DArray

Create an empty texture 2D array.

Source

pub fn new( format: Format, extent: Extent2d, layers: usize, levels: usize, ) -> Texture2DArray

Create a texture2d_array and allocate a new storage_linear.

Source

pub fn new_with_mipmap_chain( format: Format, extent: Extent2d, layers: usize, ) -> Texture2DArray

Create a texture2d_array and allocate a new storage_linear with a complete mipmap chain.

Source

pub fn share_from(texture: &impl GliTexture) -> Texture2DArray

Create a texture2d_array view with an existing storage_linear.

Source

pub fn share_from_detail( texture: &impl GliTexture, format: Format, base_layer: usize, max_layer: usize, base_face: usize, max_face: usize, base_level: usize, max_level: usize, ) -> Texture2DArray

Create a texture2d_array view with an existing storage_linear.

Source

pub fn share_from_subset( texture: &Texture2DArray, base_layer: usize, max_layer: usize, base_level: usize, max_level: usize, ) -> Texture2DArray

Create a texture2d_array view, reference a subset of an existing texture2d_array instance.

Source

pub fn get_layer(&self, layer: usize) -> Texture2D

Create a view of the texture identified by Layer in the texture array.

This method is equivalent to [] operator in C++ version.

Trait Implementations§

Source§

impl GliTexture for Texture2DArray

Source§

const TARGET_TYPE: Target = Target::TARGET_2D_ARRAY

Source§

type ExtentType = Extent2d

Source§

fn extent(&self, level: usize) -> Self::ExtentType

Return the corresponding extent type of the texture instance, which represents the size of a specific mip-level of this texture(width, height and depth).
Source§

fn set_swizzles(&mut self, swizzles: Swizzles)

Source§

fn base_face(&self) -> usize

Return the base face of the texture instance, effectively a memory offset in the actual texture storage_type to identify where to start reading the faces.
Source§

fn base_layer(&self) -> usize

Return the base layer of the texture instance, effectively a memory offset in the actual texture storage_type to identify where to start reading the layers.
Source§

fn base_level(&self) -> usize

Return the base level of the texture instance, effectively a memory offset in the actual texture storage_type to identify where to start reading the levels.
Source§

fn clear(&mut self)

Clear the entire texture storage_linear with zeros.
Source§

fn copy( &mut self, src_texture: &Self, src_layer: usize, src_face: usize, src_level: usize, dst_layer: usize, dst_face: usize, dst_level: usize, )

Copy a specific image of a texture.
Source§

fn copy_subset( &mut self, src_texture: &Self, src_layer: usize, src_face: usize, src_level: usize, src_offset: Extent3d, dst_layer: usize, dst_face: usize, dst_level: usize, dst_offset: Extent3d, extent: Extent3d, )

Copy a subset of a specific image of a texture.
Source§

fn data(&self) -> *const c_void

Return a pointer to the beginning of the texture instance data.
Source§

unsafe fn data_mut(&mut self) -> *mut c_void

Source§

fn empty(&self) -> bool

Return whether the texture instance is empty, no storage_type or description have been assigned to the instance.
Source§

fn faces(&self) -> usize

Return max_face() - base_face() + 1.
Source§

fn format(&self) -> Format

Return the texture instance format.
Source§

fn layers(&self) -> usize

Return max_layer() - base_layer() + 1.
Source§

fn levels(&self) -> usize

Return max_level() - base_level() + 1.
Source§

fn max_face(&self) -> usize

Return the max face of the texture instance, effectively a memory offset to the beginning of the last face in the actual texture storage_type that the texture instance can access.
Source§

fn max_layer(&self) -> usize

Return the max layer of the texture instance, effectively a memory offset to the beginning of the last layer in the actual texture storage_type that the texture instance can access.
Source§

fn max_level(&self) -> usize

Return the max level of the texture instance, effectively a memory offset to the beginning of the last level in the actual texture storage_type that the texture instance can access.
Source§

fn size(&self) -> usize

Return the memory size of a texture instance storage_type in bytes.
Source§

fn size_at_level(&self, level: usize) -> usize

Return the memory size of a specific level identified by Level.
Source§

fn target(&self) -> Target

Return the target of a texture instance.
Source§

impl PartialEq for Texture2DArray

Source§

fn eq(&self, other: &Texture2DArray) -> bool

Compare two textures. Two textures are the same when the data, the format and the targets are the same.

Source§

fn ne(&self, other: &Texture2DArray) -> bool

Compare two textures. Two textures are the same when the data, the format and the targets are the same.

Source§

impl Eq for Texture2DArray

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.