summaryrefslogtreecommitdiffstats
path: root/opengl/libs
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/libs')
-rw-r--r--opengl/libs/EGL/egl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index a8200be..d99fc1e 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -453,6 +453,12 @@ static void gl_no_context() {
}
}
+// Always return GL_INVALID_OPERATION from glGetError() when called from
+// a thread without a bound context.
+static GLenum gl_no_context_glGetError() {
+ return GL_INVALID_OPERATION;
+}
+
static void early_egl_init(void)
{
#if !USE_FAST_TLS_KEY
@@ -463,6 +469,9 @@ static void early_egl_init(void)
(uint32_t*)(void*)&gHooksNoContext,
addr,
sizeof(gHooksNoContext));
+
+ gHooksNoContext.gl.glGetError = gl_no_context_glGetError;
+
setGlThreadSpecific(&gHooksNoContext);
}