Display buffer flips are now triggered by the CPU thread through the Video_UpdateXFB function. This is a fairly significant change of behavior, but it improves performance.

Also, render target code is cleaned up. Post-processing shaders now work with multisampling and Real-XFB mode.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3545 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Nolan Check
2009-06-26 08:57:53 +00:00
parent a7eb7bbf00
commit ade9479005
9 changed files with 240 additions and 420 deletions

View File

@ -1079,44 +1079,40 @@ void Update()
u8* xfbPtr = 0;
int yOffset = 0;
// (mb2) hack: We request XFB updates from CPUthread (here) only when homebrews use directly XFB without FIFO and CP
if (!Core::GetStartupParameter().bUseDualCore || CommandProcessor::IsCommandProcessorNotUsed())
if (NextXFBRender == 1)
{
if (NextXFBRender == 1)
{
NextXFBRender = LinesPerField;
// TODO: proper VI regs typedef and logic for XFB to work.
// eg. Animal Crossing gc have smth in TFBL.XOF bitfield.
// "XOF - Horizontal Offset of the left-most pixel within the first word of the fetched picture."
xfbPtr = GetXFBPointerTop();
_dbg_assert_msg_(VIDEOINTERFACE, xfbPtr, "Bad top XFB address");
}
NextXFBRender = LinesPerField;
// TODO: proper VI regs typedef and logic for XFB to work.
// eg. Animal Crossing gc have smth in TFBL.XOF bitfield.
// "XOF - Horizontal Offset of the left-most pixel within the first word of the fetched picture."
xfbPtr = GetXFBPointerTop();
_dbg_assert_msg_(VIDEOINTERFACE, xfbPtr, "Bad top XFB address");
}
else
{
NextXFBRender = 1;
// Previously checked m_XFBInfoTop.POFF then used m_XFBInfoBottom.FBB, try reverting if there are problems
xfbPtr = GetXFBPointerBottom();
_dbg_assert_msg_(VIDEOINTERFACE, xfbPtr, "Bad bottom XFB address");
yOffset = -1;
}
Common::PluginVideo* video = CPluginManager::GetInstance().GetVideo();
if (xfbPtr && video->IsValid())
{
int fbWidth = m_HorizontalStepping.FieldSteps * 16;
int fbHeight = (m_HorizontalStepping.FbSteps / m_HorizontalStepping.FieldSteps) * m_VerticalTimingRegister.ACV;
DEBUG_LOG(VIDEOINTERFACE, "(VI->XFBUpdate): ptr: %p | %ix%i | xoff: %i",
xfbPtr, fbWidth, fbHeight, m_XFBInfoTop.XOFF);
if (Core::GetStartupParameter().bUseDualCore)
// scheduled on EmuThread in DC mode
video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset, TRUE);
else
{
NextXFBRender = 1;
// Previously checked m_XFBInfoTop.POFF then used m_XFBInfoBottom.FBB, try reverting if there are problems
xfbPtr = GetXFBPointerBottom();
_dbg_assert_msg_(VIDEOINTERFACE, xfbPtr, "Bad bottom XFB address");
yOffset = -1;
}
Common::PluginVideo* video = CPluginManager::GetInstance().GetVideo();
if (xfbPtr && video->IsValid())
{
int fbWidth = m_HorizontalStepping.FieldSteps * 16;
int fbHeight = (m_HorizontalStepping.FbSteps / m_HorizontalStepping.FieldSteps) * m_VerticalTimingRegister.ACV;
DEBUG_LOG(VIDEOINTERFACE, "(VI->XFBUpdate): ptr: %p | %ix%i | xoff: %i",
xfbPtr, fbWidth, fbHeight, m_XFBInfoTop.XOFF);
if (Core::GetStartupParameter().bUseDualCore)
// scheduled on EmuThread in DC mode
video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset, TRUE);
else
// otherwise do it now from here (CPUthread)
video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset, FALSE);
}
// otherwise do it now from here (CPUthread)
video->Video_UpdateXFB(xfbPtr, fbWidth, fbHeight, yOffset, FALSE);
}
}

View File

@ -143,7 +143,6 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
if (g_XFBUpdateRequested)
{
Video_UpdateXFB(NULL, 0, 0, 0, FALSE);
video_initialize.pCopiedToXFB();
}
// check if we are able to run this buffer