diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-05-01 23:57:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-01 20:57:25 +0000 |
commit | 38d20d0c391c250953ce3c72a35c8d1156f06000 (patch) | |
tree | de0871a1200076cd1f647f3a5b525b52d834bc37 /alacritty/src/renderer/mod.rs | |
parent | 6b45780f3afa23e9e4277bf43e6bf381172fa1ea (diff) | |
download | r-alacritty-38d20d0c391c250953ce3c72a35c8d1156f06000.tar.gz r-alacritty-38d20d0c391c250953ce3c72a35c8d1156f06000.tar.bz2 r-alacritty-38d20d0c391c250953ce3c72a35c8d1156f06000.zip |
Call glFinish right after swap_buffers on X11
On X11 `swap_buffers` does not block for vsync. However the next OpenGl command
will block to synchronize (this is `glClear` in Alacritty), which causes a
permanent one frame delay.
Calling `glFinish` after swapping buffers forces Alacritty to finish the buffer
swap before returning control to the event loop.
Fixes #3061.
Diffstat (limited to 'alacritty/src/renderer/mod.rs')
-rw-r--r-- | alacritty/src/renderer/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 764b5ec5..f62e6f8d 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -923,6 +923,12 @@ impl<'a, C> RenderApi<'a, C> { } } + pub fn finish(&self) { + unsafe { + gl::Finish(); + } + } + fn render_batch(&mut self) { unsafe { gl::BufferSubData( |