summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2023-02-18 12:35:02 -0800
committerPokechu22 <Pokechu022@gmail.com>2023-03-02 11:08:49 -0800
commit4a2d3c83c77f71334bcb167621bcdde8f89efe87 (patch)
tree544c88ec977c766ce789fd4697846bc76a8241e6 /Source/Core/VideoBackends/Software
parentc5e00b085e3a56f05e7a6d3a8ae3a9268cd7175e (diff)
Software: Implement GetSurfaceInfo()
Before, it used a fallback where it returned a default object, where the width and height were set to 0. Presenter::Initialize() used GetSurfaceInfo to set the backbuffer size, then used that size when initializing the on-screen UI (even for the software renderer, where the on-screen UI isn't currently present), which meant that ImGui got a window size of 0 and thus resulted in a failed assertion. Although BindBackbuffer checks for size changes, it doesn't help because ImGui has already been initialized, and the size hasn't actually changed since initialization occured. Fixes one aspect of https://bugs.dolphin-emu.org/issues/13172.
Diffstat (limited to 'Source/Core/VideoBackends/Software')
-rw-r--r--Source/Core/VideoBackends/Software/SWGfx.cpp7
-rw-r--r--Source/Core/VideoBackends/Software/SWGfx.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Software/SWGfx.cpp b/Source/Core/VideoBackends/Software/SWGfx.cpp
index 4dfd5dc0f2..5837e19bf8 100644
--- a/Source/Core/VideoBackends/Software/SWGfx.cpp
+++ b/Source/Core/VideoBackends/Software/SWGfx.cpp
@@ -128,4 +128,11 @@ void SWGfx::SetScissorRect(const MathUtil::Rectangle<int>& rc)
Rasterizer::ScissorChanged();
}
+SurfaceInfo SWGfx::GetSurfaceInfo() const
+{
+ GLContext* context = m_window->GetContext();
+ return {std::max(context->GetBackBufferWidth(), 1u), std::max(context->GetBackBufferHeight(), 1u),
+ 1.0f, AbstractTextureFormat::RGBA8};
+}
+
} // namespace SW
diff --git a/Source/Core/VideoBackends/Software/SWGfx.h b/Source/Core/VideoBackends/Software/SWGfx.h
index 74ead3a323..6993c40882 100644
--- a/Source/Core/VideoBackends/Software/SWGfx.h
+++ b/Source/Core/VideoBackends/Software/SWGfx.h
@@ -49,6 +49,8 @@ public:
void ClearRegion(const MathUtil::Rectangle<int>& target_rc, bool colorEnable, bool alphaEnable,
bool zEnable, u32 color, u32 z) override;
+ SurfaceInfo GetSurfaceInfo() const override;
+
private:
std::unique_ptr<SWOGLWindow> m_window;
};