Skip to content

Commit 0cdd974

Browse files
ElabajabaItsDoot
authored andcommitted
Disable Vsync for stress tests. (bevyengine#5187)
# Objective Currently stress tests are vsynced. This is undesirable for a stress test, as you want to run them with uncapped framerates. ## Solution Ensure all stress tests are using PresentMode::Immediate if they render anything.
1 parent 8fbb543 commit 0cdd974

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

examples/stress_tests/many_cubes.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ use bevy::{
1414
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
1515
math::{DVec2, DVec3},
1616
prelude::*,
17+
window::PresentMode,
1718
};
1819

1920
fn main() {
2021
App::new()
22+
.insert_resource(WindowDescriptor {
23+
present_mode: PresentMode::Immediate,
24+
..default()
25+
})
2126
.add_plugins(DefaultPlugins)
2227
.add_plugin(FrameTimeDiagnosticsPlugin::default())
2328
.add_plugin(LogDiagnosticsPlugin::default())

examples/stress_tests/many_foxes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use bevy::{
55
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
66
prelude::*,
7+
window::PresentMode,
78
};
89

910
struct Foxes {
@@ -16,6 +17,7 @@ fn main() {
1617
App::new()
1718
.insert_resource(WindowDescriptor {
1819
title: "🦊🦊🦊 Many Foxes! 🦊🦊🦊".to_string(),
20+
present_mode: PresentMode::Immediate,
1921
..default()
2022
})
2123
.add_plugins(DefaultPlugins)

examples/stress_tests/many_lights.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use bevy::{
77
pbr::{ExtractedPointLight, GlobalLightMeta},
88
prelude::*,
99
render::{camera::ScalingMode, RenderApp, RenderStage},
10+
window::PresentMode,
1011
};
1112
use rand::{thread_rng, Rng};
1213

@@ -16,7 +17,7 @@ fn main() {
1617
width: 1024.0,
1718
height: 768.0,
1819
title: "many_lights".to_string(),
19-
present_mode: bevy::window::PresentMode::Immediate,
20+
present_mode: PresentMode::Immediate,
2021
..default()
2122
})
2223
.add_plugins(DefaultPlugins)

examples/stress_tests/many_sprites.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use bevy::{
99
math::Quat,
1010
prelude::*,
1111
render::camera::Camera,
12+
window::PresentMode,
1213
};
1314

1415
use rand::Rng;
@@ -17,6 +18,10 @@ const CAMERA_SPEED: f32 = 1000.0;
1718

1819
fn main() {
1920
App::new()
21+
.insert_resource(WindowDescriptor {
22+
present_mode: PresentMode::Immediate,
23+
..default()
24+
})
2025
// Since this is also used as a benchmark, we want it to display performance data.
2126
.add_plugin(LogDiagnosticsPlugin::default())
2227
.add_plugin(FrameTimeDiagnosticsPlugin::default())

0 commit comments

Comments
 (0)