mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 18:45:45 -04:00
Frontend: Reset/restore GPU state before saving screenshot
Fixes driver crashes in Vulkan.
This commit is contained in:
@ -1947,7 +1947,11 @@ bool CommonHostInterface::SaveScreenshot(const char* filename /* = nullptr */, b
|
||||
filename = auto_filename.c_str();
|
||||
}
|
||||
|
||||
if (!m_display->WriteDisplayTextureToFile(filename, full_resolution, apply_aspect_ratio))
|
||||
m_system->GetGPU()->ResetGraphicsAPIState();
|
||||
const bool screenshot_saved =
|
||||
m_display->WriteDisplayTextureToFile(filename, full_resolution, apply_aspect_ratio);
|
||||
m_system->GetGPU()->RestoreGraphicsAPIState();
|
||||
if (!screenshot_saved)
|
||||
{
|
||||
AddFormattedOSDMessage(10.0f, "Failed to save screenshot to '%s'", filename);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user