pub struct Texture { /* private fields */ }
Expand description
A handle to a GPU texture
The equivalent to wgpu::Texture
Implementations§
Source§impl Texture
impl Texture
Sourcepub fn new(desc: &TextureDescriptor<'_>, context: &Context) -> Self
pub fn new(desc: &TextureDescriptor<'_>, context: &Context) -> Self
Create a new empty texture
Sourcepub fn with_data(
desc: &TextureDescriptor<'_>,
data: &[u8],
bytes_per_row: Option<u32>,
context: &Context,
) -> Self
pub fn with_data( desc: &TextureDescriptor<'_>, data: &[u8], bytes_per_row: Option<u32>, context: &Context, ) -> Self
Create a texture from pixel data
pub fn size(&self) -> Extent3d
pub fn dimension(&self) -> TextureDimension
pub fn view(&self, base_mip_level: u32, mip_level_count: u32) -> Texture
pub fn as_render_texture(&self, context: &Context) -> RenderTexture
Sourcepub fn texture_binding(&self) -> TextureBinding
pub fn texture_binding(&self) -> TextureBinding
Bind this texture for sampling. Must be passed to a BindGroup
Sourcepub fn storage_binding(&self) -> TextureBinding
pub fn storage_binding(&self) -> TextureBinding
Bind this texture as a storage texture. Must be passed to a BindGroup
Trait Implementations§
impl Eq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl !RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.