Skip to content

Commit

Permalink
Always enable debug_layers in with_winit
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Aug 2, 2024
1 parent b6da1a3 commit 9ec72c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
3 changes: 1 addition & 2 deletions examples/with_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ default = ["wgpu-profiler"]
# Enable the use of wgpu-profiler. This is an optional feature for times when we use a git dependency on
# wgpu (which means the dependency used in wgpu-profiler would be incompatible)
wgpu-profiler = ["dep:wgpu-profiler", "vello/wgpu-profiler"]
debug_layers = ["vello/debug_layers"]

[lints]
workspace = true
Expand All @@ -28,7 +27,7 @@ path = "src/main.rs"


[dependencies]
vello = { workspace = true, features = ["buffer_labels"] }
vello = { workspace = true, features = ["buffer_labels", "debug_layers"] }
scenes = { workspace = true }

anyhow = { workspace = true }
Expand Down
38 changes: 20 additions & 18 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,26 @@ impl<'s> ApplicationHandler<UserEvent> for VelloApp<'s> {
},
);
}
#[cfg(feature = "debug_layers")]
"1" => {
self.debug.toggle(vello::DebugLayers::BOUNDING_BOXES);
}
#[cfg(feature = "debug_layers")]
"2" => {
self.debug.toggle(vello::DebugLayers::LINESOUP_SEGMENTS);
}
#[cfg(feature = "debug_layers")]
"3" => {
self.debug.toggle(vello::DebugLayers::LINESOUP_POINTS);
}
#[cfg(feature = "debug_layers")]
"4" => {
self.debug.toggle(vello::DebugLayers::VALIDATION);
debug_layer @ ("1" | "2" | "3" | "4") => {
match debug_layer {
"1" => {
self.debug.toggle(vello::DebugLayers::BOUNDING_BOXES);
}
"2" => {
self.debug
.toggle(vello::DebugLayers::LINESOUP_SEGMENTS);
}
"3" => {
self.debug.toggle(vello::DebugLayers::LINESOUP_POINTS);
}
"4" => {
self.debug.toggle(vello::DebugLayers::VALIDATION);
}
_ => unreachable!(),
}
if !self.debug.is_empty() && !self.async_pipeline {
log::warn!("Debug Layers won't work without using `--async-pipeline`. Requested {:?}", self.debug);
}
}
_ => {}
}
Expand Down Expand Up @@ -694,9 +699,6 @@ fn run(
};

let debug = vello::DebugLayers::none();
if cfg!(feature = "debug_layers") && !args.async_pipeline {
log::warn!("Debug Layers won't work without using `--async-pipeline`.");
}

let mut app = VelloApp {
context: render_cx,
Expand Down

0 comments on commit 9ec72c9

Please sign in to comment.