Skip to content

Commit 516b005

Browse files
rmader1ace
authored andcommitted
egl: Fixes for eglQueryContext and RESET_NOTIFICATION_STRATEGY
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 <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35242> (cherry picked from commit afd6788)
1 parent 2ce5cd0 commit 516b005

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.pick_status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@
13841384
"description": "egl: Fixes for eglQueryContext and RESET_NOTIFICATION_STRATEGY",
13851385
"nominated": true,
13861386
"nomination_type": 1,
1387-
"resolution": 0,
1387+
"resolution": 1,
13881388
"main_sha": null,
13891389
"because_sha": null,
13901390
"notes": null

src/egl/main/eglcontext.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,7 @@ EGLBoolean
765765
_eglQueryContext(_EGLContext *c, EGLint attribute, EGLint *value)
766766
{
767767
_EGLDisplay *disp = c->Resource.Display;
768+
EGLenum api = c->ClientAPI;
768769

769770
if (!value)
770771
return _eglError(EGL_BAD_PARAMETER, "eglQueryContext");
@@ -798,7 +799,14 @@ _eglQueryContext(_EGLContext *c, EGLint attribute, EGLint *value)
798799
*value = c->Protected;
799800
break;
800801
case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:
801-
if (!disp->Extensions.EXT_query_reset_notification_strategy)
802+
if (!disp->Extensions.EXT_create_context_robustness ||
803+
api != EGL_OPENGL_ES_API)
804+
return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
805+
*value = c->ResetNotificationStrategy;
806+
break;
807+
case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR:
808+
if (!(disp->Extensions.KHR_create_context && api == EGL_OPENGL_API) &&
809+
disp->Version < 15)
802810
return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
803811
*value = c->ResetNotificationStrategy;
804812
break;

0 commit comments

Comments
 (0)