Skip to content

Commit

Permalink
Fallback to underline shader when dotted fails
Browse files Browse the repository at this point in the history
Some hardware is just bad.

Fixes #7404.
  • Loading branch information
kchibisov committed Dec 1, 2023
1 parent 546d595 commit 2836479
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion alacritty/src/renderer/rects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2836479

Please sign in to comment.