diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2023-12-02 03:52:51 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-02 03:52:51 +0400 |
commit | 28364792b3a7d0982eb7759bae0c9b3773c48518 (patch) | |
tree | 00c4fb82993bd961d75bc0239fa68b4435346602 | |
parent | 546d5951aa369674e8a3c6e8ac716f07481368bd (diff) | |
download | alacritty-28364792b3a7d0982eb7759bae0c9b3773c48518.tar.gz alacritty-28364792b3a7d0982eb7759bae0c9b3773c48518.zip |
Fallback to underline shader when dotted fails
Some hardware is just bad.
Fixes #7404.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty/src/renderer/rects.rs | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 96573405..58d0a70e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Message bar content getting stuck after closing with multiple messages on Wayland - Vi cursor position not redrawn on PageUp/PageDown without scrollback - Cursor not updating when blinking and viewport is scrolled +- Failure to start with recent version of mesa's i915 driver ### Removed diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs index 3b0b8695..ca2d1852 100644 --- a/alacritty/src/renderer/rects.rs +++ b/alacritty/src/renderer/rects.rs @@ -3,6 +3,7 @@ use std::mem; use ahash::RandomState; use crossfont::Metrics; +use log::info; use alacritty_terminal::grid::Dimensions; use alacritty_terminal::index::{Column, Point}; @@ -261,7 +262,16 @@ impl RectRenderer { let rect_program = RectShaderProgram::new(shader_version, RectKind::Normal)?; let undercurl_program = RectShaderProgram::new(shader_version, RectKind::Undercurl)?; - let dotted_program = RectShaderProgram::new(shader_version, RectKind::DottedUnderline)?; + // This shader has way more ALU operations than other rect shaders, so use a fallback + // to underline just for it when we can't compile it. + let dotted_program = match RectShaderProgram::new(shader_version, RectKind::DottedUnderline) + { + Ok(dotted_program) => dotted_program, + Err(err) => { + info!("Error compiling dotted shader: {err}\n falling back to underline"); + RectShaderProgram::new(shader_version, RectKind::Normal)? + }, + }; let dashed_program = RectShaderProgram::new(shader_version, RectKind::DashedUnderline)?; unsafe { |