pub struct Texture {
pub texture: Texture,
pub view: TextureView,
pub sampler: Sampler,
}Fields§
§texture: Texture§view: TextureView§sampler: SamplerImplementations§
Source§impl Texture
impl Texture
pub const DEPTH_FORMAT: TextureFormat = wgpu::TextureFormat::Depth32Float
pub fn handle(&self) -> TextureHandle
pub fn create_depth_texture( device: &Device, config: &SurfaceConfiguration, label: &str, ) -> Self
pub fn create_with_params( device: &Device, params: &TextureCreationParams<'_>, ) -> Self
pub fn create_scaled_mip_filter_surface_texture( device: &Device, config: &SurfaceConfiguration, format: TextureFormat, render_scale: f32, mip_level_count: u32, filter_mode: FilterMode, label: &str, ) -> Self
pub fn from_bytes( device: &Device, queue: &Queue, bytes: &[u8], label: &str, is_normal_map: bool, ) -> ImageResult<(DynamicImage, Self)>
pub fn from_image( device: &Device, queue: &Queue, img: &DynamicImage, label: Option<&str>, is_normal_map: bool, ) -> ImageResult<Self>
pub fn from_image_ex( device: &Device, queue: &Queue, img: &DynamicImage, label: Option<&str>, is_normal_map: bool, address_mode: AddressMode, ) -> ImageResult<Self>
pub fn from_image_with_format( device: &Device, queue: &Queue, img: &DynamicImage, label: Option<&str>, address_mode: AddressMode, format: TextureFormat, ) -> ImageResult<Self>
pub fn from_image_data_with_format( device: &Device, queue: &Queue, img_data: &[u8], label: Option<&str>, address_mode: AddressMode, format: TextureFormat, dimensions: (u32, u32), bytes_per_pixel: u32, ) -> ImageResult<Self>
pub fn from_image_uninit( device: &Device, img: &DynamicImage, label: Option<&str>, ) -> ImageResult<Self>
pub fn create_uninit( device: &Device, width: u32, height: u32, label: Option<&str>, ) -> ImageResult<Self>
Trait Implementations§
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more