From b4bb6680200b5a898583392f4c831c02f41e63f7 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 8 Sep 2010 08:52:54 -0400 Subject: dri: Unset current context and dispatch table when unbinding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, when we switch to an indirect glx context and then back, it looks like we're still current. https://bugs.freedesktop.org/show_bug.cgi?id=29977#c7 Signed-off-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_context.c | 3 +++ src/mesa/drivers/dri/nouveau/nouveau_context.c | 3 +++ src/mesa/drivers/dri/radeon/radeon_common_context.c | 3 +++ src/mesa/drivers/dri/swrast/swrast.c | 4 ++++ 4 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index a9ba93d24b..08069d71dd 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -873,6 +873,9 @@ intelDestroyContext(__DRIcontext * driContextPriv) GLboolean intelUnbindContext(__DRIcontext * driContextPriv) { + /* Unset current context and dispath table */ + _mesa_make_current(NULL, NULL, NULL); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index f481161d46..b1d415257d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -306,6 +306,9 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw, GLboolean nouveau_context_unbind(__DRIcontext *dri_ctx) { + /* Unset current context and dispath table */ + _mesa_make_current(NULL, NULL, NULL); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 07f7cba354..b0340cee21 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -363,6 +363,9 @@ GLboolean radeonUnbindContext(__DRIcontext * driContextPriv) fprintf(stderr, "%s ctx %p\n", __FUNCTION__, radeon->glCtx); + /* Unset current context and dispath table */ + _mesa_make_current(NULL, NULL, NULL); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index f3903c2e38..ff53ffd0de 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -713,6 +713,10 @@ dri_unbind_context(__DRIcontext * cPriv) { TRACE; (void) cPriv; + + /* Unset current context and dispath table */ + _mesa_make_current(NULL, NULL, NULL); + return GL_TRUE; } -- cgit v1.2.3