1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00
alacritty/Cargo.toml
Joe Wilm 8454bbe183 Enable vsync
The input/pty processing loop previously consumed input on a channel and
hit the rendering when the queue became empty. This had a couple of
problems

1. It was possible to be overwhelmed with input and not give the
   renderer an opportunity to update the screen. This gave the
   appearance of locking up.
2. Multiple frames could be rendered for a single vblank (redundant
   work)
3. Open loop rendering would inevitably have buffer swapping out of sync
   with vblanks and visual tearing would occur.

This commit enables vsync on the glutin window. The rendering was all
moved onto a separate thread from input/pty processing to support vsync.
However, the rendering thread must be 100% synchronized with the updater
thread. There's now a Mutex on the Term, and an atomic bool to ask the
input/pty processing to yield to the renderer.

One aspect of this feature that hasn't been worked out is how to limit
the frame rate. Currently, it just free runs at the screen refresh rate.
The initial attempt here included the input/pty processor holding a lock
while waiting for input. This *almost* worked, but there was a (not
uncommon) edge case where the terminal state was "dirty" but the
renderer was not ready to draw.

Instead of blocking on the refresh issue, it's being punted to after an
MVP is released. The overhead of drawing at 60Hz was profiled to be ~5%
CPU usage, and this is deemed acceptable for an MVP.
2016-06-27 19:46:24 -07:00

26 lines
537 B
TOML

[package]
name = "alacritty"
version = "0.1.0"
authors = ["Joe Wilm <joe@jwilm.com>"]
license = "Apache-2.0"
exclude = ["res/*"]
build = "build.rs"
[dependencies]
libc = "*"
cgmath = "0.7"
notify = { git = "https://github.com/passcod/rsnotify" }
bitflags = "*"
font = { path = "./font" }
errno = "0.1.6"
parking_lot = "0.2.6"
[build-dependencies]
gl_generator = "0.5"
[dependencies.glutin]
version = "*"
# git = "https://github.com/jwilm/glutin"
# rev = "c95e6973ace3cbf321123a64588b27f032675be9"
# version = "*"
# path = "../glutin"