From 21d84ee69282ca47a10bc51b6d27694cd6071276 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 25 Apr 2026 02:59:12 +0500 Subject: [PATCH] ref: gl: add -glnoerr flag that enables no error context, for possible performance gains --- ref/gl/gl_opengl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 70617e0f..4996d42c 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -1405,6 +1405,12 @@ void GL_SetupAttributes( int safegl ) glw_state.extended = true; } + if( gEngfuncs.Sys_CheckParm( "-glnoerr" )) + { + gEngfuncs.Con_Reportf( "Creating a no-error GL context...\n" ); + gEngfuncs.GL_SetAttribute( REF_GL_CONTEXT_NO_ERROR, 1 ); + } + if( safegl > SAFE_DONTCARE ) { safegl = -1; // can't retry anymore, can only shutdown engine