mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #2001] Preserve sRGB midtones on the SDR UNORM swapchain fallback #2008
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2008
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2001
Author: @lgr123
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:lgr123/present-srgb-unorm-fallback📝 Commits (1)
cec9d96Preserve sRGB colours on SDR UNORM swapchains📊 Changes
2 files changed (+202 additions, -15 deletions)
View changed files
📝
runtime/src/vulkan_present.h(+127 -14)📝
runtime/test/xbox_present_test.cpp(+75 -1)📄 Description
Claimed as RT-PRESENT-SRGB-UNORM-FALLBACK.
On the RTX 5070, restricting surface formats to the driver's advertised SDR UNORM formats made the native presenter turn synthetic grey bytes 128/188 into 55/128. The swapchain still used nonlinear sRGB, so these linearized bytes darkened midtones. The default sRGB swapchain and composed controls preserved 128/188.
Copy encoded bytes for matching format layouts at 1:1. For scaling or channel reordering, keep the existing filtered blit through a reusable matching sRGB image before copying the encoded bytes to the UNORM swapchain. This also works for transfer-only source images. If the intermediate cannot be created, keep presenting through the previous blit and emit a warning.
Reviewer check
Run
ctest -R ^xbox_present$ --output-on-failurefrom the configured Windows runtime build. The synthetic surface-format test forces SDR UNORM and checks RGBA/BGRA at 1:1 and with crop/scale. No game files required.Tested
b9320a1passedxbox_present(1 of 1).git diff --checkpassed.GPUs tested: NVIDIA RTX 5070, driver 621.24, Windows.
AI-assisted: yes.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.