bevy/crates/bevy_render/src/texture/texture_descriptor.rs
Carter Anderson 75f1362433 upgrade wgpu
2020-05-04 13:11:51 -07:00

29 lines
832 B
Rust

use super::{Extent3d, Texture, TextureDimension, TextureFormat, TextureUsage};
#[derive(Copy, Clone)]
pub struct TextureDescriptor {
pub size: Extent3d,
pub mip_level_count: u32,
pub sample_count: u32,
pub dimension: TextureDimension,
pub format: TextureFormat,
pub usage: TextureUsage,
}
impl From<&Texture> for TextureDescriptor {
fn from(texture: &Texture) -> Self {
TextureDescriptor {
size: Extent3d {
height: texture.height as u32,
width: texture.width as u32,
depth: 1,
},
mip_level_count: 1,
sample_count: 1,
dimension: TextureDimension::D2,
format: TextureFormat::Rgba8UnormSrgb,
usage: TextureUsage::SAMPLED | TextureUsage::COPY_DST,
}
}
}