1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Support wgpu-tracing with same mechanism as wgpu examples (#5450)

Gets the WGPU_TRACE env variable and gives it as an optional argument
to request_device. Same mechanism as the wgpu-examples:


11b51693d3/examples/src/framework.rs (L316)
This commit is contained in:
EriKWDev
2024-12-09 11:58:33 +01:00
committed by GitHub
parent 046034f902
commit 39d6b3367b

View File

@@ -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?
};