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.
This commit is contained in:
parent
c5e00b085e
commit
4a2d3c83c7
|
@ -34,6 +34,7 @@ public:
|
||||||
std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config,
|
std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config,
|
||||||
const void* cache_data = nullptr,
|
const void* cache_data = nullptr,
|
||||||
size_t cache_data_length = 0) override;
|
size_t cache_data_length = 0) override;
|
||||||
|
SurfaceInfo GetSurfaceInfo() const override { return {}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class NullRenderer final : public Renderer
|
class NullRenderer final : public Renderer
|
||||||
|
|
|
@ -128,4 +128,11 @@ void SWGfx::SetScissorRect(const MathUtil::Rectangle<int>& rc)
|
||||||
Rasterizer::ScissorChanged();
|
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
|
} // namespace SW
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
void ClearRegion(const MathUtil::Rectangle<int>& target_rc, bool colorEnable, bool alphaEnable,
|
void ClearRegion(const MathUtil::Rectangle<int>& target_rc, bool colorEnable, bool alphaEnable,
|
||||||
bool zEnable, u32 color, u32 z) override;
|
bool zEnable, u32 color, u32 z) override;
|
||||||
|
|
||||||
|
SurfaceInfo GetSurfaceInfo() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<SWOGLWindow> m_window;
|
std::unique_ptr<SWOGLWindow> m_window;
|
||||||
};
|
};
|
||||||
|
|
|
@ -161,7 +161,7 @@ public:
|
||||||
bool UseGeometryShaderForUI() const;
|
bool UseGeometryShaderForUI() const;
|
||||||
|
|
||||||
// Returns info about the main surface (aka backbuffer)
|
// Returns info about the main surface (aka backbuffer)
|
||||||
virtual SurfaceInfo GetSurfaceInfo() const { return {}; }
|
virtual SurfaceInfo GetSurfaceInfo() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AbstractFramebuffer* m_current_framebuffer = nullptr;
|
AbstractFramebuffer* m_current_framebuffer = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue