-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Provide a way to suspend the renderer when running in background #2296
Comments
related to #2018 |
Also sort of related to #1343, to save power when there is nothing to do, especially in the background. |
# 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.
# 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.
Related to Lifecycle API (#2432) too, the same renderer pausing state would be needed for XR also. |
This is at least partially solved by #3974. We could extend this by exposing I can't test this PR on iOS, but on my system it behaves as expected and outright stops using the GPU. |
It might be useful to still be able to use the CPU in the background. This is also related to the ability to run headless - it can be seen as the ability to switch to headless mode and back at runtime. |
@HackerFoo so this might instead be solved by not running the render subapp, instead of pausing the winit event loop? (but continuing to run the main app) |
What problem does this solve or what need does it fill?
Rendering can consume power unnecessarily when running in the background in a multitasking OS. For this reason, mobile OSes such as iOS do not allow use of the GPU by background tasks.
What solution would you like?
I would like a way to suspend the renderer, or maybe plugins in general, in some states.
What alternative(s) have you considered?
I have considered serializing state and exiting the main loop, but this isn't supported for iOS.
Additional context
Without this feature, if the app uses the GPU on iOS, it will be killed with this message:
The text was updated successfully, but these errors were encountered: