add optional wgpu tracing feature
This commit is contained in:
parent
f85867139b
commit
5fdf36dbb1
@ -15,6 +15,7 @@ exclude = ["assets/**/*", "tools/**/*", ".github/**/*", "crates/**/*"]
|
|||||||
[features]
|
[features]
|
||||||
default = ["bevy_audio", "bevy_gltf", "bevy_wgpu", "bevy_winit", "png", "hdr", "mp3"]
|
default = ["bevy_audio", "bevy_gltf", "bevy_wgpu", "bevy_winit", "png", "hdr", "mp3"]
|
||||||
profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"]
|
profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"]
|
||||||
|
wgpu_trace = ["bevy_wgpu/trace"]
|
||||||
|
|
||||||
# Image format support for texture loading (PNG and HDR are enabled by default)
|
# Image format support for texture loading (PNG and HDR are enabled by default)
|
||||||
png = ["bevy_render/png"]
|
png = ["bevy_render/png"]
|
||||||
|
@ -11,6 +11,7 @@ keywords = ["bevy"]
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["bevy_winit"]
|
default = ["bevy_winit"]
|
||||||
|
trace = ["wgpu/trace"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# bevy
|
# bevy
|
||||||
|
@ -27,6 +27,11 @@ impl WgpuRenderer {
|
|||||||
.await
|
.await
|
||||||
.expect("Unable to find a GPU! Make sure you have installed required drivers!");
|
.expect("Unable to find a GPU! Make sure you have installed required drivers!");
|
||||||
|
|
||||||
|
#[cfg(feature = "trace")]
|
||||||
|
let trace_path = Some(std::path::Path::new("wgpu_trace"));
|
||||||
|
#[cfg(not(feature = "trace"))]
|
||||||
|
let trace_path = None;
|
||||||
|
|
||||||
let (device, queue) = adapter
|
let (device, queue) = adapter
|
||||||
.request_device(
|
.request_device(
|
||||||
&wgpu::DeviceDescriptor {
|
&wgpu::DeviceDescriptor {
|
||||||
@ -34,7 +39,7 @@ impl WgpuRenderer {
|
|||||||
limits: wgpu::Limits::default(),
|
limits: wgpu::Limits::default(),
|
||||||
shader_validation: true,
|
shader_validation: true,
|
||||||
},
|
},
|
||||||
None,
|
trace_path,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user