mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways
http://xquartz.macosforge.org/trac/ticket/514
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5c44c1348e)
This commit is contained in:
parent
c8f2665f02
commit
a96360a951
1 changed files with 18 additions and 0 deletions
|
|
@ -65,6 +65,24 @@ applegl_bind_context(struct glx_context *gc, struct glx_context *old,
|
||||||
static void
|
static void
|
||||||
applegl_unbind_context(struct glx_context *gc, struct glx_context *new)
|
applegl_unbind_context(struct glx_context *gc, struct glx_context *new)
|
||||||
{
|
{
|
||||||
|
Display *dpy;
|
||||||
|
bool error;
|
||||||
|
|
||||||
|
/* If we don't have a context, then we have nothing to unbind */
|
||||||
|
if (!gc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* If we have a new context, keep this one around and remove it during bind. */
|
||||||
|
if (new)
|
||||||
|
return;
|
||||||
|
|
||||||
|
dpy = gc->psc->dpy;
|
||||||
|
|
||||||
|
error = apple_glx_make_current_context(dpy,
|
||||||
|
(gc != &dummyContext) ? gc->driContext : NULL,
|
||||||
|
NULL, None);
|
||||||
|
|
||||||
|
apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue