bevyengine / bevyengine/bevy

UI elements randomly disappear for some frames on specific android devices

Open
#14,710 35 comments 2 reactions 0 assignees View on GitHub
A-Rendering A-UI A-Windowing C-Bug O-Android S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

Bevy 0.14.1

## Relevant system information

Samsung Galaxy A34
Cargo 1.80.0
Built using https://github.com/NiklasEi/xbuild

## What you did

Rendered user interface and a regular sprite.

```rs
use bevy::prelude::*;

#[bevy_main]
fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins).add_systems(Startup, setup);
app.run();
}

fn setup(mut commands: Commands, asset_server: Res) {
commands.spawn((Camera2dBundle::default(), IsDefaultUiCamera));
commands.spawn((
NodeBundle {
style: Style {
width: Val::Px(500.0),
height: Val::Px(125.0),
..default()
},
..default()
},
UiImage::new(asset_server.load("branding/bevy_logo_dark_big.png")),
));
commands.spawn(SpriteBundle {
transform: Transform::from_xyz(0., 0., 0.),
sprite: Sprite {
custom_size: Some(Vec2::new(500., 125.)),
..default()
},
texture: asset_server.load("branding/bevy_logo_dark_big.png"),
..default()
});
}
```

## What went wrong

The ui image is flickering, but the regular sprite is not flickering.

## Additional information

https://github.com/user-attachments/assets/e5c3c48b-6470-440b-9392-e4a2257ec75b

One of my play testers for my game has this issue, this was recorded on their phone. Other people, including me don't have this issue so it could be a device related issue. This flickering also happens on text and 9-slices (not shown in example).

This issue happened once to me, but never again after that. But on this persons phone it seems to happen almost always.

This might be a related issue: https://github.com/gfx-rs/wgpu/issues/2399, but I am not sure since it only happens on UI elements as shown in the video.

This pull request seems to be solving a similar issue: https://github.com/bevyengine/bevy/pull/13462.

Maybe this bug has something to do with system ordering?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.