pub struct Texture3D {
pub width: u32,
pub height: u32,
pub depth: u32,
pub format: TextureFormat,
pub data: Vec<u8>,
pub mip_levels: u32,
pub label: Option<String>,
}Expand description
CPU-side 3D texture bytes.
Fields§
§width: u32Width in texels.
height: u32Height in texels.
depth: u32Depth in texels.
format: TextureFormatTexture format.
data: Vec<u8>Contiguous texture bytes.
mip_levels: u32Number of mip levels. 0 means base data with auto generation later.
label: Option<String>Optional debug label.
Implementations§
Source§impl Texture3D
impl Texture3D
Sourcepub fn new(
width: u32,
height: u32,
depth: u32,
format: TextureFormat,
data: Vec<u8>,
) -> Result<Self, ValidationError>
pub fn new( width: u32, height: u32, depth: u32, format: TextureFormat, data: Vec<u8>, ) -> Result<Self, ValidationError>
Creates a base-level 3D texture and validates byte size.
Sourcepub fn with_mip_levels(
width: u32,
height: u32,
depth: u32,
format: TextureFormat,
data: Vec<u8>,
mip_levels: u32,
) -> Result<Self, ValidationError>
pub fn with_mip_levels( width: u32, height: u32, depth: u32, format: TextureFormat, data: Vec<u8>, mip_levels: u32, ) -> Result<Self, ValidationError>
Creates a 3D texture with explicit mip-level count and validates byte size.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validates dimensions and byte length.
Sourcepub fn mip_level_range(
&self,
level: u32,
) -> Result<Range<usize>, ValidationError>
pub fn mip_level_range( &self, level: u32, ) -> Result<Range<usize>, ValidationError>
Returns the byte range occupied by one mip level in data.
Trait Implementations§
impl StructuralPartialEq for Texture3D
Auto Trait Implementations§
impl Freeze for Texture3D
impl RefUnwindSafe for Texture3D
impl Send for Texture3D
impl Sync for Texture3D
impl Unpin for Texture3D
impl UnsafeUnpin for Texture3D
impl UnwindSafe for Texture3D
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