From 78428dd8db9e6711cb3bf77b7dc8c99998d8ba72 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sat, 18 Feb 2023 12:28:15 -0800 Subject: Software: Fix crash on startup when using "Compile Shaders Before Starting" When that setting is enabled, m_xfb_entry is initially not present (during the phase where a shader compilation progress bar would be shown). The main path checks for m_xfb_entry, but the software renderer fallback path didn't. Fixes another aspect of https://bugs.dolphin-emu.org/issues/13172. --- Source/Core/VideoCommon/Present.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/Present.cpp') diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp index 181dfea140..78e09de3e5 100644 --- a/Source/Core/VideoCommon/Present.cpp +++ b/Source/Core/VideoCommon/Present.cpp @@ -521,9 +521,10 @@ void Presenter::Present() if (!g_gfx->SupportsUtilityDrawing()) { - // Video Software doesn't support Drawing a UI or doing post-processing - // So just Show the XFB - g_gfx->ShowImage(m_xfb_entry->texture.get(), m_xfb_rect); + // Video Software doesn't support drawing a UI or doing post-processing + // So just show the XFB + if (m_xfb_entry) + g_gfx->ShowImage(m_xfb_entry->texture.get(), m_xfb_rect); return; } -- cgit v1.2.3 From 9cdc0aca9b599cd5626cba853b63dc99ce4a2213 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sat, 18 Feb 2023 12:58:25 -0800 Subject: Software: Fix "Auto-Adjust Window Size" This also needs to be handled on the software renderer path. --- Source/Core/VideoCommon/Present.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Core/VideoCommon/Present.cpp') diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp index 78e09de3e5..25ec2f27b0 100644 --- a/Source/Core/VideoCommon/Present.cpp +++ b/Source/Core/VideoCommon/Present.cpp @@ -524,7 +524,13 @@ void Presenter::Present() // Video Software doesn't support drawing a UI or doing post-processing // So just show the XFB if (m_xfb_entry) + { g_gfx->ShowImage(m_xfb_entry->texture.get(), m_xfb_rect); + + // Update the window size based on the frame that was just rendered. + // Due to depending on guest state, we need to call this every frame. + SetWindowSize(m_xfb_rect.GetWidth(), m_xfb_rect.GetHeight()); + } return; } -- cgit v1.2.3