tirbofish/dropbear · commit
b2ef470621be702879257bc5740addc68a72b2f8
feature: mipmaps (fixes #77) Unverified
@@ -140,7 +140,16 @@ impl AssetRegistry { return Arc::clone(existing.value()); } - let texture = Texture::from_bytes_verbose(&graphics.device, &graphics.queue, &rgba, Some((1, 1)), None, None, None); + let label = format!("Solid texture [{}, {}, {}, {}]", rgba[0], rgba[1], rgba[2], rgba[3]); + + let texture = Texture::from_bytes_verbose_mipmapped( + graphics, + &rgba, + Some((1, 1)), + None, + None, + Some(label.as_str()) + ); let texture = Arc::new(texture); match self.solid_textures.entry(key) { @@ -1,3 +1,4 @@ +use std::ops::{Deref, DerefMut}; use crate::{BindGroupLayouts, texture}; use crate::{ State, @@ -11,12 +12,9 @@ use std::sync::Arc; use wgpu::*; use winit::window::Window; -pub const NO_TEXTURE: &[u8] = include_bytes!("../../../resources/textures/no-texture.png"); +use crate::mipmap::MipMapper; -pub struct FrameGraphicsContext<'a> { - pub view: TextureView, - pub encoder: &'a mut CommandEncoder, -} +pub const NO_TEXTURE: &[u8] = include_bytes!("../../../resources/textures/no-texture.png"); pub struct SharedGraphicsContext { pub device: Arc<Device>, @@ -32,6 +30,7 @@ pub struct SharedGraphicsContext { pub texture_id: Arc<TextureId>, pub future_queue: Arc<FutureQueue>, pub supports_storage: bool,
Large diffs are not rendered by default. Showing the first 50 of 1754 lines. Show full diff