Matteo Bruni : wined3d: Flush the GL context before switching away from it.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 30 09:54:02 CST 2015


Module: wine
Branch: master
Commit: 6dd054ca587b1d95c324c10383f1f81155ed9ffb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6dd054ca587b1d95c324c10383f1f81155ed9ffb

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri Nov 27 20:39:31 2015 +0100

wined3d: Flush the GL context before switching away from it.

We might end up not using the old context anymore after that and the GL
implementation is allowed to delay executing commands indefinitely if we
don't flush.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 0e8b32b..5eeccab 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1129,6 +1129,11 @@ BOOL context_set_current(struct wined3d_context *ctx)
         }
         else
         {
+            if (wglGetCurrentContext())
+            {
+                TRACE("Flushing context %p before switching to %p.\n", old, ctx);
+                glFlush();
+            }
             old->current = 0;
         }
     }




More information about the wine-cvs mailing list