diff options
author | Keith Whitwell <[email protected]> | 2008-01-21 20:23:32 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-01-26 10:30:35 +0900 |
commit | 6d2d41294ce7de78d56051261bb4fc345517bf9b (patch) | |
tree | 8f3264accfdb2cc72fa48895eefe9aaa8f1a6206 /src/mesa | |
parent | 596a92ee7590cd3819aad0139cf779d28e57874d (diff) |
gallium: add notify_swapbuffers_complete, use it to set surfaces to undefined state
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_framebuffer.c | 20 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_public.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 42e8e24896c..bca3fa5c383 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -177,6 +177,26 @@ st_notify_swapbuffers(struct st_framebuffer *stfb) } } + +/** + * Quick hack - allows the winsys to inform the driver that surface + * states are now undefined after a glXSwapBuffers or similar. + */ +void +st_notify_swapbuffers_complete(struct st_framebuffer *stfb) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx && ctx->DrawBuffer == &stfb->Base) { + struct st_renderbuffer *strb; + int i; + + for (i = 0; i < BUFFER_COUNT; i++) { + if (stfb->Base.Attachment[i].Renderbuffer) { + strb = st_renderbuffer(stfb->Base.Attachment[i].Renderbuffer); + strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED; + } + } } } diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 78a8fde82b5..3c397b126a9 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -81,5 +81,6 @@ void st_make_current(struct st_context *st, void st_flush( struct st_context *st, uint pipeFlushFlags ); void st_notify_swapbuffers(struct st_framebuffer *stfb); +void st_notify_swapbuffers_complete(struct st_framebuffer *stfb); #endif |