From 89ecbf2027f09824c8f92e5ff4771ef72c6a44d3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 18 Nov 2023 02:46:50 +0100 Subject: good params --- flowy/src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'flowy/src/main.rs') diff --git a/flowy/src/main.rs b/flowy/src/main.rs index 1f84e3b..60e30c0 100644 --- a/flowy/src/main.rs +++ b/flowy/src/main.rs @@ -1,9 +1,12 @@ pub mod motion; -use log::debug; +use log::{debug, info}; use motion::{dec::MotionDecoder, enc::MotionEncoder, CommonBuffers, Params}; use pollster::FutureExt; -use std::io::{stdin, stdout, Read, Write}; +use std::{ + io::{stdin, stdout, Read, Write}, + time::Instant, +}; use wgpu::{ Backends, DeviceDescriptor, Extent3d, Features, Instance, InstanceDescriptor, Limits, MaintainBase, PowerPreference, RequestAdapterOptions, @@ -13,6 +16,8 @@ use crate::motion::RoundParams; fn main() { env_logger::init_from_env("LOG"); + info!("allocating some stuff"); + let t = Instant::now(); let instance = Instance::new(InstanceDescriptor { backends: Backends::all(), @@ -66,12 +71,14 @@ fn main() { menc.write_uniforms(&queue); mdec.write_uniforms(&queue); + info!("ready (setup took {:?})", t.elapsed()); let mut i = 0; loop { let rp = RoundParams { swap: i % 2 }; debug!("read"); stdin().read_exact(&mut buffer).unwrap(); + let t = Instant::now(); debug!("upload"); bufs.upload(&queue, ¶ms, &rp, &buffer); @@ -91,6 +98,7 @@ fn main() { debug!("download"); bufs.download(&device, &mut buffer); + info!("frame #{i} took {:?}", t.elapsed()); debug!("write"); stdout().write_all(&buffer).unwrap(); i += 1; -- cgit v1.2.3-70-g09d2