Skip to content

Commit

Permalink
Support wgpu-tracing with same mechanism as wgpu examples (emilk#5450)
Browse files Browse the repository at this point in the history
Gets the WGPU_TRACE env variable and gives it as an optional argument
to request_device. Same mechanism as the wgpu-examples:


https://github.com/gfx-rs/wgpu/blob/11b51693d3dc883b55b5ec0e30c340e43e6fac50/examples/src/framework.rs#L316
  • Loading branch information
EriKWDev authored Dec 9, 2024
1 parent 046034f commit 39d6b33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/egui-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ impl RenderState {
);
}

let trace_path = std::env::var("WGPU_TRACE");
let (device, queue) = {
crate::profile_scope!("request_device");
adapter
.request_device(&(*device_descriptor)(&adapter), None)
.request_device(&(*device_descriptor)(&adapter), trace_path.ok().as_ref().map(std::path::Path::new))
.await?
};

Expand Down

0 comments on commit 39d6b33

Please sign in to comment.