From 00e60b67f43bc360e16687d3db90b1f28caee7f2 Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Sun, 3 Jul 2022 13:22:22 -0400 Subject: [PATCH 1/3] Disable Vsync for stress tests. --- examples/stress_tests/many_cubes.rs | 4 ++++ examples/stress_tests/many_foxes.rs | 1 + examples/stress_tests/many_sprites.rs | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/examples/stress_tests/many_cubes.rs b/examples/stress_tests/many_cubes.rs index 7a18c02559ad7..070c4953899aa 100644 --- a/examples/stress_tests/many_cubes.rs +++ b/examples/stress_tests/many_cubes.rs @@ -18,6 +18,10 @@ use bevy::{ fn main() { App::new() + .insert_resource(WindowDescriptor { + present_mode: bevy::window::PresentMode::Immediate, + ..default() + }) .add_plugins(DefaultPlugins) .add_plugin(FrameTimeDiagnosticsPlugin::default()) .add_plugin(LogDiagnosticsPlugin::default()) diff --git a/examples/stress_tests/many_foxes.rs b/examples/stress_tests/many_foxes.rs index 3888e2c3c4671..d6c456206d828 100644 --- a/examples/stress_tests/many_foxes.rs +++ b/examples/stress_tests/many_foxes.rs @@ -16,6 +16,7 @@ fn main() { App::new() .insert_resource(WindowDescriptor { title: "🦊🦊🦊 Many Foxes! 🦊🦊🦊".to_string(), + present_mode: bevy::window::PresentMode::Immediate, ..default() }) .add_plugins(DefaultPlugins) diff --git a/examples/stress_tests/many_sprites.rs b/examples/stress_tests/many_sprites.rs index cfc69d12cca8e..180eeb04ebb43 100644 --- a/examples/stress_tests/many_sprites.rs +++ b/examples/stress_tests/many_sprites.rs @@ -17,6 +17,10 @@ const CAMERA_SPEED: f32 = 1000.0; fn main() { App::new() + .insert_resource(WindowDescriptor { + present_mode: bevy::window::PresentMode::Immediate, + ..default() + }) // Since this is also used as a benchmark, we want it to display performance data. .add_plugin(LogDiagnosticsPlugin::default()) .add_plugin(FrameTimeDiagnosticsPlugin::default()) From 4f4174d80f729a379d32dbab41f4cc6bffaa841f Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Sun, 3 Jul 2022 14:32:57 -0400 Subject: [PATCH 2/3] Put it into the use block. --- examples/stress_tests/many_cubes.rs | 4 ++-- examples/stress_tests/many_foxes.rs | 4 ++-- examples/stress_tests/many_lights.rs | 4 ++-- examples/stress_tests/many_sprites.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/stress_tests/many_cubes.rs b/examples/stress_tests/many_cubes.rs index 070c4953899aa..0cf12f96ffab4 100644 --- a/examples/stress_tests/many_cubes.rs +++ b/examples/stress_tests/many_cubes.rs @@ -13,13 +13,13 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, math::{DVec2, DVec3}, - prelude::*, + prelude::*, window::PresentMode, }; fn main() { App::new() .insert_resource(WindowDescriptor { - present_mode: bevy::window::PresentMode::Immediate, + present_mode: PresentMode::Immediate, ..default() }) .add_plugins(DefaultPlugins) diff --git a/examples/stress_tests/many_foxes.rs b/examples/stress_tests/many_foxes.rs index d6c456206d828..212cfe6306be3 100644 --- a/examples/stress_tests/many_foxes.rs +++ b/examples/stress_tests/many_foxes.rs @@ -3,7 +3,7 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, - prelude::*, + prelude::*, window::PresentMode, }; struct Foxes { @@ -16,7 +16,7 @@ fn main() { App::new() .insert_resource(WindowDescriptor { title: "🦊🦊🦊 Many Foxes! 🦊🦊🦊".to_string(), - present_mode: bevy::window::PresentMode::Immediate, + present_mode: PresentMode::Immediate, ..default() }) .add_plugins(DefaultPlugins) diff --git a/examples/stress_tests/many_lights.rs b/examples/stress_tests/many_lights.rs index 3a6c75b107dee..849043ad6c802 100644 --- a/examples/stress_tests/many_lights.rs +++ b/examples/stress_tests/many_lights.rs @@ -6,7 +6,7 @@ use bevy::{ math::{DVec2, DVec3}, pbr::{ExtractedPointLight, GlobalLightMeta}, prelude::*, - render::{camera::ScalingMode, RenderApp, RenderStage}, + render::{camera::ScalingMode, RenderApp, RenderStage}, window::PresentMode, }; use rand::{thread_rng, Rng}; @@ -16,7 +16,7 @@ fn main() { width: 1024.0, height: 768.0, title: "many_lights".to_string(), - present_mode: bevy::window::PresentMode::Immediate, + present_mode: PresentMode::Immediate, ..default() }) .add_plugins(DefaultPlugins) diff --git a/examples/stress_tests/many_sprites.rs b/examples/stress_tests/many_sprites.rs index 180eeb04ebb43..514d969801951 100644 --- a/examples/stress_tests/many_sprites.rs +++ b/examples/stress_tests/many_sprites.rs @@ -8,7 +8,7 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, math::Quat, prelude::*, - render::camera::Camera, + render::camera::Camera, window::PresentMode, }; use rand::Rng; @@ -18,7 +18,7 @@ const CAMERA_SPEED: f32 = 1000.0; fn main() { App::new() .insert_resource(WindowDescriptor { - present_mode: bevy::window::PresentMode::Immediate, + present_mode: PresentMode::Immediate, ..default() }) // Since this is also used as a benchmark, we want it to display performance data. From 5d9eb3d14845f085186b10200467c50d6fb04095 Mon Sep 17 00:00:00 2001 From: Elabajaba Date: Sun, 3 Jul 2022 14:35:28 -0400 Subject: [PATCH 3/3] formatting --- examples/stress_tests/many_cubes.rs | 3 ++- examples/stress_tests/many_foxes.rs | 3 ++- examples/stress_tests/many_lights.rs | 3 ++- examples/stress_tests/many_sprites.rs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/stress_tests/many_cubes.rs b/examples/stress_tests/many_cubes.rs index 0cf12f96ffab4..2e0678831389d 100644 --- a/examples/stress_tests/many_cubes.rs +++ b/examples/stress_tests/many_cubes.rs @@ -13,7 +13,8 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, math::{DVec2, DVec3}, - prelude::*, window::PresentMode, + prelude::*, + window::PresentMode, }; fn main() { diff --git a/examples/stress_tests/many_foxes.rs b/examples/stress_tests/many_foxes.rs index 212cfe6306be3..83a3ff3204ed4 100644 --- a/examples/stress_tests/many_foxes.rs +++ b/examples/stress_tests/many_foxes.rs @@ -3,7 +3,8 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, - prelude::*, window::PresentMode, + prelude::*, + window::PresentMode, }; struct Foxes { diff --git a/examples/stress_tests/many_lights.rs b/examples/stress_tests/many_lights.rs index 849043ad6c802..911b611ab81b9 100644 --- a/examples/stress_tests/many_lights.rs +++ b/examples/stress_tests/many_lights.rs @@ -6,7 +6,8 @@ use bevy::{ math::{DVec2, DVec3}, pbr::{ExtractedPointLight, GlobalLightMeta}, prelude::*, - render::{camera::ScalingMode, RenderApp, RenderStage}, window::PresentMode, + render::{camera::ScalingMode, RenderApp, RenderStage}, + window::PresentMode, }; use rand::{thread_rng, Rng}; diff --git a/examples/stress_tests/many_sprites.rs b/examples/stress_tests/many_sprites.rs index 514d969801951..b475a2e1cfef9 100644 --- a/examples/stress_tests/many_sprites.rs +++ b/examples/stress_tests/many_sprites.rs @@ -8,7 +8,8 @@ use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, math::Quat, prelude::*, - render::camera::Camera, window::PresentMode, + render::camera::Camera, + window::PresentMode, }; use rand::Rng;