Remove stats that we can't reasonably collect anymore.

This commit is contained in:
Nathan Vegdahl 2022-08-01 22:57:13 -07:00
parent 8bc6b24004
commit 5d246e66fa
3 changed files with 1 additions and 42 deletions

View File

@ -1,7 +1,3 @@
//! This BVH4 implementation is based on the ideas from the paper
//! "Efficient Ray Tracing Kernels for Modern CPU Architectures"
//! by Fuetterling et al.
#![allow(dead_code)] #![allow(dead_code)]
use std::mem::{transmute, MaybeUninit}; use std::mem::{transmute, MaybeUninit};

View File

@ -289,30 +289,9 @@ fn main() {
// Print render stats // Print render stats
if !args.is_present("serialized_output") { if !args.is_present("serialized_output") {
let rtime = t.tick(); let rtime = t.tick();
let ntime = rtime as f64 / rstats.total_time;
println!("\tRendered scene in {:.3}s", rtime); println!("\tRendered scene in {:.3}s", rtime);
println!(
"\t\tTrace: {:.3}s",
ntime * rstats.trace_time
);
println!("\t\t\tRays traced: {}", rstats.ray_count); println!("\t\t\tRays traced: {}", rstats.ray_count);
println!(
"\t\t\tRays/sec: {}",
(rstats.ray_count as f64 / (ntime * rstats.trace_time) as f64) as u64
);
println!("\t\t\tRay/node tests: {}", rstats.accel_node_visits); println!("\t\t\tRay/node tests: {}", rstats.accel_node_visits);
println!(
"\t\tInitial ray generation: {:.3}s",
ntime * rstats.initial_ray_generation_time
);
println!(
"\t\tRay generation: {:.3}s",
ntime * rstats.ray_generation_time
);
println!(
"\t\tSample writing: {:.3}s",
ntime * rstats.sample_writing_time
);
} }
// Write to disk // Write to disk

View File

@ -36,35 +36,23 @@ pub struct Renderer<'a> {
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct RenderStats { pub struct RenderStats {
pub trace_time: f64,
pub accel_node_visits: u64, pub accel_node_visits: u64,
pub ray_count: u64, pub ray_count: u64,
pub initial_ray_generation_time: f64,
pub ray_generation_time: f64,
pub sample_writing_time: f64,
pub total_time: f64, pub total_time: f64,
} }
impl RenderStats { impl RenderStats {
fn new() -> RenderStats { fn new() -> RenderStats {
RenderStats { RenderStats {
trace_time: 0.0,
accel_node_visits: 0, accel_node_visits: 0,
ray_count: 0, ray_count: 0,
initial_ray_generation_time: 0.0,
ray_generation_time: 0.0,
sample_writing_time: 0.0,
total_time: 0.0, total_time: 0.0,
} }
} }
fn collect(&mut self, other: RenderStats) { fn collect(&mut self, other: RenderStats) {
self.trace_time += other.trace_time;
self.accel_node_visits += other.accel_node_visits; self.accel_node_visits += other.accel_node_visits;
self.ray_count += other.ray_count; self.ray_count += other.ray_count;
self.initial_ray_generation_time += other.initial_ray_generation_time;
self.ray_generation_time += other.ray_generation_time;
self.sample_writing_time += other.sample_writing_time;
self.total_time += other.total_time; self.total_time += other.total_time;
} }
} }
@ -294,10 +282,6 @@ impl<'a> Renderer<'a> {
} }
} }
} }
// stats.initial_ray_generation_time += timer.tick() as f64;
// stats.ray_generation_time += timer.tick() as f64;
// stats.trace_time += timer.tick() as f64;
// stats.sample_writing_time += timer.tick() as f64;
// Pre-calculate base64 encoding if needed // Pre-calculate base64 encoding if needed
let base64_enc = if do_blender_output { let base64_enc = if do_blender_output {
@ -342,7 +326,7 @@ impl<'a> Renderer<'a> {
stats.total_time += total_timer.tick() as f64; stats.total_time += total_timer.tick() as f64;
stats.ray_count = tracer.rays_traced(); stats.ray_count = tracer.rays_traced();
ACCEL_NODE_RAY_TESTS.with(|anv| { ACCEL_NODE_RAY_TESTS.with(|anv| {
stats.accel_node_visits = anv.get(); stats.accel_node_visits += anv.get();
anv.set(0); anv.set(0);
}); });