mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 19:50:25 +01:00
egl: Fix a false negative check in _eglCheckMakeCurrent.
This call sequence
eglMakeCurrent(dpy, surf, surf, ctx1);
eglMakeCurrent(dpy, surf, surf, ctx2);
should be valid if ctx1 and ctx2 have the same client API and are not
current in another thread.
(cherry picked from commit 0d43cbed2f)
This commit is contained in:
parent
b6ae3d7b23
commit
feacfc4a93
1 changed files with 12 additions and 9 deletions
|
|
@ -272,10 +272,6 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
|||
if (!surfaceless && (draw == NULL || read == NULL))
|
||||
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
|
||||
|
||||
/* context stealing from another thread is not allowed */
|
||||
if (ctx->Binding && ctx->Binding != t)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
|
||||
/*
|
||||
* The spec says
|
||||
*
|
||||
|
|
@ -283,16 +279,23 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
|||
* bound to contexts in another thread, an EGL_BAD_ACCESS error is
|
||||
* generated."
|
||||
*
|
||||
* But it also says
|
||||
* and
|
||||
*
|
||||
* "at most one context may be bound to a particular surface at a given
|
||||
* time"
|
||||
*
|
||||
* The latter is more restrictive so we can check only the latter case.
|
||||
*/
|
||||
if ((draw && draw->CurrentContext && draw->CurrentContext != ctx) ||
|
||||
(read && read->CurrentContext && read->CurrentContext != ctx))
|
||||
if (ctx->Binding && ctx->Binding != t)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
if (draw && draw->CurrentContext && draw->CurrentContext != ctx) {
|
||||
if (draw->CurrentContext->Binding != t ||
|
||||
draw->CurrentContext->ClientAPI != ctx->ClientAPI)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
}
|
||||
if (read && read->CurrentContext && read->CurrentContext != ctx) {
|
||||
if (read->CurrentContext->Binding != t ||
|
||||
read->CurrentContext->ClientAPI != ctx->ClientAPI)
|
||||
return _eglError(EGL_BAD_ACCESS, "eglMakeCurrent");
|
||||
}
|
||||
|
||||
/* simply require the configs to be equal */
|
||||
if ((draw && draw->Config != ctx->Config) ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue