diff options
author | metamuffin <metamuffin@disroot.org> | 2023-11-18 14:49:17 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-11-18 14:49:17 +0100 |
commit | cdb9a3afabe7a239a08c640b19242ff9b1e3b051 (patch) | |
tree | 4903a248c588ce350feb74640ded3335e1721915 /flowy/src/motion/mod.rs | |
parent | 14051d7470d7662430694f0752d00483b52e1278 (diff) | |
download | video-codec-experiments-cdb9a3afabe7a239a08c640b19242ff9b1e3b051.tar video-codec-experiments-cdb9a3afabe7a239a08c640b19242ff9b1e3b051.tar.bz2 video-codec-experiments-cdb9a3afabe7a239a08c640b19242ff9b1e3b051.tar.zst |
debug view
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, |