Scene::print_path_counts
diff --git a/examples/scenes/src/mmark.rs b/examples/scenes/src/mmark.rs
index 3deea8d..ac4924a 100644
--- a/examples/scenes/src/mmark.rs
+++ b/examples/scenes/src/mmark.rs
@@ -105,7 +105,7 @@
element.is_split ^= true;
}
}
- let label = format!("mmark test: {} path elements (up/down to adjust)", n);
+ let label = format!("mmark test: complexity: {}, {} path elements (up/down to adjust)", c, n);
params.text.add(
scene,
None,
diff --git a/examples/with_winit/src/lib.rs b/examples/with_winit/src/lib.rs
index 8346274..fa23ee2 100644
--- a/examples/with_winit/src/lib.rs
+++ b/examples/with_winit/src/lib.rs
@@ -181,6 +181,7 @@
}
let mut prev_scene_ix = scene_ix - 1;
let mut modifiers = ModifiersState::default();
+ let mut debug_dump_time = Instant::now();
event_loop
.run(move |event, event_loop| match event {
Event::WindowEvent {
@@ -525,6 +526,23 @@
frame_time_us: (new_time - frame_start_time).as_micros() as u64,
});
frame_start_time = new_time;
+
+ if (new_time - debug_dump_time).as_secs() > 2 && scene_complexity.is_some() {
+ scene.print_path_counts();
+ //let bump_estimate = scene.bump_estimate(None);
+ let bump_actual = scene_complexity.as_ref().unwrap();
+ //println!("Last frame estimated bump buffer counts:{bump_estimate}\n");
+ println!(
+ "Last frame actual bump buffer counts:{}\n \
+ \tBlend:\t\t\t{}\n\
+ \tError Bits:\t\t0x{:#08x}\n\
+ --------\n",
+ bump_actual.memory(),
+ bump_actual.blend,
+ bump_actual.failed
+ );
+ debug_dump_time = new_time;
+ }
}
_ => {}
}
diff --git a/shader/flatten.wgsl b/shader/flatten.wgsl
index 6b20026..dede2f2 100644
--- a/shader/flatten.wgsl
+++ b/shader/flatten.wgsl
@@ -421,7 +421,7 @@
let normalized_offset = offset / cubic_params.chord_len;
let dist_scaled = normalized_offset * es.params.ch;
// NOTE: set this to "ifndef" to lower to arcs before flattening. Use ifdef to lower directly to lines.
-#ifdef arcs
+#ifndef arcs
let arclen = length(es.p0 - es.p1) / es.params.ch;
let est_err = (1. / 120.) / tol * abs(k1) * (arclen + 0.4 * abs(k1 * offset));
let n_subdiv = cbrt(est_err);
@@ -546,7 +546,7 @@
path_ix: u32, begin: vec2f, end: vec2f, center: vec2f, angle: f32, transform: Transform
) {
// NOTE: change this to "ifndef" to just render the arc chords.
-#ifdef ablate_arc_flattening
+#ifndef ablate_arc_flattening
output_line_with_transform(path_ix, begin, end, transform);
#else
var p0 = transform_apply(transform, begin);
diff --git a/src/lib.rs b/src/lib.rs
index 194b9a0..dcdc731 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -434,7 +434,7 @@
let mut render = Render::new();
let encoding = scene.encoding();
// TODO: turn this on; the download feature interacts with CPU dispatch
- let robust = false;
+ let robust = true;
let recording = render.render_encoding_coarse(encoding, &self.shaders, params, robust);
let target = render.out_image();
let bump_buf = render.bump_buf();
diff --git a/src/scene.rs b/src/scene.rs
index c93d68a..c272d3c 100644
--- a/src/scene.rs
+++ b/src/scene.rs
@@ -29,6 +29,10 @@
Self::default()
}
+ pub fn print_path_counts(&self) {
+ println!("scene n_paths: {}, n_path_segments: {}", self.encoding.n_paths, self.encoding.n_path_segments);
+ }
+
/// Removes all content from the scene.
pub fn reset(&mut self) {
self.encoding.reset();