pub enum TextureFormat {
Rgba8,
Bc1,
Bc3,
Bc5,
Bc7,
}Expand description
GPU pixel format of a compiled texture payload. RGBA8 is the uncompressed path (runtime mip generation); the rest are block-compressed formats uploaded with their container mip chains.
Variants§
Rgba8
Uncompressed 8-bit RGBA; mips are generated at upload.
Bc1
BC1 block compression.
Bc3
BC3 block compression.
Bc5
BC5 block compression, for normal maps.
Bc7
BC7 block compression.
Implementations§
Source§impl TextureFormat
impl TextureFormat
Sourcepub fn block_bytes(self) -> Option<usize>
pub fn block_bytes(self) -> Option<usize>
Bytes per 4x4 block for a compressed format. None for RGBA8, which is
sized per pixel rather than per block.
Sourcepub fn mip_byte_len(self, width: u32, height: u32) -> Result<usize, String>
pub fn mip_byte_len(self, width: u32, height: u32) -> Result<usize, String>
Byte length one mip of width x height occupies in this format.
Dimensions are read out of the file being decoded, so a footprint that
overflows usize is reported rather than wrapped into a small length
that would pass the caller’s bounds check.
Trait Implementations§
Source§impl Clone for TextureFormat
impl Clone for TextureFormat
Source§fn clone(&self) -> TextureFormat
fn clone(&self) -> TextureFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextureFormat
Source§impl Debug for TextureFormat
impl Debug for TextureFormat
impl Eq for TextureFormat
Source§impl PartialEq for TextureFormat
impl PartialEq for TextureFormat
impl StructuralPartialEq for TextureFormat
Auto Trait Implementations§
impl Freeze for TextureFormat
impl RefUnwindSafe for TextureFormat
impl Send for TextureFormat
impl Sync for TextureFormat
impl Unpin for TextureFormat
impl UnsafeUnpin for TextureFormat
impl UnwindSafe for TextureFormat
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.