mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 07:49:19 +01:00
XFB: Send image to screen at start of field.
This is much more accurate to the hardware, and saves around 16ms of latency.
This commit is contained in:
parent
93a5efa347
commit
35566316ed
@ -700,13 +700,16 @@ static void BeginField(FieldType field)
|
|||||||
DEBUG_LOG(VIDEOINTERFACE, "HorizScaling: %04x | fbwidth %d | %u | %u", m_HorizontalScaling.Hex,
|
DEBUG_LOG(VIDEOINTERFACE, "HorizScaling: %04x | fbwidth %d | %u | %u", m_HorizontalScaling.Hex,
|
||||||
m_FBWidth.Hex, GetTicksPerEvenField(), GetTicksPerOddField());
|
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)
|
if (xfbAddr)
|
||||||
g_video_backend->Video_BeginField(xfbAddr, fbWidth, fbStride, fbHeight);
|
g_video_backend->Video_BeginField(xfbAddr, fbWidth, fbStride, fbHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EndField()
|
static void EndField()
|
||||||
{
|
{
|
||||||
g_video_backend->Video_EndField();
|
|
||||||
Core::VideoThrottle();
|
Core::VideoThrottle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,18 +48,6 @@ void VideoBackendBase::Video_ExitLoop()
|
|||||||
|
|
||||||
// Run from the CPU thread (from VideoInterface.cpp)
|
// Run from the CPU thread (from VideoInterface.cpp)
|
||||||
void VideoBackendBase::Video_BeginField(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight)
|
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)
|
if (m_initialized && g_ActiveConfig.bUseXFB && g_renderer)
|
||||||
{
|
{
|
||||||
@ -69,10 +57,10 @@ void VideoBackendBase::Video_EndField()
|
|||||||
e.time = 0;
|
e.time = 0;
|
||||||
e.type = AsyncRequests::Event::SWAP_EVENT;
|
e.type = AsyncRequests::Event::SWAP_EVENT;
|
||||||
|
|
||||||
e.swap_event.xfbAddr = s_beginFieldArgs.xfbAddr;
|
e.swap_event.xfbAddr = xfbAddr;
|
||||||
e.swap_event.fbWidth = s_beginFieldArgs.fbWidth;
|
e.swap_event.fbWidth = fbWidth;
|
||||||
e.swap_event.fbStride = s_beginFieldArgs.fbStride;
|
e.swap_event.fbStride = fbStride;
|
||||||
e.swap_event.fbHeight = s_beginFieldArgs.fbHeight;
|
e.swap_event.fbHeight = fbHeight;
|
||||||
AsyncRequests::GetInstance()->PushEvent(e, false);
|
AsyncRequests::GetInstance()->PushEvent(e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,6 @@ public:
|
|||||||
virtual void Video_Cleanup() = 0; // called from gl/d3d thread
|
virtual void Video_Cleanup() = 0; // called from gl/d3d thread
|
||||||
|
|
||||||
void Video_BeginField(u32, u32, u32, u32);
|
void Video_BeginField(u32, u32, u32, u32);
|
||||||
void Video_EndField();
|
|
||||||
|
|
||||||
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32);
|
u32 Video_AccessEFB(EFBAccessType, u32, u32, u32);
|
||||||
u32 Video_GetQueryResult(PerfQueryType type);
|
u32 Video_GetQueryResult(PerfQueryType type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user