shader: preserve raw VCC bits in S_MOV_B64 #418

Manually merged
github merged 2 commits from gh-pr/418/head into gh-pr/418/base 2026-11-26 09:19:52 +00:00
Owner

@⁠nomolao2-cell on GitHub · 2026-08-30 19:19 UTC · original
nomolao2-cell:fix/preserve-vcc-smov-b64 → main · +444 −185 · 13 files · 2 commits · merged 2026-08-30 23:04 UTC

Problem

S_MOV_B64 treated EXEC and VCC exclusively as lane masks whenever either the source or destination used one of those aliases.

The implementation called WriteMask64(inst.dst, ReadMask(inst.src0)), which converted the source into a boolean lane mask instead of preserving its original two 32-bit values.

Hades temporarily stores numeric shader data in vcc_lo and vcc_hi` The font fragment shader later uses those values for its signed-distance-field calculations. Losing the original values caused the shader to output transparent pixels, leaving save-slot labels and dialogue text invisible.

Fix

Copy the original register values with ReadU32Pair and WriteU32Pair.
The logical EXEC or VCC mask state is then updated separately, allowing these aliases to retain their raw scalar values without losing their mask behavior.

Testing

  • Windows Release build completed successfully.

  • shader_cfg: 1/1 test passed, 0 failures.

  • Tested Hades, PPSA03355, version 01.003.000, on an NVIDIA RTX 3070.

  • Before the change, dialogue text were invisible.
    image

  • After the change, dialogue text render correctly.
    image

  • No crashes or new rendering errors were observed during testing.

  • No regressions have been found in other games tested so far.

AI use disclosure

I used Codex to assist with the investigation. It helped analyze RenderDoc captures and shader dumps, locate the affected Hades fragment shader, trace the transparent output back to the loss of the raw VCC values, and prepare the initial code change.

I reviewed the resulting diff, built the emulator locally, ran the existing shader_cfg test suite, and personally verified the fix in Hades before submitting this pull request.

**@⁠nomolao2-cell** on GitHub · 2026-08-30 19:19 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/418) `nomolao2-cell:fix/preserve-vcc-smov-b64` → `main` · +444 −185 · 13 files · 2 commits · merged 2026-08-30 23:04 UTC Problem S_MOV_B64 treated EXEC and VCC exclusively as lane masks whenever either the source or destination used one of those aliases. The implementation called `WriteMask64(inst.dst, ReadMask(inst.src0))`, which converted the source into a boolean lane mask instead of preserving its original two 32-bit values. Hades temporarily stores numeric shader data in vcc_lo and vcc_hi` The font fragment shader later uses those values for its signed-distance-field calculations. Losing the original values caused the shader to output transparent pixels, leaving save-slot labels and dialogue text invisible. Fix Copy the original register values with `ReadU32Pair` and `WriteU32Pair`. The logical EXEC or VCC mask state is then updated separately, allowing these aliases to retain their raw scalar values without losing their mask behavior. Testing - Windows Release build completed successfully. - shader_cfg: 1/1 test passed, 0 failures. - Tested Hades, PPSA03355, version 01.003.000, on an NVIDIA RTX 3070. - Before the change, dialogue text were invisible. <img width="1270" height="748" alt="image" src="https://github.com/user-attachments/assets/5c76f2b9-8039-4284-a6d1-34d4508f7627" /> - After the change, dialogue text render correctly. <img width="1269" height="738" alt="image" src="https://github.com/user-attachments/assets/25ef5c06-830c-4fac-9c28-73863caef1b2" /> - No crashes or new rendering errors were observed during testing. - No regressions have been found in other games tested so far. AI use disclosure I used Codex to assist with the investigation. It helped analyze RenderDoc captures and shader dumps, locate the affected Hades fragment shader, trace the transparent output back to the loss of the raw VCC values, and prepare the initial code change. I reviewed the resulting diff, built the emulator locally, ran the existing shader_cfg test suite, and personally verified the fix in Hades before submitting this pull request.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:19:51 +00:00
github manually merged commit 717b67c837 into gh-pr/418/base 2026-11-26 09:19:52 +00:00
Author
Owner

@⁠Nmzik on GitHub · 2026-08-30 20:09 UTC · original

@⁠nomolao2-cell Thanks for finding bug and detailed explanation

**@⁠Nmzik** on GitHub · 2026-08-30 20:09 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/418#issuecomment-5470983497) @⁠nomolao2-cell Thanks for finding bug and detailed explanation
Author
Owner

@⁠Nmzik on GitHub · 2026-08-30 23:02 UTC · original

Broad fix: fixing all mask-aware B64 opcodes/64 SAVEEXEC variants

**@⁠Nmzik** on GitHub · 2026-08-30 23:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/418#issuecomment-5471802336) Broad fix: fixing all mask-aware B64 opcodes/64 SAVEEXEC variants
This discussion has been locked. Commenting is limited to contributors.
No description provided.