st-api: Rework how drawables are invalidated v3.
[mesa.git] / src / gallium / state_trackers / wgl / stw_context.c
index cd4f3c8b3e28a8ba4a701b65c770aadd32a7e6e1..c2839fe815ff8aaa22854a097fb1e753fb3f3149 100644 (file)
@@ -31,6 +31,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
 #include "util/u_memory.h"
+#include "util/u_atomic.h"
 #include "state_tracker/st_api.h"
 
 #include "stw_icd.h"
@@ -277,7 +278,7 @@ stw_make_current(
             return TRUE;
          }
       } else {
-         curctx->st->flush(curctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+         curctx->st->flush(curctx->st, ST_FLUSH_FRONT, NULL);
       }
    }
 
@@ -351,11 +352,7 @@ stw_flush_current_locked( struct stw_framebuffer *fb )
    struct stw_context *ctx = stw_current_context();
 
    if (ctx && ctx->current_framebuffer == fb) {
-      ctx->st->flush(ctx->st,
-            PIPE_FLUSH_RENDER_CACHE | 
-            PIPE_FLUSH_SWAPBUFFERS |
-            PIPE_FLUSH_FRAME,
-            NULL);
+      ctx->st->flush(ctx->st, ST_FLUSH_FRONT, NULL);
    }
 }
 
@@ -365,10 +362,7 @@ stw_flush_current_locked( struct stw_framebuffer *fb )
 void
 stw_notify_current_locked( struct stw_framebuffer *fb )
 {
-   struct stw_context *ctx = stw_current_context();
-
-   if (ctx && ctx->current_framebuffer == fb)
-      ctx->st->notify_invalid_framebuffer(ctx->st, fb->stfb);
+   p_atomic_inc(&fb->stfb->stamp);
 }
 
 /**