mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-02 14:05:42 -04:00
System: Fix VRAM sometimes getting lost when loading state
This commit is contained in:
parent
3c46f7b44c
commit
2768c2c91d
@ -571,7 +571,10 @@ bool DoState(StateWrapper& sw)
|
|||||||
if (!sw.DoMarker("InterruptController") || !g_interrupt_controller.DoState(sw))
|
if (!sw.DoMarker("InterruptController") || !g_interrupt_controller.DoState(sw))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!sw.DoMarker("GPU") || !g_gpu->DoState(sw))
|
g_gpu->RestoreGraphicsAPIState();
|
||||||
|
const bool gpu_result = sw.DoMarker("GPU") && g_gpu->DoState(sw);
|
||||||
|
g_gpu->ResetGraphicsAPIState();
|
||||||
|
if (!gpu_result)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!sw.DoMarker("CDROM") || !g_cdrom.DoState(sw))
|
if (!sw.DoMarker("CDROM") || !g_cdrom.DoState(sw))
|
||||||
@ -630,13 +633,7 @@ bool LoadState(ByteStream* state)
|
|||||||
if (IsShutdown())
|
if (IsShutdown())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
g_gpu->RestoreGraphicsAPIState();
|
return DoLoadState(state, false);
|
||||||
|
|
||||||
const bool result = DoLoadState(state, false);
|
|
||||||
|
|
||||||
g_gpu->ResetGraphicsAPIState();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DoLoadState(ByteStream* state, bool force_software_renderer)
|
bool DoLoadState(ByteStream* state, bool force_software_renderer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user