From 180ca808f2b8c0b97f7617d2870c1faf775c4585 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Sun, 3 Jul 2022 13:23:59 +0200 Subject: [PATCH 1/3] Enable wgpu profiling spans when using bevy's trace feature --- crates/bevy_log/src/lib.rs | 6 +++--- crates/bevy_render/Cargo.toml | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 0259aafd71457..11904aafe1477 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -55,7 +55,7 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter}; /// App::new() /// .insert_resource(LogSettings { /// level: Level::DEBUG, -/// filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".to_string(), +/// filter: "wgpu=info,bevy_render=info,bevy_ecs=trace".to_string(), /// }) /// .add_plugins(DefaultPlugins) /// .run(); @@ -63,7 +63,7 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter}; /// ``` /// /// Log level can also be changed using the `RUST_LOG` environment variable. -/// For example, using `RUST_LOG=wgpu=error,bevy_render=info,bevy_ecs=trace cargo run ..` +/// For example, using `RUST_LOG=wgpu=info,bevy_render=info,bevy_ecs=trace cargo run ..` /// /// It has the same syntax as the field [`LogSettings::filter`], see [`EnvFilter`]. /// If you define the `RUST_LOG` environment variable, the [`LogSettings`] resource @@ -103,7 +103,7 @@ pub struct LogSettings { impl Default for LogSettings { fn default() -> Self { Self { - filter: "wgpu=error".to_string(), + filter: "wgpu=info".to_string(), level: Level::INFO, } } diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 879dbbbf9af9d..f7fcabb55b6be 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -20,7 +20,7 @@ dds = ["ddsfile"] zlib = ["flate2"] zstd = ["ruzstd"] -trace = [] +trace = ["profiling"] tracing-tracy = [] wgpu_trace = ["wgpu/trace"] ci_limits = [] @@ -71,3 +71,5 @@ ruzstd = { version = "0.2.4", optional = true } # For transcoding of UASTC/ETC1S universal formats, and for .basis file support basis-universal = { version = "0.2.0", optional = true } encase = { version = "0.2", features = ["glam"] } +# for wgpu profiling using tracing +profiling = { version = "1", features = ["profile-with-tracing"], optional = true } From ceca6ccab77d897c2054bd817400be17e3f6bf29 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Mon, 4 Jul 2022 10:19:00 +0200 Subject: [PATCH 2/3] bevy_log: Roll back default filter to use wgpu=error --- crates/bevy_log/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 11904aafe1477..0259aafd71457 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -55,7 +55,7 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter}; /// App::new() /// .insert_resource(LogSettings { /// level: Level::DEBUG, -/// filter: "wgpu=info,bevy_render=info,bevy_ecs=trace".to_string(), +/// filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".to_string(), /// }) /// .add_plugins(DefaultPlugins) /// .run(); @@ -63,7 +63,7 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter}; /// ``` /// /// Log level can also be changed using the `RUST_LOG` environment variable. -/// For example, using `RUST_LOG=wgpu=info,bevy_render=info,bevy_ecs=trace cargo run ..` +/// For example, using `RUST_LOG=wgpu=error,bevy_render=info,bevy_ecs=trace cargo run ..` /// /// It has the same syntax as the field [`LogSettings::filter`], see [`EnvFilter`]. /// If you define the `RUST_LOG` environment variable, the [`LogSettings`] resource @@ -103,7 +103,7 @@ pub struct LogSettings { impl Default for LogSettings { fn default() -> Self { Self { - filter: "wgpu=info".to_string(), + filter: "wgpu=error".to_string(), level: Level::INFO, } } From 33775dbd9edaa01bcbc22c35a2b892374ecba8dd Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Mon, 4 Jul 2022 10:22:01 +0200 Subject: [PATCH 3/3] Cargo.toml: Clarify documentation of the optional profiling crate dependency --- crates/bevy_render/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 6d847acc57c7f..a1643eafd5895 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -71,5 +71,5 @@ ruzstd = { version = "0.2.4", optional = true } # For transcoding of UASTC/ETC1S universal formats, and for .basis file support basis-universal = { version = "0.2.0", optional = true } encase = { version = "0.3", features = ["glam"] } -# for wgpu profiling using tracing +# For wgpu profiling using tracing. Use `RUST_LOG=info` to also capture the wgpu spans. profiling = { version = "1", features = ["profile-with-tracing"], optional = true }