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:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user