pub struct Texture2d<T: ?Sized> {
pub dimensions: Vec2<NonZeroU32>,
pub mip_levels: NonZeroU32,
pub data: T,
}Expand description
2-dimensional texture object.
Use this type to satisfy a texture binding in a resource struct,
when the binding has WGSL type texture_2d or texture_external.
Fields§
§dimensions: Vec2<NonZeroU32>§mip_levels: NonZeroU32§data: TImplementations§
Trait Implementations§
Source§impl<T: PartialEq + ?Sized> PartialEq for Texture2d<T>
impl<T: PartialEq + ?Sized> PartialEq for Texture2d<T>
Source§impl<T: ?Sized + Read> Query for Texture2d<T>
impl<T: ?Sized + Read> Query for Texture2d<T>
Source§fn base_dimensions(&self) -> Self::Dimensions
fn base_dimensions(&self) -> Self::Dimensions
Returns the dimensions of mip level 0 of the texture.
Source§fn mip_levels(&self) -> NonZeroU32
fn mip_levels(&self) -> NonZeroU32
Returns the count of mip levels of the texture.
Source§fn array_layers(&self) -> NonZeroU32
fn array_layers(&self) -> NonZeroU32
Returns the count of array layers of the texture. Read more
Source§fn samples(&self) -> NonZeroU32
fn samples(&self) -> NonZeroU32
Returns the count of samples of the texture. Read more
Source§impl<T: ?Sized + Read> Read for Texture2d<T>
impl<T: ?Sized + Read> Read for Texture2d<T>
type Coordinates = <T as Read>::Coordinates
type Component = <T as Read>::Component
Source§fn read_texel(
&self,
coordinates: Self::Coordinates,
array_layer: i32,
sample: i32,
mip_level: i32,
) -> Vec4<Self::Component>
fn read_texel( &self, coordinates: Self::Coordinates, array_layer: i32, sample: i32, mip_level: i32, ) -> Vec4<Self::Component>
Loads a single texel from the texture. Read more
impl<T: Copy + ?Sized> Copy for Texture2d<T>
impl<T: Eq + ?Sized> Eq for Texture2d<T>
impl<T: ?Sized> StructuralPartialEq for Texture2d<T>
Auto Trait Implementations§
impl<T> Freeze for Texture2d<T>
impl<T> RefUnwindSafe for Texture2d<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Texture2d<T>
impl<T> Sync for Texture2d<T>
impl<T> Unpin for Texture2d<T>
impl<T> UnsafeUnpin for Texture2d<T>where
T: UnsafeUnpin + ?Sized,
impl<T> UnwindSafe for Texture2d<T>where
T: UnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more