summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/EfbCopy.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-03-03 19:05:35 +0100
committerPierre Bourdon <delroth@gmail.com>2014-03-03 19:05:35 +0100
commit6fa39c28fe9f8d9b907bfd3c90b8882db4e223bc (patch)
treec03c0bee28374bdfa290e20768aaf817651dd8b6 /Source/Core/VideoBackends/Software/EfbCopy.cpp
parent91676ad93079dae4ec0735870e1b05ce8bc76583 (diff)
parent1bdf232feddff5ac05a47c99aa1dc02c1406ffc6 (diff)
Merge pull request #118 from neobrain/videosoftware-bypass-xfb-hack
Software renderer: Restore FifoPlayer support by emulating hardware backend behavior.
Diffstat (limited to 'Source/Core/VideoBackends/Software/EfbCopy.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/EfbCopy.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Software/EfbCopy.cpp b/Source/Core/VideoBackends/Software/EfbCopy.cpp
index b800ba8ee2..a8bd0bf16e 100644
--- a/Source/Core/VideoBackends/Software/EfbCopy.cpp
+++ b/Source/Core/VideoBackends/Software/EfbCopy.cpp
@@ -27,24 +27,36 @@ namespace EfbCopy
{
void CopyToXfb(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
{
- GLInterface->Update(); // just updates the render window position and the backbuffer size
+ GLInterface->Update(); // update the render window position and the backbuffer size
if (!g_SWVideoConfig.bHwRasterizer)
{
INFO_LOG(VIDEO, "xfbaddr: %x, fbwidth: %i, fbheight: %i, source: (%i, %i, %i, %i), Gamma %f",
xfbAddr, fbWidth, fbHeight, sourceRc.top, sourceRc.left, sourceRc.bottom, sourceRc.right, Gamma);
- if(!g_SWVideoConfig.bBypassXFB) {
+ if(!g_SWVideoConfig.bBypassXFB)
+ {
EfbInterface::yuv422_packed* xfb_in_ram = (EfbInterface::yuv422_packed *) Memory::GetPointer(xfbAddr);
EfbInterface::CopyToXFB(xfb_in_ram, fbWidth, fbHeight, sourceRc, Gamma);
-
- } else {
- u8 *colorTexture = SWRenderer::getColorTexture(); // Ask SWRenderer for the next color texture
+ }
+ else
+ {
+ // Ask SWRenderer for the next color texture
+ u8 *colorTexture = SWRenderer::getColorTexture();
EfbInterface::BypassXFB(colorTexture, fbWidth, fbHeight, sourceRc, Gamma);
- SWRenderer::swapColorTexture(); // Tell SWRenderer we are now finished with it.
+ // Tell SWRenderer we are now finished with it.
+ SWRenderer::swapColorTexture();
+
+ // FifoPlayer is broken and never calls BeginFrame/EndFrame.
+ // Hence, we manually force a swap now. This emulates the behavior
+ // of hardware backends with XFB emulation disabled.
+ // TODO: Fix FifoPlayer by making proper use of VideoInterface!
+ // This requires careful synchronization since GPU commands
+ // are processed on a different thread than VI commands.
+ SWRenderer::Swap(fbWidth, fbHeight);
}
}
}