mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 19:13:40 +01:00
Outputs: Don't let a removal skip the wait while the graphics come back
The outputs were only marked live after deviceRestored(), so a Native_RemoveOutputAndWait() that came in while it was recreating their swapchains returned at once. On Android the surface could then be freed while a swapchain was being made on it (unplugging the TV as the app returns to the foreground). Mark them live before the queue is processed, so such a removal waits for the next frame. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a0e0115e65
commit
3e53d4bde1
1 file changed
+3
-1
+3
-1
@@ -995,10 +995,12 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
|
||||
|
||||
g_screenManager->setUIContext(uiContext);
|
||||
g_screenManager->setPostRenderCallback(&CallbackPostRender, nullptr);
|
||||
// Live before the queue is processed: a removal that comes in while the outputs' swapchains are being
|
||||
// recreated has to wait for the next frame, as its surface may be gone once it returns.
|
||||
SetOutputsLive(true);
|
||||
// An output removed while there was no device can't be recreated, its surface may be gone.
|
||||
ProcessOutputRequests();
|
||||
g_screenManager->deviceRestored(g_draw);
|
||||
SetOutputsLive(true);
|
||||
|
||||
g_audioBackend = System_CreateAudioBackend();
|
||||
if (g_audioBackend) {
|
||||
|
||||
Reference in new issue
Block a user