render: decode VRAM colour via CPU LUT (fixes Linux/Steam Deck red tint) - #12
Open
countgitmick wants to merge 1 commit into
Open
render: decode VRAM colour via CPU LUT (fixes Linux/Steam Deck red tint)#12countgitmick wants to merge 1 commit into
countgitmick wants to merge 1 commit into
Conversation
The packRG/decodeRG float decode relies on floor() landing exactly. Mesa rounds UNSIGNED_BYTE to float differently from the Windows driver, so it lands one bucket off and colours corrupt (the Linux / Steam Deck red cast). The 38b9bcc byte-snap did not reach this arithmetic. Restore the CPU-baked lookup table upstream OpenDriver2/PsyCross uses (GR_InitRG8LUT, sampled via lut / s_rgLut): no per-pixel floor(), bit-exact on every driver. LUT on texture unit 2, re-bound per shader bind. Removes the unused packRG/decodeRG macros. Tested native on Linux: red cast gone on AMD radeonsi.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Linux / Steam Deck / Proton red cast. Completes #14: the byte-snap
there (38b9bcc, @sergiomanzur) fixed the sampled bytes but not the decode
arithmetic, so the tint remained; this keeps that snap.
The packRG/decodeRG float decode relies on floor() landing exactly. Mesa rounds
differently from the Windows driver, so it lands one bucket off and colours
corrupt. Restore the CPU-baked LUT upstream OpenDriver2/PsyCross uses
(GR_InitRG8LUT, sampled via lut / s_rgLut): no per-pixel floor(), bit-exact on
every driver. LUT on texture unit 2, re-bound per shader bind. Removes the
unused packRG/decodeRG macros.
Tested: native Linux build, red cast gone on AMD radeonsi.