Skip to content

render: decode VRAM colour via CPU LUT (fixes Linux/Steam Deck red tint) - #12

Open
countgitmick wants to merge 1 commit into
SlickAmogus:masterfrom
countgitmick:render-lut-decode-red-tint
Open

render: decode VRAM colour via CPU LUT (fixes Linux/Steam Deck red tint)#12
countgitmick wants to merge 1 commit into
SlickAmogus:masterfrom
countgitmick:render-lut-decode-red-tint

Conversation

@countgitmick

Copy link
Copy Markdown

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.

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.
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.

1 participant