diff options
author | Joe Wilm <joe@jwilm.com> | 2016-06-04 15:30:17 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-06-04 15:30:17 -0700 |
commit | 2f058bd053f52307bdbf3709209418ac26871678 (patch) | |
tree | 0609a8a3c1976d0e0bdaeede352a55d9c14cb13f /src/main.rs | |
parent | f944b517fa8bea6eae62eb25fbabe1308d16ed55 (diff) | |
download | r-alacritty-2f058bd053f52307bdbf3709209418ac26871678.tar.gz r-alacritty-2f058bd053f52307bdbf3709209418ac26871678.tar.bz2 r-alacritty-2f058bd053f52307bdbf3709209418ac26871678.zip |
Optimize rendering
This moves some logic that was previously being done per-character into
the vertex shader. At this time, we've traded CPU computation for
additional gl::Uniform2f calls. This is only a marginal improvement.
However, this patch positions the renderer well for instanced drawing,
and that will be a huge performance win.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index e5f9e0b3..733c4c6d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,13 +56,14 @@ static INIT_LIST: &'static str = "abcdefghijklmnopqrstuvwxyz\ type GlyphCache = HashMap<char, renderer::Glyph>; +#[derive(Debug)] struct TermProps { + width: f32, + height: f32, cell_width: f32, - sep_x: f32, cell_height: f32, + sep_x: f32, sep_y: f32, - height: f32, - width: f32, } fn main() { @@ -189,6 +190,15 @@ fn main() { width: width as f32, }; + let props = TermProps { + cell_width: cell_width as f32, + cell_height: cell_height as f32, + sep_x: sep_x as f32, + sep_y: sep_y as f32, + height: height as f32, + width: width as f32, + }; + { let _sampler = meter.sampler(); |