mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Use the Continuous
update mode in stress tests when unfocused (#11652)
# Objective - When running any of the stress tests, the refresh rate is currently capped to 60hz because of the `ReactiveLowPower` default used when the window is not in focus. Since stress tests should run as fast as possible (and as such vsync is disabled for all of them), it makes sense to always run them in `Continuous` mode. This is especially useful to avoid capturing non-representative frame times when recording a Tracy frame. ## Solution - Always use the `Continuous` update mode in stress tests.
This commit is contained in:
parent
b1a2d342af
commit
e3cf5f8fb2
10 changed files with 50 additions and 0 deletions
|
@ -15,6 +15,7 @@ use bevy::{
|
|||
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
|
||||
utils::Duration,
|
||||
window::{PresentMode, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
use rand::{rngs::StdRng, seq::SliceRandom, Rng, SeedableRng};
|
||||
|
||||
|
@ -115,6 +116,10 @@ fn main() {
|
|||
FrameTimeDiagnosticsPlugin,
|
||||
LogDiagnosticsPlugin::default(),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.insert_resource(args)
|
||||
.insert_resource(BevyCounter {
|
||||
count: 0,
|
||||
|
|
|
@ -11,6 +11,7 @@ use bevy::{
|
|||
prelude::*,
|
||||
render::camera::Camera,
|
||||
window::{PresentMode, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
use rand::Rng;
|
||||
|
@ -33,6 +34,10 @@ fn main() {
|
|||
..default()
|
||||
}),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(
|
||||
Update,
|
||||
|
|
|
@ -4,6 +4,7 @@ use bevy::{
|
|||
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
|
||||
prelude::*,
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
const FONT_SIZE: f32 = 7.0;
|
||||
|
@ -62,6 +63,10 @@ fn main() {
|
|||
FrameTimeDiagnosticsPlugin,
|
||||
LogDiagnosticsPlugin::default(),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.add_systems(Update, button_system);
|
||||
|
||||
if args.grid {
|
||||
|
|
|
@ -20,6 +20,7 @@ use bevy::{
|
|||
render_resource::{Extent3d, TextureDimension, TextureFormat},
|
||||
},
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
use rand::{rngs::StdRng, seq::SliceRandom, Rng, SeedableRng};
|
||||
|
||||
|
@ -86,6 +87,10 @@ fn main() {
|
|||
FrameTimeDiagnosticsPlugin,
|
||||
LogDiagnosticsPlugin::default(),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.insert_resource(args)
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, (move_camera, print_mesh_count))
|
||||
|
|
|
@ -10,6 +10,7 @@ use bevy::{
|
|||
pbr::CascadeShadowConfigBuilder,
|
||||
prelude::*,
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
#[derive(FromArgs, Resource)]
|
||||
|
@ -54,6 +55,10 @@ fn main() {
|
|||
FrameTimeDiagnosticsPlugin,
|
||||
LogDiagnosticsPlugin::default(),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.insert_resource(Foxes {
|
||||
count: args.count,
|
||||
speed: 2.0,
|
||||
|
|
|
@ -4,6 +4,7 @@ use bevy::{
|
|||
diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin},
|
||||
prelude::*,
|
||||
window::{PresentMode, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
const SYSTEM_COUNT: u32 = 10;
|
||||
|
@ -22,6 +23,10 @@ fn main() {
|
|||
}),
|
||||
FrameTimeDiagnosticsPlugin,
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.insert_resource(Config {
|
||||
line_count: 50_000,
|
||||
fancy: false,
|
||||
|
|
|
@ -10,6 +10,7 @@ use bevy::{
|
|||
prelude::*,
|
||||
text::{BreakLineOn, Text2dBounds},
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
|
@ -26,6 +27,10 @@ fn main() {
|
|||
FrameTimeDiagnosticsPlugin,
|
||||
LogDiagnosticsPlugin::default(),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.add_systems(Startup, setup);
|
||||
|
||||
if std::env::args().any(|arg| arg == "recompute-text") {
|
||||
|
|
|
@ -10,6 +10,7 @@ use bevy::{
|
|||
prelude::*,
|
||||
render::{camera::ScalingMode, Render, RenderApp, RenderSet},
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
use rand::{thread_rng, Rng};
|
||||
|
||||
|
@ -30,6 +31,10 @@ fn main() {
|
|||
LogDiagnosticsPlugin::default(),
|
||||
LogVisibleLights,
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, (move_camera, print_light_count))
|
||||
.run();
|
||||
|
|
|
@ -11,6 +11,7 @@ use bevy::{
|
|||
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
|
||||
prelude::*,
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
use rand::Rng;
|
||||
|
@ -41,6 +42,10 @@ fn main() {
|
|||
..default()
|
||||
}),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(
|
||||
Update,
|
||||
|
|
|
@ -7,6 +7,7 @@ use bevy::{
|
|||
prelude::*,
|
||||
text::{BreakLineOn, Text2dBounds},
|
||||
window::{PresentMode, WindowPlugin, WindowResolution},
|
||||
winit::{UpdateMode, WinitSettings},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
|
@ -24,6 +25,10 @@ fn main() {
|
|||
FrameTimeDiagnosticsPlugin,
|
||||
LogDiagnosticsPlugin::default(),
|
||||
))
|
||||
.insert_resource(WinitSettings {
|
||||
focused_mode: UpdateMode::Continuous,
|
||||
unfocused_mode: UpdateMode::Continuous,
|
||||
})
|
||||
.add_systems(Startup, spawn)
|
||||
.add_systems(Update, update_text_bounds)
|
||||
.run();
|
||||
|
|
Loading…
Reference in a new issue