diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp index 55bd2422b..0bf8378e2 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp @@ -690,6 +690,12 @@ bool CDriverGL3::swapBuffers() // Check all vertex buffer to see which one are lost updateLostBuffers(); + +#if NL3D_GL3_SYNC_IMMEDIATE + // Sync on the current buffer + nlassert(_SwapBufferSync[syncI]); + nglClientWaitSync(_SwapBufferSync[syncI], 0, 1000000000ULL); +#endif // Check in flight buffers, also checks the current one for (size_t i = 0; i < NL3D_GL3_FRAME_QUEUE_MAX; ++i) diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.h b/code/nel/src/3d/driver/opengl3/driver_opengl.h index 5a46fc0ae..1842db4ad 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.h @@ -84,6 +84,7 @@ using NLMISC::CVector; #define NL3D_GL3_BUFFER_NOT_IN_FLIGHT (std::numeric_limits::max()) #define NL3D_GL3_FRAME_QUEUE_MAX (2) // Maximum is three frames processing (2 frames backlog + current frame) #define NL3D_GL3_BUFFER_QUEUE_MAX (NL3D_GL3_FRAME_QUEUE_MAX + 1) // Additional buffer for current working +#define NL3D_GL3_SYNC_IMMEDIATE 0 // Don't allow frame processing backlog if set to 1. Reduce input lag. Testing only namespace NL3D { namespace NLDRIVERGL3 {