From daf1a40521f51ccab5f9188b458b3a41abb0bbf4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Dec 2016 20:09:25 +0100 Subject: [PATCH] - allow swapping the order of gl_finish and SwapBuffers calls, because some cards do not seem to like the correct order. --- src/gl/system/gl_framebuffer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 7102df72e..f20c9e502 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -207,17 +207,20 @@ void OpenGLFrameBuffer::Update() // //========================================================================== +CVAR(Bool, gl_finishbeforeswap, false, 0); + void OpenGLFrameBuffer::Swap() { Finish.Reset(); Finish.Clock(); - if (needsetgamma) + if (gl_finishbeforeswap) glFinish(); + if (needsetgamma) { //DoSetGamma(); needsetgamma = false; } SwapBuffers(); - glFinish(); + if (!gl_finishbeforeswap) glFinish(); Finish.Unclock(); swapped = true; FHardwareTexture::UnbindAll();