egl: Fixes for eglQueryContext and RESET_NOTIFICATION_STRATEGY
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Streamline the conditions for when `RESET_NOTIFICATION_STRATEGY_EXT` can
be queried to match the conditions when it can be set - notably only
with GLES.

While on it, add support to query the KHR and suffix-less versions.

Cc: mesa-stable
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35242>
This commit is contained in:
Robert Mader 2025-05-29 20:28:50 +02:00 committed by Marge Bot
parent ba1bd9aed8
commit afd6788036

View file

@ -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;