glFinish() to force the tightest input-to-screen coupling possible
This commit is contained in:
+11
-2
@@ -798,12 +798,21 @@ bool RageDisplay_Legacy::BeginFrame()
|
||||
|
||||
void RageDisplay_Legacy::EndFrame()
|
||||
{
|
||||
glFlush();
|
||||
|
||||
FrameLimitBeforeVsync( g_pWind->GetActualVideoModeParams().rate );
|
||||
g_pWind->SwapBuffers();
|
||||
FrameLimitAfterVsync();
|
||||
|
||||
// Some would advise against glFinish(), ever. Those people don't realize
|
||||
// the degree of freedom GL hosts are permitted in queueing commands.
|
||||
// If left to its own devices, the host could lag behind several frames' worth
|
||||
// of commands.
|
||||
// glFlush() only forces the host to not wait to execute all commands
|
||||
// sent so far; it does NOT block on those commands until they finish.
|
||||
// glFinish() blocks. We WANT to block. Why? This puts the engine state
|
||||
// reflected by the next frame as close as possible to the on-screen
|
||||
// appearance of that frame.
|
||||
glFinish();
|
||||
|
||||
g_pWind->Update();
|
||||
|
||||
RageDisplay::EndFrame();
|
||||
|
||||
Reference in New Issue
Block a user