Treat BGRX overlays as opaque in PresentX composition #2014

Open
github-bot wants to merge 1 commit from github-bot/gh-2014 into main AGit
Owner

@⁠lgr123 on GitHub · 2026-11-25 18:10 UTC · original
lgr123:lgr123/present-bgrx-opaque-plane → main · +40 −7 · 6 files · 1 commits · open

Claimed as RT-PRESENT-BGRX-OPAQUE-PLANE.

On public main, a synthetic green BGRX overlay disappeared when its unused X byte was zero. The sampled result was the base color 51/153/230. With X set to 255, the same input was green 0/255/0. Genuine BGRA controls correctly distinguished alpha 0 and 255. DXGI defines BGRX's X channel as unused, so the overlay should be opaque at either value.

Carry the BGRX format distinction into the compositor and use alpha-one swizzle for the sampled view of the secondary plane. The surrounding image retains the base plane outside the overlay rectangle. Ordinary BGRA/RGBA and direct presentation preserve their existing paths.

Reviewer check

Run the Windows synthetic xbox_present test. The regression uses both BGRX UNORM and sRGB, selects X = 0 and 255, checks straight and premultiplied inputs, and compares pixel placement and genuine BGRA alpha controls.

Tested

  • Windows, NVIDIA RTX 5070, driver 621.24. The before test failed at the first BGRX X=0 pixel in the destination rectangle. After the patch, native xbox_present, d3d12_present, and d3d12_typeless_families all passed.
  • This display does not offer HDR10 ST.2084. The routine HDR10 swapchain case skipped and the SDR tone-map and PQ encoder tests ran.
  • Public base b9320a1. Clean merge-tree with #2001. Source-only check and git diff --check passed.
  • Synthetic fixtures only. No game files.

GPUs tested: NVIDIA RTX 5070, 621.24, Windows.

AI-assisted: yes.

Checklist

  • Based on public main.
  • One topic.
  • No game data, keys or protection workarounds.
**@⁠lgr123** on GitHub · 2026-11-25 18:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2014) `lgr123:lgr123/present-bgrx-opaque-plane` → `main` · +40 −7 · 6 files · 1 commits · open Claimed as [RT-PRESENT-BGRX-OPAQUE-PLANE](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). On public main, a synthetic green BGRX overlay disappeared when its unused X byte was zero. The sampled result was the base color **51/153/230**. With X set to 255, the same input was green **0/255/0**. Genuine BGRA controls correctly distinguished alpha 0 and 255. DXGI defines BGRX's X channel as unused, so the overlay should be opaque at either value. Carry the BGRX format distinction into the compositor and use alpha-one swizzle for the sampled view of the secondary plane. The surrounding image retains the base plane outside the overlay rectangle. Ordinary BGRA/RGBA and direct presentation preserve their existing paths. ### Reviewer check Run the Windows synthetic `xbox_present` test. The regression uses both BGRX UNORM and sRGB, selects X = 0 and 255, checks straight and premultiplied inputs, and compares pixel placement and genuine BGRA alpha controls. ### Tested - Windows, NVIDIA RTX 5070, driver 621.24. The before test failed at the first BGRX X=0 pixel in the destination rectangle. After the patch, native `xbox_present`, `d3d12_present`, and `d3d12_typeless_families` all passed. - This display does not offer HDR10 ST.2084. The routine HDR10 swapchain case skipped and the SDR tone-map and PQ encoder tests ran. - Public base `b9320a1`. Clean merge-tree with #2001. Source-only check and `git diff --check` passed. - Synthetic fixtures only. No game files. GPUs tested: NVIDIA RTX 5070, 621.24, Windows. AI-assisted: yes. ### Checklist - [x] Based on public main. - [x] One topic. - [x] No game data, keys or protection workarounds.
Preserve the DXGI alpha semantics when the Vulkan composer samples plane 1. Use the existing BGRX format classification to swizzle sampled alpha to one while retaining the overlay placement and the behavior of real alpha formats.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:14:48 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2014/head:github-bot/gh-2014'
git switch 'github-bot/gh-2014'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2014'
git switch 'github-bot/gh-2014'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2014'
git switch 'github-bot/gh-2014'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2014'
git switch 'main'
git merge --squash 'github-bot/gh-2014'
git switch 'main'
git merge --ff-only 'github-bot/gh-2014'
git switch 'main'
git merge 'github-bot/gh-2014'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.