pub struct TextureDescriptor { /* private fields */ }Expand description
The general texture constructor, covering 2D, 2D-array, and 3D textures.
Texture2DDescriptor is the narrow preset: a single layer, a
format string, and a usage string, with no label. The two fields
TextureDescriptor adds on top of it are what keep it general —
dimension selects between a 2D texture, a 2D array, and a 3D
texture, and label names the resource in the browser’s GPU debug
tooling, which is the only way to tell two same-sized textures apart
in a capture.
Implementations§
Source§impl TextureDescriptor
impl TextureDescriptor
pub fn get_width(&self) -> u32
pub fn get_height(&self) -> u32
pub fn get_depth_or_layers(&self) -> u32
pub fn get_dimension(&self) -> &'static str
pub fn get_format(&self) -> GpuTextureFormat
pub fn get_usage(&self) -> u32
pub fn get_mip_level_count(&self) -> u32
pub fn get_sample_count(&self) -> u32
pub fn get_label(&self) -> Option<String>
pub fn try_get_label(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for TextureDescriptor
impl Clone for TextureDescriptor
Auto Trait Implementations§
impl Freeze for TextureDescriptor
impl RefUnwindSafe for TextureDescriptor
impl Send for TextureDescriptor
impl Sync for TextureDescriptor
impl Unpin for TextureDescriptor
impl UnsafeUnpin for TextureDescriptor
impl UnwindSafe for TextureDescriptor
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