Skip to content

Commit

Permalink
[debug_layers] Validation, LineSoup visualization, and UI toggles
Browse files Browse the repository at this point in the history
- Introduce the VALIDATION layer which runs a watertightness test on
  LineSoup buffer contents.
- Add debug visualization layers for LineSoup endpoints and validation
  test errors.
- Add DebugLayers options to toggle individual layers.
- Add with_winit key bindings to toggle individual layers.
  • Loading branch information
armansito committed Jun 5, 2024
1 parent b22b633 commit 1bd6b18
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 54 deletions.
22 changes: 22 additions & 0 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ fn run(
}
let mut prev_scene_ix = scene_ix - 1;
let mut modifiers = ModifiersState::default();

#[cfg(feature = "debug_layers")]
let mut debug = vello::DebugLayers::none();

#[allow(deprecated)]
event_loop
.run(move |event, event_loop| match event {
Expand Down Expand Up @@ -301,6 +305,22 @@ fn run(
},
);
}
#[cfg(feature = "debug_layers")]
"1" => {
debug.toggle(vello::DebugLayers::BOUNDING_BOXES);
}
#[cfg(feature = "debug_layers")]
"2" => {
debug.toggle(vello::DebugLayers::LINESOUP_SEGMENTS);
}
#[cfg(feature = "debug_layers")]
"3" => {
debug.toggle(vello::DebugLayers::LINESOUP_POINTS);
}
#[cfg(feature = "debug_layers")]
"4" => {
debug.toggle(vello::DebugLayers::VALIDATION);
}
_ => {}
}
}
Expand Down Expand Up @@ -444,6 +464,8 @@ fn run(
width,
height,
antialiasing_method,
#[cfg(feature = "debug_layers")]
debug,
};
scene.reset();
let mut transform = transform;
Expand Down
Loading

0 comments on commit 1bd6b18

Please sign in to comment.