summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-03-18 12:28:31 +0100
committerKeith Whitwell <[email protected]>2009-03-18 18:02:58 +0000
commitcaf99be99976166f92d90203966a2dd42634e2af (patch)
tree628de39179dedc6975e8a00224930263b2a98304
parent1f118c2557e44b294f12ddc3e298be6caaa3efb4 (diff)
stw: Fix makeCurrent.
Flush if we change current context. Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_context.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_context.c b/src/gallium/state_trackers/wgl/shared/stw_context.c
index 708acad1939..d77daac39cd 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_context.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_context.c
@@ -283,6 +283,7 @@ stw_make_current(
struct stw_framebuffer *fb;
GLuint width = 0;
GLuint height = 0;
+ struct stw_context *curctx;
if (!stw_dev)
return FALSE;
@@ -297,6 +298,13 @@ stw_make_current(
current_hdc = hdc;
current_hglrc = hglrc;
+ if (glcurctx != NULL) {
+ curctx = (struct stw_context *) glcurctx->DriverCtx;
+
+ if (curctx != ctx)
+ st_flush(glcurctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+ }
+
if (hdc == NULL || hglrc == 0) {
st_make_current( NULL, NULL, NULL );
return TRUE;
@@ -305,8 +313,6 @@ stw_make_current(
/* Return if already current.
*/
if (glcurctx != NULL) {
- struct stw_context *curctx = (struct stw_context *) glcurctx->DriverCtx;
-
if (curctx != NULL && curctx == ctx && ctx->hdc == hdc)
return TRUE;
}