pub struct CpuTexture {
pub pixels: Vec<u8>,
pub size: Extent3D,
pub format: TextureFormat,
pub mip_level_count: u32,
pub sample_count: SampleCount,
pub dimension: TextureDimension,
pub usage: TextureUsage,
}Expand description
A CPU-side representation of a decoded texture, ready to be uploaded to the GPU.
Fields§
§pixels: Vec<u8>The raw pixel data (e.g., in RGBA format)
size: Extent3DThe size of the texture
format: TextureFormatThe format of the pixel data
mip_level_count: u32The number of mip levels
sample_count: SampleCountThe number of samples per pixel
dimension: TextureDimensionThe dimensionality of the texture
usage: TextureUsageThe allowed usages for the future GPU texture
Implementations§
Source§impl CpuTexture
impl CpuTexture
Sourcepub fn to_descriptor<'a>(
&self,
label: Option<Cow<'a, str>>,
) -> TextureDescriptor<'a>
pub fn to_descriptor<'a>( &self, label: Option<Cow<'a, str>>, ) -> TextureDescriptor<'a>
Creates a texture descriptor from this CPU texture data
Trait Implementations§
Source§impl Debug for CpuTexture
impl Debug for CpuTexture
impl Asset for CpuTexture
Auto Trait Implementations§
impl Freeze for CpuTexture
impl RefUnwindSafe for CpuTexture
impl Send for CpuTexture
impl Sync for CpuTexture
impl Unpin for CpuTexture
impl UnwindSafe for CpuTexture
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