Decouple XFB scanout from presentation

This commit is contained in:
Stenzek
2018-11-28 14:30:47 +10:00
parent f1e7fb505b
commit e4b205c769
16 changed files with 319 additions and 383 deletions

View File

@ -84,9 +84,9 @@ bool SWOGLWindow::Initialize(const WindowSystemInfo& wsi)
return true;
}
void SWOGLWindow::ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region)
void SWOGLWindow::ShowImage(const AbstractTexture* image, const EFBRectangle& xfb_region)
{
SW::SWTexture* sw_image = static_cast<SW::SWTexture*>(image);
const SW::SWTexture* sw_image = static_cast<const SW::SWTexture*>(image);
m_gl_context->Update(); // just updates the render window position and the backbuffer size
GLsizei glWidth = (GLsizei)m_gl_context->GetBackBufferWidth();

View File

@ -25,7 +25,7 @@ public:
bool IsHeadless() const;
// Image to show, will be swapped immediately
void ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region);
void ShowImage(const AbstractTexture* image, const EFBRectangle& xfb_region);
static std::unique_ptr<SWOGLWindow> Create(const WindowSystemInfo& wsi);

View File

@ -90,12 +90,10 @@ std::unique_ptr<AbstractPipeline> SWRenderer::CreatePipeline(const AbstractPipel
}
// Called on the GPU thread
void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region, u64 ticks)
void SWRenderer::RenderXFBToScreen(const AbstractTexture* texture, const EFBRectangle& xfb_region)
{
if (!IsHeadless())
m_window->ShowImage(texture, xfb_region);
UpdateActiveConfig();
}
u32 SWRenderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)

View File

@ -39,7 +39,7 @@ public:
TargetRectangle ConvertEFBRectangle(const EFBRectangle& rc) override;
void SwapImpl(AbstractTexture* texture, const EFBRectangle& rc, u64 ticks) override;
void RenderXFBToScreen(const AbstractTexture* texture, const EFBRectangle& rc) override;
void ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable,
u32 color, u32 z) override;