shader: lower Sonic Origins vertex launch masks on macOS #1427

Closed
github-bot wants to merge 1 commit from gh-pr/1427/head into gh-pr/1427/base
Owner

@⁠yeraldinm on GitHub · 2026-10-11 18:35 UTC · original
yeraldinm:fix/macos-sonic-ngg-launch-mask → main · +193 −2 · 6 files · 1 commits · closed without merging

Sonic Origins (PPSA05324, 02.002.000) fails vertex pipeline creation on Apple M1 when MoltenVK rejects its NGG launch-mask prologue: Subgroup builtins are not available in this type of function.

This adds an Apple-only compiler pass that folds the exact validity predicates derived from the compiler's initial vertex-count ballot. Vulkan vertex invocations represent valid input vertices, and the synthetic launch state has no primitive-export invocations. Direct count consumers and different masks remain intact; propagation and dead-code elimination then remove unused subgroup operations.

Validation:

  • The synthetic shader regression failed before the change because the validity prologue retained unsupported subgroup operations.
  • The freshly compiled regression passes wave32 and wave64 cases, preserves position exports, retains count exports and different masks, and validates all emitted SPIR-V with SPIRV-Tools. Added to macOS CI.
  • An independent focused review found no blockers.
  • A local integration build progressed past Sonic's subgroup pipeline failure. That tree also contains separate macOS bring-up changes, which are excluded here.

Limits: the available Sonic copy contains APR-EMU modifications. Sonic still hits a later crash; this is a shader compilation fix, not a claim that Sonic is playable or that this PR alone enables macOS gameplay. The pass is not invoked on Windows or Linux; those platforms have not been locally built. No game binaries or captured game shaders are included. Developed with AI assistance.

**@⁠yeraldinm** on GitHub · 2026-10-11 18:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1427) `yeraldinm:fix/macos-sonic-ngg-launch-mask` → `main` · +193 −2 · 6 files · 1 commits · closed without merging Sonic Origins (`PPSA05324`, 02.002.000) fails vertex pipeline creation on Apple M1 when MoltenVK rejects its NGG launch-mask prologue: `Subgroup builtins are not available in this type of function`. This adds an Apple-only compiler pass that folds the exact validity predicates derived from the compiler's initial vertex-count ballot. Vulkan vertex invocations represent valid input vertices, and the synthetic launch state has no primitive-export invocations. Direct count consumers and different masks remain intact; propagation and dead-code elimination then remove unused subgroup operations. Validation: - The synthetic shader regression failed before the change because the validity prologue retained unsupported subgroup operations. - The freshly compiled regression passes wave32 and wave64 cases, preserves position exports, retains count exports and different masks, and validates all emitted SPIR-V with SPIRV-Tools. Added to macOS CI. - An independent focused review found no blockers. - A local integration build progressed past Sonic's subgroup pipeline failure. That tree also contains separate macOS bring-up changes, which are excluded here. Limits: the available Sonic copy contains APR-EMU modifications. Sonic still hits a later crash; this is a shader compilation fix, not a claim that Sonic is playable or that this PR alone enables macOS gameplay. The pass is not invoked on Windows or Linux; those platforms have not been locally built. No game binaries or captured game shaders are included. Developed with AI assistance.
Fold exact synthetic NGG launch-validity predicates before SPIR-V emission,
while preserving real count consumers and different lane masks.
Cover wave32/wave64 SPIR-V validation in macOS CI.

Developed with AI assistance and tested locally on Apple M1.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:56:31 +00:00
github-bot closed this pull request 2026-11-26 09:56:31 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.