1
0
forked from mirrors/0ad

Moves glGetError under config to prevent a performance drop on some platforms.

Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3620
This was SVN commit r24986.
This commit is contained in:
vladislavbelov
2021-03-02 21:24:34 +00:00
parent 7ea57932c4
commit 143fdf551f
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -91,6 +91,10 @@ fog = true
silhouettes = true
showsky = true
; Uses a synchonized call to a GL driver to get an error state. Useful
; for a debugging of a system without GL_KHR_debug.
gl.checkerrorafterswap = false
novbo = false
; Disable hardware cursors
+5 -1
View File
@@ -1459,10 +1459,14 @@ void CRenderer::EndFrame()
void CRenderer::OnSwapBuffers()
{
bool checkGLErrorAfterSwap = false;
CFG_GET_VAL("gl.checkerrorafterswap", checkGLErrorAfterSwap);
if (!checkGLErrorAfterSwap)
return;
PROFILE3("error check");
// We have to check GL errors after SwapBuffer to avoid possible
// synchronizations during rendering.
if (GLenum err = glGetError())
if (GLenum err = glGetError())
ONCE(LOGERROR("GL error %s (0x%04x) occurred", ogl_GetErrorName(err), err));
}