summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/wgl
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2011-06-29 09:00:23 +0200
committerThomas Hellstrom <[email protected]>2011-06-29 12:48:59 +0200
commitac8fdbc1c723afb19eeaba5457ba78d0bf33b8d4 (patch)
tree34b7c9d72551aa7976d634738585d65a256760ae /src/gallium/state_trackers/wgl
parent1a7e17e44a1129bbd6a0f454fe95b3ce8240cd45 (diff)
st-api: Rework how drawables are invalidated v3.
The api and the state tracker manager code as well as the state tracker code assumed that only a single context could be bound to a drawable. That is not a valid assumption, since multiple contexts can bind to the same drawable. Fix this by making it the state tracker's responsibility to update all contexts binding to a drawable Note that the state trackers themselves don't use atomic stamps on frame-buffers. Multiple context rendering to the same drawable should be protected by the application. Signed-off-by: Thomas Hellstrom <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/wgl')
-rw-r--r--src/gallium/state_trackers/wgl/stw_context.c6
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c
index 5608d4f4ce7..c2839fe815f 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -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"
@@ -361,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);
}
/**
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c
index 9174533fc06..28c93f4fb57 100644
--- a/src/gallium/state_trackers/wgl/stw_st.c
+++ b/src/gallium/state_trackers/wgl/stw_st.c
@@ -27,6 +27,7 @@
#include "util/u_memory.h"
#include "util/u_inlines.h"
+#include "util/u_atomic.h"
#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
#include "stw_st.h"
@@ -196,6 +197,7 @@ stw_st_create_framebuffer(struct stw_framebuffer *fb)
stwfb->stvis = fb->pfi->stvis;
stwfb->base.visual = &stwfb->stvis;
+ p_atomic_set(&stwfb->base.stamp, 1);
stwfb->base.flush_front = stw_st_framebuffer_flush_front;
stwfb->base.validate = stw_st_framebuffer_validate;