Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Don't update when suspended to avoid GPU use on iOS. #2482

Closed
wants to merge 2 commits into from

Conversation

HackerFoo
Copy link
Contributor

Objective

This fixes a crash caused by iOS preventing GPU access when not focused: #2296

Solution

This skips app.update() in winit_runner when winit sends the Suspended event, until Resumed.

I've tested that this works for me on my iOS app.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Jul 14, 2021
@mockersf
Copy link
Member

mockersf commented Jul 14, 2021

Ideally we would want to stop only the render part of the update when suspended, but that's much more complicated...

This is a good solution I think until we can do that 👍 (unless the rendering rework offers a better solution?)

Do you know if that fixes the similar issue on android?

@mockersf mockersf added A-App Bevy apps and plugins O-iOS Specific to the iOS mobile operating system and removed S-Needs-Triage This issue needs to be labelled labels Jul 14, 2021
@alice-i-cecile
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jul 14, 2021
@bors
Copy link
Contributor

bors bot commented Jul 14, 2021

try

Build failed:

@HackerFoo
Copy link
Contributor Author

@mockersf I have not tested this on Android.

@alice-i-cecile alice-i-cecile added the S-Needs-Investigation This issue requires detective work to figure out what's going wrong label Jul 15, 2021
@mockersf
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jul 15, 2021
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a solid solution until we can decouple rendering from updates. I'm sold!

@cart
Copy link
Member

cart commented Jul 16, 2021

bors r+

bors bot pushed a commit that referenced this pull request Jul 16, 2021
# Objective

This fixes a crash caused by iOS preventing GPU access when not focused: #2296

## Solution

This skips `app.update()` in `winit_runner` when `winit` sends the `Suspended` event, until `Resumed`.

I've tested that this works for me on my iOS app.
@mockersf
Copy link
Member

@HackerFoo could you comment on #2373 if you're ok with the license change?

@HackerFoo
Copy link
Contributor Author

@mockersf Done.

@mockersf
Copy link
Member

thanks!

@bors bors bot changed the title Don't update when suspended to avoid GPU use on iOS. [Merged by Bors] - Don't update when suspended to avoid GPU use on iOS. Jul 16, 2021
@bors bors bot closed this Jul 16, 2021
ostwilkens pushed a commit to ostwilkens/bevy that referenced this pull request Jul 27, 2021
# Objective

This fixes a crash caused by iOS preventing GPU access when not focused: bevyengine#2296

## Solution

This skips `app.update()` in `winit_runner` when `winit` sends the `Suspended` event, until `Resumed`.

I've tested that this works for me on my iOS app.
@TheRawMeatball TheRawMeatball mentioned this pull request Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-App Bevy apps and plugins O-iOS Specific to the iOS mobile operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants