[PR #12548] [MERGED] AtlasEngine: Fix inverted cursor alpha #29103

Open
opened 2026-01-31 09:32:49 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12548
Author: @lhecker
Created: 2/21/2022
Status: ✅ Merged
Merged: 2/22/2022
Merged by: @undefined

Base: main ← Head: dev/lhecker/12507-hdr-cursor


📝 Commits (1)

  • f84bbd8 AtlasEngine: Fix cursor alpha

📊 Changes

1 file changed (+6 additions, -3 deletions)

View changed files

📝 src/renderer/atlas/shader_ps.hlsl (+6 -3)

📄 Description

The previous implementation only inverted the RGB values of the cell,
but failed to account for situations where the color is transparent,
which is the case when backgroundOpaqueMixin is 0 (for instance if
acrylic backgrounds are enabled). In these situations the alpha
component remained 0 which caused the cursor to be invisible.

For some inexplicable reason this issue is only visible on a HDR display,
even though it should also effect regular ones. God knows why.

With this commit the cursor texture is treated as a mask that inverts the color.
We use branching here, because I couldn't come up with a more clever solution.

PR Checklist

Validation Steps Performed

  • Cursor is visible on a HDR display with acrylic background ✅
  • TBD performance benchmark for [branch] ❌

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12548 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 2/21/2022 **Status:** ✅ Merged **Merged:** 2/22/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/12507-hdr-cursor` --- ### 📝 Commits (1) - [`f84bbd8`](https://github.com/microsoft/terminal/commit/f84bbd854938fdf4cdf34e73956e6c2a7337aefc) AtlasEngine: Fix cursor alpha ### 📊 Changes **1 file changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/atlas/shader_ps.hlsl` (+6 -3) </details> ### 📄 Description The previous implementation only inverted the RGB values of the cell, but failed to account for situations where the `color` is transparent, which is the case when `backgroundOpaqueMixin` is 0 (for instance if acrylic backgrounds are enabled). In these situations the alpha component remained 0 which caused the cursor to be invisible. For some inexplicable reason this issue is only visible on a HDR display, even though it should also effect regular ones. God knows why. With this commit the cursor texture is treated as a mask that inverts the color. We use branching here, because I couldn't come up with a more clever solution. ## PR Checklist * [x] Closes #12507 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Cursor is visible on a HDR display with acrylic background ✅ * TBD performance benchmark for `[branch]` ❌ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:32:49 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29103