diff options
author | Thomas Hellstrom <[email protected]> | 2017-06-20 18:36:08 +0200 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2017-08-03 08:01:25 +0200 |
commit | 91c93dec980dbf7b253c124b85dc4e46d2a83587 (patch) | |
tree | 69acc37b574335e1fd9106a8fdcc038b03bfcb85 /src/mesa/state_tracker/st_manager.c | |
parent | ad5136ac826a9e34d1f789398016a018c42a27ca (diff) |
gallium/st: Add a method to flush outstanding swapbuffers
Add a state tracker interface method to flush outstanding swapbuffers, and
add a call to it from the mesa state tracker during glFinish().
This doesn't strictly mean the outstanding swapbuffers have actually finished
executing but is sufficient for glFinish()
to be able to be used as a replacement for glXWaitGL().
Signed-off-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_manager.c')
-rw-r--r-- | src/mesa/state_tracker/st_manager.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 28cf0234cd6..617a691a67c 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -1064,6 +1064,28 @@ st_manager_validate_framebuffers(struct st_context *st) st_context_validate(st, stdraw, stread); } + +/** + * Flush any outstanding swapbuffers on the current draw framebuffer. + */ +void +st_manager_flush_swapbuffers(void) +{ + GET_CURRENT_CONTEXT(ctx); + struct st_context *st = (ctx) ? ctx->st : NULL; + struct st_framebuffer *stfb; + + if (!st) + return; + + stfb = st_ws_framebuffer(ctx->DrawBuffer); + if (!stfb || !stfb->iface->flush_swapbuffers) + return; + + stfb->iface->flush_swapbuffers(&st->iface, stfb->iface); +} + + /** * Add a color renderbuffer on demand. The FBO must correspond to a window, * not a user-created FBO. |