Mesa (master): mesa: fix regression from b4bb6680200b5a898583392f4c831c02f41e63f7

Haihao Xiang haihao at kemper.freedesktop.org
Tue Nov 23 01:02:43 UTC 2010


Module: Mesa
Branch: master
Commit: 93102b4cd8e620337acf4bd42ba51f954664087e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=93102b4cd8e620337acf4bd42ba51f954664087e

Author: Xiang, Haihao <haihao.xiang at intel.com>
Date:   Tue Nov 23 08:52:23 2010 +0800

mesa: fix regression from b4bb6680200b5a898583392f4c831c02f41e63f7

Pending commands to the previous context aren't flushed since commit b4bb668

Reported-by: Oleksiy Krivoshey <oleksiyk at gmail.com>
Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>

---

 src/mesa/main/context.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index b132030..4ed179a 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1399,6 +1399,8 @@ _mesa_make_current( struct gl_context *newCtx,
                     struct gl_framebuffer *drawBuffer,
                     struct gl_framebuffer *readBuffer )
 {
+   GET_CURRENT_CONTEXT(curCtx);
+
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(newCtx, "_mesa_make_current()\n");
 
@@ -1419,6 +1421,11 @@ _mesa_make_current( struct gl_context *newCtx,
       }
    }
 
+   if (curCtx && 
+      (curCtx->WinSysDrawBuffer || curCtx->WinSysReadBuffer) && /* make sure this context is valid for flushing */
+      curCtx != newCtx)
+      _mesa_flush(curCtx);
+
    /* We used to call _glapi_check_multithread() here.  Now do it in drivers */
    _glapi_set_context((void *) newCtx);
    ASSERT(_mesa_get_current_context() == newCtx);




More information about the mesa-commit mailing list