mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Merge #311
311: Read WGPU_TRACE environment in the examples r=kvark a=kvark Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
This commit is contained in:
@@ -70,6 +70,7 @@ async fn run_async<E: Example>(event_loop: EventLoop<()>, window: Window) {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let trace_dir = std::env::var("WGPU_TRACE");
|
||||
let (device, queue) = adapter
|
||||
.request_device(
|
||||
&wgpu::DeviceDescriptor {
|
||||
@@ -78,7 +79,14 @@ async fn run_async<E: Example>(event_loop: EventLoop<()>, window: Window) {
|
||||
},
|
||||
limits: wgpu::Limits::default(),
|
||||
},
|
||||
Some(std::path::Path::new("trace")),
|
||||
match trace_dir {
|
||||
Ok(ref value) if !cfg!(feature = "trace") => {
|
||||
log::error!("Unable to trace into {:?} without \"trace\" feature enabled!", value);
|
||||
None
|
||||
}
|
||||
Ok(ref value) => Some(std::path::Path::new(value)),
|
||||
Err(_) => None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user