Skip to content

Commit

Permalink
fix(mobile): disable MSAA on Android to prevent device panic
Browse files Browse the repository at this point in the history
MSAA (Multi-Sample Anti-Aliasing) has been observed to cause some Android
devices to panic. This commit disables MSAA on Android builds to avoid
device crashes while playing the Sokoban game. The issue is under
investigation and more information can be found in the related Bevy
engine issue tracker.

Issue: bevyengine/bevy#8229
  • Loading branch information
ShenMian committed Jun 11, 2024
1 parent 608bd9d commit 60bc881
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions mobile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ use sokoban::GamePlugin;

#[bevy_main]
fn main() {
App::new()
.add_plugins((
DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
resizable: false,
mode: WindowMode::BorderlessFullscreen,
..default()
}),
let mut app = App::new();
app.add_plugins((
DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
resizable: false,
mode: WindowMode::BorderlessFullscreen,
..default()
}),
GamePlugin,
))
.run()
..default()
}),
GamePlugin,
));

// MSAA makes some Android devices panic, this is under investigation
// https://github.com/bevyengine/bevy/issues/8229
#[cfg(target_os = "android")]
app.insert_resource(Msaa::Off);

app.run();
}

0 comments on commit 60bc881

Please sign in to comment.