diff options
Diffstat (limited to 'flowy/src/motion/mod.rs')
-rw-r--r-- | flowy/src/motion/mod.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/flowy/src/motion/mod.rs b/flowy/src/motion/mod.rs index dfdf7a6..cd53550 100644 --- a/flowy/src/motion/mod.rs +++ b/flowy/src/motion/mod.rs @@ -8,6 +8,7 @@ use wgpu::{ Texture, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, }; +#[derive(Debug)] pub struct Params { pub width: usize, pub height: usize, @@ -17,10 +18,14 @@ pub struct Params { pub blocks_x: usize, pub blocks_y: usize, pub blocks: usize, + pub init_debug: bool, } +#[derive(Debug)] pub struct RoundParams { pub swap: usize, + pub debug: bool, + pub preview: bool, } pub struct CommonBuffers { @@ -48,7 +53,7 @@ impl CommonBuffers { mip_level_count: 1, sample_count: 1, dimension: TextureDimension::D2, - format: TextureFormat::Bgra8Unorm, + format: TextureFormat::Rgba8Unorm, usage: TextureUsages::TEXTURE_BINDING | TextureUsages::STORAGE_BINDING | TextureUsages::COPY_DST @@ -63,7 +68,7 @@ impl CommonBuffers { mip_level_count: 1, sample_count: 1, dimension: TextureDimension::D2, - format: TextureFormat::Bgra8Unorm, + format: TextureFormat::Rgba8Unorm, usage: TextureUsages::STORAGE_BINDING | TextureUsages::COPY_SRC, view_formats: &[], })); @@ -123,7 +128,11 @@ impl CommonBuffers { ) { encoder.copy_texture_to_buffer( wgpu::ImageCopyTexture { - texture: &self.textures[rp.swap], + texture: if rp.debug { + self.debug_output.as_ref().unwrap() + } else { + &self.textures[rp.swap] + }, mip_level: 0, origin: wgpu::Origin3d::ZERO, aspect: wgpu::TextureAspect::All, |