mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
add optional wgpu tracing feature
This commit is contained in:
parent
f85867139b
commit
5fdf36dbb1
3 changed files with 8 additions and 1 deletions
|
@ -15,6 +15,7 @@ exclude = ["assets/**/*", "tools/**/*", ".github/**/*", "crates/**/*"]
|
|||
[features]
|
||||
default = ["bevy_audio", "bevy_gltf", "bevy_wgpu", "bevy_winit", "png", "hdr", "mp3"]
|
||||
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)
|
||||
png = ["bevy_render/png"]
|
||||
|
|
|
@ -11,6 +11,7 @@ keywords = ["bevy"]
|
|||
|
||||
[features]
|
||||
default = ["bevy_winit"]
|
||||
trace = ["wgpu/trace"]
|
||||
|
||||
[dependencies]
|
||||
# bevy
|
||||
|
|
|
@ -27,6 +27,11 @@ impl WgpuRenderer {
|
|||
.await
|
||||
.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
|
||||
.request_device(
|
||||
&wgpu::DeviceDescriptor {
|
||||
|
@ -34,7 +39,7 @@ impl WgpuRenderer {
|
|||
limits: wgpu::Limits::default(),
|
||||
shader_validation: true,
|
||||
},
|
||||
None,
|
||||
trace_path,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
|
Loading…
Reference in a new issue