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 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& 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& target_rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z) override; + SurfaceInfo GetSurfaceInfo() const override; + private: std::unique_ptr m_window; }; diff --git a/Source/Core/VideoCommon/AbstractGfx.h b/Source/Core/VideoCommon/AbstractGfx.h index 916bcd4e11..ac51415806 100644 --- a/Source/Core/VideoCommon/AbstractGfx.h +++ b/Source/Core/VideoCommon/AbstractGfx.h @@ -161,7 +161,7 @@ public: bool UseGeometryShaderForUI() const; // Returns info about the main surface (aka backbuffer) - virtual SurfaceInfo GetSurfaceInfo() const { return {}; } + virtual SurfaceInfo GetSurfaceInfo() const = 0; protected: AbstractFramebuffer* m_current_framebuffer = nullptr;