Barycentrics read directly (285 pixel shaders): supply them from SV_Barycentrics #410

Closed
opened 2026-11-27 17:05:42 +00:00 by github-bot · 3 comments
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-27 16:58 UTC · original

"barycentrics read directly" is the largest pixel refusal left: 285 pixel shaders in a 26,849-shader corpus (Series S, boot to the story load, main b998bb6). These programs read their barycentric input VGPRs (i, j) as data, not only through v_interp_*. Most often the pair is the register a v_fma_mixlo_f16 keeps a half of before a compr export.

Plan.

  • Supply the pair from SV_Barycentrics (SM 6.1). The RDNA2 i and j weigh the second and third vertices (P0 + i·P10 + j·P20), so they are channels y and z.
  • Declare one element per interpolation mode the program reads (perspective or linear; centre, centroid or sample). Keep the pull model refused.
  • Set ShaderFlags bit 22 and SFI0 0x20000.
  • Add a GPU test that the pair has those values on Metal (Apple's converter maps SV_Barycentrics to [[barycentric_coord]]), and a by-output sweep.
**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-27 16:58 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406) "barycentrics read directly" is the largest pixel refusal left: 285 pixel shaders in a 26,849-shader corpus (Series S, boot to the story load, main `b998bb6`). These programs read their barycentric input VGPRs (`i`, `j`) as data, not only through `v_interp_*`. Most often the pair is the register a `v_fma_mixlo_f16` keeps a half of before a `compr` export. **Plan.** - Supply the pair from `SV_Barycentrics` (SM 6.1). The RDNA2 `i` and `j` weigh the second and third vertices (P0 + i·P10 + j·P20), so they are channels y and z. - Declare one element per interpolation mode the program reads (perspective or linear; centre, centroid or sample). Keep the pull model refused. - Set ShaderFlags bit 22 and `SFI0` `0x20000`. - Add a GPU test that the pair has those values on Metal (Apple's converter maps `SV_Barycentrics` to `[[barycentric_coord]]`), and a by-output sweep.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:05:42 +00:00
Author
Owner

@⁠tiagonogueiraa-bit on GitHub · 2026-11-27 16:58 UTC · original

/claim

**@⁠tiagonogueiraa-bit** on GitHub · 2026-11-27 16:58 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406#issuecomment-7223884435) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 16:58 UTC · original

Claimed by @⁠tiagonogueiraa-bit. Open a draft pull request with Refs #406 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 16:58 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406#issuecomment-7223887573) Claimed by @⁠tiagonogueiraa-bit. Open a draft pull request with `Refs #406` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-28 00:35 UTC · original

Thank you for this. It is fixed on main by #413. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 00:35 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406#issuecomment-7231039686) Thank you for this. It is fixed on main by #413. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.