Merge pull request #3961 from phire/less_virtual_xfb_lag
XFB: Send image to screen at start of field (Reduce VirtualXFB latency)
This commit is contained in:
commit
7ee6d08213
|
@ -700,13 +700,16 @@ static void BeginField(FieldType field)
|
|||
DEBUG_LOG(VIDEOINTERFACE, "HorizScaling: %04x | fbwidth %d | %u | %u", m_HorizontalScaling.Hex,
|
||||
m_FBWidth.Hex, GetTicksPerEvenField(), GetTicksPerOddField());
|
||||
|
||||
// This assumes the game isn't going to change the VI registers while a
|
||||
// frame is scanning out.
|
||||
// To correctly handle that case we would need to collate all changes
|
||||
// to VI during scanout and delay outputting the frame till then.
|
||||
if (xfbAddr)
|
||||
g_video_backend->Video_BeginField(xfbAddr, fbWidth, fbStride, fbHeight);
|
||||
}
|
||||
|
||||
static void EndField()
|
||||
{
|
||||
g_video_backend->Video_EndField();
|
||||
Core::VideoThrottle();
|
||||
}
|
||||
|
||||
|
|
|
@ -48,18 +48,6 @@ void VideoBackendBase::Video_ExitLoop()
|
|||
|
||||
// Run from the CPU thread (from VideoInterface.cpp)
|
||||
void VideoBackendBase::Video_BeginField(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight)
|
||||
{
|
||||
if (m_initialized && g_ActiveConfig.bUseXFB)
|
||||
{
|
||||
s_beginFieldArgs.xfbAddr = xfbAddr;
|
||||
s_beginFieldArgs.fbWidth = fbWidth;
|
||||
s_beginFieldArgs.fbStride = fbStride;
|
||||
s_beginFieldArgs.fbHeight = fbHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// Run from the CPU thread (from VideoInterface.cpp)
|
||||
void VideoBackendBase::Video_EndField()
|
||||
{
|
||||
if (m_initialized && g_ActiveConfig.bUseXFB && g_renderer)
|
||||
{
|
||||
|
@ -69,10 +57,10 @@ void VideoBackendBase::Video_EndField()
|
|||
e.time = 0;
|
||||
e.type = AsyncRequests::Event::SWAP_EVENT;
|
||||
|
||||
e.swap_event.xfbAddr = s_beginFieldArgs.xfbAddr;
|
||||
e.swap_event.fbWidth = s_beginFieldArgs.fbWidth;
|
||||
e.swap_event.fbStride = s_beginFieldArgs.fbStride;
|
||||
e.swap_event.fbHeight = s_beginFieldArgs.fbHeight;
|
||||
e.swap_event.xfbAddr = xfbAddr;
|
||||
e.swap_event.fbWidth = fbWidth;
|
||||
e.swap_event.fbStride = fbStride;
|
||||
e.swap_event.fbHeight = fbHeight;
|
||||
AsyncRequests::GetInstance()->PushEvent(e, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@ public:
|
|||
virtual void Video_Cleanup() = 0; // called from gl/d3d thread
|
||||
|
||||
void Video_BeginField(u32, u32, u32, u32);
|
||||
void Video_EndField();
|
||||
|
||||
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32);
|
||||
u32 Video_GetQueryResult(PerfQueryType type);
|
||||
|
|
Loading…
Reference in New Issue