forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hacks for running (and screenshotting) the examples in CI on a github…
… runner (bevyengine#9220) # Objective - Enable capturing screenshots of all examples in CI on a GitHub runner ## Solution - Shorten duration of a run - Disable `desktop_app` mode - as there isn't any input in CI, examples using this take way too long to run - Change the default `ClusterConfig` - the runner are not able to do all the clusters with the default settings - Send extra `WindowResized` events - this is needed only for the `split_screen` example, because CI doesn't trigger that event unlike all the other platforms --------- Co-authored-by: Rob Parrett <[email protected]>
- Loading branch information
Showing
5 changed files
with
288 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs | ||
index 46b3e3e19..81ffad2b5 100644 | ||
--- a/crates/bevy_winit/src/lib.rs | ||
+++ b/crates/bevy_winit/src/lib.rs | ||
@@ -432,6 +432,11 @@ pub fn winit_runner(mut app: App) { | ||
}; | ||
|
||
runner_state.window_event_received = true; | ||
+ event_writers.window_resized.send(WindowResized { | ||
+ window: window_entity, | ||
+ width: window.width(), | ||
+ height: window.height(), | ||
+ }); | ||
|
||
match event { | ||
WindowEvent::Resized(size) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs | ||
index 10bdd8fe8..dda272569 100644 | ||
--- a/crates/bevy_window/src/window.rs | ||
+++ b/crates/bevy_window/src/window.rs | ||
@@ -232,7 +232,7 @@ impl Default for Window { | ||
cursor: Default::default(), | ||
present_mode: Default::default(), | ||
mode: Default::default(), | ||
- position: Default::default(), | ||
+ position: WindowPosition::Centered(MonitorSelection::Primary), | ||
resolution: Default::default(), | ||
internal: Default::default(), | ||
composite_alpha_mode: Default::default(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/crates/bevy_pbr/src/light.rs b/crates/bevy_pbr/src/light.rs | ||
index 3e8c0d451..07aa7d586 100644 | ||
--- a/crates/bevy_pbr/src/light.rs | ||
+++ b/crates/bevy_pbr/src/light.rs | ||
@@ -694,8 +694,8 @@ impl Default for ClusterConfig { | ||
// 24 depth slices, square clusters with at most 4096 total clusters | ||
// use max light distance as clusters max `Z`-depth, first slice extends to 5.0 | ||
Self::FixedZ { | ||
- total: 4096, | ||
- z_slices: 24, | ||
+ total: 128, | ||
+ z_slices: 4, | ||
z_config: ClusterZConfig::default(), | ||
dynamic_resizing: true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/crates/bevy_winit/src/winit_config.rs b/crates/bevy_winit/src/winit_config.rs | ||
index c71a92814..b138d07a0 100644 | ||
--- a/crates/bevy_winit/src/winit_config.rs | ||
+++ b/crates/bevy_winit/src/winit_config.rs | ||
@@ -47,15 +47,7 @@ impl WinitSettings { | ||
/// [`Reactive`](UpdateMode::Reactive) if windows have focus, | ||
/// [`ReactiveLowPower`](UpdateMode::ReactiveLowPower) otherwise. | ||
pub fn desktop_app() -> Self { | ||
- WinitSettings { | ||
- focused_mode: UpdateMode::Reactive { | ||
- wait: Duration::from_secs(5), | ||
- }, | ||
- unfocused_mode: UpdateMode::ReactiveLowPower { | ||
- wait: Duration::from_secs(60), | ||
- }, | ||
- ..Default::default() | ||
- } | ||
+ Self::game() | ||
} | ||
|
||
/// Returns the current [`UpdateMode`]. |
Oops, something went wrong.