summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorMai <mai.iam2048@gmail.com>2023-03-02 15:13:00 -0500
committerGitHub <noreply@github.com>2023-03-02 15:13:00 -0500
commit6361586a048dbbf617bc6e09b2f9edae815c3d8c (patch)
tree94f1c506eb6eb110f2819f74dc5f6389c80410a1 /Source/Core/VideoBackends
parentab2f8d3475fa7dd1f1bad911bf70eb9c85eeb0da (diff)
parent9cdc0aca9b599cd5626cba853b63dc99ce4a2213 (diff)
Merge pull request #11582 from Pokechu22/software-crash-on-startup
Software: Fix regressions from "Kill Renderer"
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/Null/NullGfx.h1
-rw-r--r--Source/Core/VideoBackends/Software/SWGfx.cpp7
-rw-r--r--Source/Core/VideoBackends/Software/SWGfx.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Null/NullGfx.h b/Source/Core/VideoBackends/Null/NullGfx.h
index b1dff2bc2f..63b999b859 100644
--- a/Source/Core/VideoBackends/Null/NullGfx.h
+++ b/Source/Core/VideoBackends/Null/NullGfx.h
@@ -34,6 +34,7 @@ public:
std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config,
const void* cache_data = nullptr,
size_t cache_data_length = 0) override;
+ SurfaceInfo GetSurfaceInfo() const override { return {}; }
};
class NullRenderer final : public Renderer
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;
};