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

Closed
opened 2026-11-27 16:58:34 +00:00 by tiagonogueiraa-bit · 3 comments
tiagonogueiraa-bit commented 2026-11-27 16:58:34 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T16:58:34Z.


"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.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6650998519 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-27T16:58:34Z. --- "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 commented 2026-11-27 16:58:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T16:58:35Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7223884435 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406#issuecomment-7223884435). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-27T16:58:35Z. --- /claim
github-actions[bot] commented 2026-11-27 16:58:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T16:58:45Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7223887573 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406#issuecomment-7223887573). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T16:58:45Z. --- Claimed by @tiagonogueiraa-bit. Open a draft pull request with `Refs #406` in its description within 24 hours, or the claim expires.
LakshanSivakumar commented 2026-11-28 00:35:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:35:54Z.


Thank you for this. It is fixed on main by #409. 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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7231039686 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/406#issuecomment-7231039686). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-28T00:35:54Z. --- Thank you for this. It is fixed on main by #409. 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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#406
No description provided.