Skip to content

Fix sRGB color conversion in the Metal presenter - #2

Merged
TxCsOffc merged 1 commit into
TxCsOffc:mainfrom
LuizDusky:fix/metal-presenter-srgb
Nov 25, 2026
Merged

TxCsOffc merged 1 commit into
TxCsOffc:mainfrom
LuizDusky:fix/metal-presenter-srgb

Conversation

@LuizDusky

Copy link
Copy Markdown
Contributor

Change

Metal reads sRGB textures as linear values. The presenter wrote those values directly to a BGRA8Unorm drawable, leaving the 8-bit sRGB flip images too dark and making some colors appear oversaturated. Encode the values back to sRGB for RGBA8Unorm_sRGB and BGRA8Unorm_sRGB sources, using the same presentation shader for the drawable and frame readback.

Validation

Built and ran KyTx on a Mac mini M4 (macOS 27.2.1). Compared the title menu of Is This Seat Taken? (PPSA37001) with a PS5 reference capture. Values are median RGB samples from corresponding regions.

Region KyTx before KyTx after PS5 reference
Title lettering (12, 12, 27) (61, 61, 91) (70, 69, 101)
Green play button (41, 104, 69) (112, 171, 142) (123, 180, 152)
Paper background (230, 179, 110) (246, 219, 176) (244, 221, 185)

The game capture used an RGBA8 sRGB flip texture. BGRA8 sRGB follows the same conversion branch and was not exercised by this capture.

@TxCsOffc TxCsOffc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the sRGB decode/re-encode logic for RGBA8Unorm_sRGB/BGRA8Unorm_sRGB sources into BGRA8Unorm drawables and frame readback, and confirmed kyty_emulator builds cleanly on macOS arm64. Merging!

@TxCsOffc
TxCsOffc merged commit ec1faa7 into TxCsOffc:main Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants