Refactor to remove virtual from RenderXFBToScreen
Slightly simplifies the upcoming refactor
This commit is contained in:
parent
a01d5283ec
commit
c38c76abad
|
@ -115,6 +115,8 @@ void VideoBackend::InitBackendInfo()
|
|||
g_Config.backend_info.bSupportsTextureQueryLevels = false;
|
||||
g_Config.backend_info.bSupportsSettingObjectNames = false;
|
||||
|
||||
g_Config.backend_info.bUsesExplictQuadBuffering = true;
|
||||
|
||||
g_Config.backend_info.Adapters.clear();
|
||||
|
||||
// aamodes - 1 is to stay consistent with D3D (means no AA)
|
||||
|
|
|
@ -963,20 +963,18 @@ void Renderer::ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable,
|
|||
BPFunctions::SetScissorAndViewport();
|
||||
}
|
||||
|
||||
void Renderer::RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
|
||||
const AbstractTexture* source_texture,
|
||||
const MathUtil::Rectangle<int>& source_rc)
|
||||
void Renderer::SelectLeftBuffer()
|
||||
{
|
||||
// Quad-buffered stereo is annoying on GL.
|
||||
if (g_ActiveConfig.stereo_mode != StereoMode::QuadBuffer)
|
||||
return ::Renderer::RenderXFBToScreen(target_rc, source_texture, source_rc);
|
||||
|
||||
glDrawBuffer(GL_BACK_LEFT);
|
||||
m_post_processor->BlitFromTexture(target_rc, source_rc, source_texture, 0);
|
||||
}
|
||||
|
||||
void Renderer::SelectRightBuffer()
|
||||
{
|
||||
glDrawBuffer(GL_BACK_RIGHT);
|
||||
m_post_processor->BlitFromTexture(target_rc, source_rc, source_texture, 1);
|
||||
}
|
||||
|
||||
void Renderer::SelectMainBuffer()
|
||||
{
|
||||
glDrawBuffer(GL_BACK);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,9 +135,6 @@ public:
|
|||
|
||||
void Flush() override;
|
||||
void WaitForGPUIdle() override;
|
||||
void RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
|
||||
const AbstractTexture* source_texture,
|
||||
const MathUtil::Rectangle<int>& source_rc) override;
|
||||
void OnConfigChanged(u32 bits) override;
|
||||
|
||||
void ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable, bool alphaEnable,
|
||||
|
@ -165,6 +162,10 @@ public:
|
|||
protected:
|
||||
std::unique_ptr<BoundingBox> CreateBoundingBox() const override;
|
||||
|
||||
virtual void SelectLeftBuffer() override;
|
||||
virtual void SelectRightBuffer() override;
|
||||
virtual void SelectMainBuffer() override;
|
||||
|
||||
private:
|
||||
void CheckForSurfaceChange();
|
||||
void CheckForSurfaceResize();
|
||||
|
|
|
@ -110,8 +110,7 @@ std::unique_ptr<AbstractPipeline> SWRenderer::CreatePipeline(const AbstractPipel
|
|||
}
|
||||
|
||||
// Called on the GPU thread
|
||||
void SWRenderer::RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
|
||||
const AbstractTexture* source_texture,
|
||||
void SWRenderer::ShowImage(const AbstractTexture* source_texture,
|
||||
const MathUtil::Rectangle<int>& source_rc)
|
||||
{
|
||||
if (!IsHeadless())
|
||||
|
|
|
@ -45,8 +45,7 @@ public:
|
|||
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
|
||||
void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override {}
|
||||
|
||||
void RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
|
||||
const AbstractTexture* source_texture,
|
||||
void ShowImage(const AbstractTexture* source_texture,
|
||||
const MathUtil::Rectangle<int>& source_rc) override;
|
||||
|
||||
void ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable, bool alphaEnable,
|
||||
|
|
|
@ -1492,7 +1492,25 @@ void Renderer::RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
|
|||
const AbstractTexture* source_texture,
|
||||
const MathUtil::Rectangle<int>& source_rc)
|
||||
{
|
||||
if (g_ActiveConfig.stereo_mode == StereoMode::SBS ||
|
||||
if (!g_ActiveConfig.backend_info.bSupportsPostProcessing)
|
||||
{
|
||||
ShowImage(source_texture, source_rc);
|
||||
return
|
||||
}
|
||||
|
||||
if (g_ActiveConfig.stereo_mode == StereoMode::QuadBuffer &&
|
||||
g_ActiveConfig.backend_info.bUsesExplictQuadBuffering)
|
||||
{
|
||||
// Quad-buffered stereo is annoying on GL.
|
||||
SelectLeftBuffer();
|
||||
m_post_processor->BlitFromTexture(target_rc, source_rc, source_texture, 0);
|
||||
|
||||
SelectRightBuffer();
|
||||
m_post_processor->BlitFromTexture(target_rc, source_rc, source_texture, 1);
|
||||
|
||||
SelectMainBuffer();
|
||||
}
|
||||
else if (g_ActiveConfig.stereo_mode == StereoMode::SBS ||
|
||||
g_ActiveConfig.stereo_mode == StereoMode::TAB)
|
||||
{
|
||||
const auto [left_rc, right_rc] = ConvertStereoRectangle(target_rc);
|
||||
|
|
|
@ -214,6 +214,7 @@ struct VideoConfig final
|
|||
|
||||
u32 MaxTextureSize = 16384;
|
||||
bool bUsesLowerLeftOrigin = false;
|
||||
bool bUsesExplictQuadBuffering = false;
|
||||
|
||||
bool bSupportsExclusiveFullscreen = false;
|
||||
bool bSupportsDualSourceBlend = false;
|
||||
|
|
Loading…
Reference in New Issue