diff options
author | Neil Roberts <[email protected]> | 2013-11-15 13:50:49 +0000 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2013-12-07 22:36:02 -0800 |
commit | 25cc889004aad6d1cab9edd76db898658e347b97 (patch) | |
tree | a17ba3fa086d8ea436e92086f9584b4257032c06 /src/gallium/drivers/llvmpipe/SConscript | |
parent | 965cde9232ca6c704ac31e924c15ddf39c58082d (diff) |
wayland: Block for the frame callback in get_back_bo not dri2_swap_buffers
Consider a typical game-style main loop which might be like this:
while (1) {
draw_something();
eglSwapBuffers();
}
In this case the game is relying on eglSwapBuffers to throttle to a sensible
frame rate. Previously this game would end up using three buffers even though
it should only need two. This is because Mesa decides whether to allocate a
new buffer in get_back_bo which would be before it has tried to read any
events from the compositor so it wouldn't have seen any buffer release events
yet.
This patch just moves the block for the frame callback to get_back_bo.
Typically the compositor will send a release event immediately after one of
the attaches so if we block for the frame callback here then we can be sure to
have completed at least one roundtrip and received that release event after
attaching the previous buffer before deciding whether to allocate a new one.
dri2_swap_buffers always calls get_back_bo so even if the client doesn't
render anything we will still be sure to block to the frame callback. The code
to create the new frame callback has been moved to after this call so that we
can be sure to have cleared the previous frame callback before requesting a
new one.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/SConscript')
0 files changed, 0 insertions, 0 deletions