Skip to content

Commit df0c0f8

Browse files
superdumpjames7132
authored andcommitted
Enable wgpu profiling spans when using bevy's trace feature (bevyengine#5182)
# Objective - Enable `wgpu` profiling spans ## Solution - `wgpu` uses the `profiling` crate to add profiling span instrumentation to their code - `profiling` offers multiple 'backends' for profiling, including `tracing` - When the `bevy` `trace` feature is used, add the `profiling` crate with its `profile-with-tracing` feature to enable appropriate profiling spans in `wgpu` using `tracing` which fits nicely into our infrastructure - Bump our default `tracing` subscriber filter to `wgpu=info` from `wgpu=error` so that the profiling spans are not filtered out as they are created at the `info` level. --- ## Changelog - Added: `tracing` profiling support for `wgpu` when using bevy's `trace` feature - Changed: The default `tracing` filter statement for `wgpu` has been changed from the `error` level to the `info` level to not filter out the wgpu profiling spans
1 parent 8ea7b5e commit df0c0f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/bevy_render/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dds = ["ddsfile"]
2020
zlib = ["flate2"]
2121
zstd = ["ruzstd"]
2222

23-
trace = []
23+
trace = ["profiling"]
2424
tracing-tracy = []
2525
wgpu_trace = ["wgpu/trace"]
2626
ci_limits = []
@@ -71,3 +71,5 @@ ruzstd = { version = "0.2.4", optional = true }
7171
# For transcoding of UASTC/ETC1S universal formats, and for .basis file support
7272
basis-universal = { version = "0.2.0", optional = true }
7373
encase = { version = "0.3", features = ["glam"] }
74+
# For wgpu profiling using tracing. Use `RUST_LOG=info` to also capture the wgpu spans.
75+
profiling = { version = "1", features = ["profile-with-tracing"], optional = true }

0 commit comments

Comments
 (0)