diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index 77204347e57..49b4633b734 100644 --- a/src/egl/main/eglcontext.c +++ b/src/egl/main/eglcontext.c @@ -765,6 +765,7 @@ EGLBoolean _eglQueryContext(_EGLContext *c, EGLint attribute, EGLint *value) { _EGLDisplay *disp = c->Resource.Display; + EGLenum api = c->ClientAPI; if (!value) return _eglError(EGL_BAD_PARAMETER, "eglQueryContext"); @@ -798,7 +799,14 @@ _eglQueryContext(_EGLContext *c, EGLint attribute, EGLint *value) *value = c->Protected; break; case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT: - if (!disp->Extensions.EXT_query_reset_notification_strategy) + if (!disp->Extensions.EXT_create_context_robustness || + api != EGL_OPENGL_ES_API) + return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext"); + *value = c->ResetNotificationStrategy; + break; + case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR: + if (!(disp->Extensions.KHR_create_context && api == EGL_OPENGL_API) && + disp->Version < 15) return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext"); *value = c->ResetNotificationStrategy; break;