Merge pull request #11582 from Pokechu22/software-crash-on-startup
Software: Fix regressions from "Kill Renderer"
This commit is contained in:
commit
6361586a04
|
@ -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;
|
||||||
|
|
|
@ -521,9 +521,16 @@ void Presenter::Present()
|
||||||
|
|
||||||
if (!g_gfx->SupportsUtilityDrawing())
|
if (!g_gfx->SupportsUtilityDrawing())
|
||||||
{
|
{
|
||||||
// Video Software doesn't support Drawing a UI or doing post-processing
|
// Video Software doesn't support drawing a UI or doing post-processing
|
||||||
// So just Show the XFB
|
// So just show the XFB
|
||||||
g_gfx->ShowImage(m_xfb_entry->texture.get(), m_xfb_rect);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue