shader: implement Yotei boot shader blockers #340

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

@⁠foufouadi on GitHub · 2026-08-28 17:33 UTC · original
foufouadi:feat/yotei-shader-recompiler → main · +299 −18 · 16 files · 1 commits · closed without merging

Two shader-recompiler additions needed for Ghost of Yōtei's boot compute shaders. Refs #108.

I previously worked on Yōtei boot/GPU issues in SharpEmu and started testing the same title on Kyty. These were the first two shader blockers I hit.

  1. IMAGE_ATOMIC_FMIN/FMAX
    The first compute shader uses MIMG opcodes 0x1e/0x1f (IMAGE_ATOMIC_FMIN/FMAX) on an R32F storage image.

Only integer image atomics were decoded, so the shader was rejected during CFG construction and Kyty exited before opening a window.

decode / translate / IR: add ImageAtomicFMin32 / ImageAtomicFMax32
SPIR-V: implement the float atomic through a compare-and-swap loop on the raw 32-bit texel using OpImageTexelPointer + OpAtomicCompareExchange, matching the existing buffer/shared float atomic lowering and avoiding an SPV_EXT_shader_atomic_float dependency
resource/descriptors: allow k32SInt / k32Float atomic image descriptors and expose them as R32Uint
2. DPP8
The next blocker was src0 escape 0xe9 (0xea for fetch-inactive) on VOP1/VOP2/VOPC.

Only DPP16 (0xfa) was recognised, so the second dword was interpreted as a normal source operand and failed with:

unsupported scalar source operand 0xe9

This adds:

DPP8/DPP8FI decoding for VOP1, VOP2 and VOPC
Dpp8MoveU32 / Dpp8UpdateU32 IR operations
SPIR-V lowering using the 8×3-bit lane selectors and OpGroupNonUniformShuffle, following the existing DPP16 path
Testing
Ghost of Yōtei, Windows Release build, Vulkan with shader validation enabled:

before: 0 shaders compiled
after IMAGE_ATOMIC_FMIN/FMAX: 2
after DPP8: 22
no SPIR-V validation errors
Yōtei now gets past both recompiler blockers and stops later on an unrelated compute workgroup-size limit: LocalSize Z 256 > device max 64.

The changes only add previously unsupported opcodes/formats; existing shader paths are unchanged.

**@⁠foufouadi** on GitHub · 2026-08-28 17:33 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/340) `foufouadi:feat/yotei-shader-recompiler` → `main` · +299 −18 · 16 files · 1 commits · closed without merging Two shader-recompiler additions needed for Ghost of Yōtei's boot compute shaders. Refs https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/108. I previously worked on Yōtei boot/GPU issues in SharpEmu and started testing the same title on Kyty. These were the first two shader blockers I hit. 1. IMAGE_ATOMIC_FMIN/FMAX The first compute shader uses MIMG opcodes 0x1e/0x1f (IMAGE_ATOMIC_FMIN/FMAX) on an R32F storage image. Only integer image atomics were decoded, so the shader was rejected during CFG construction and Kyty exited before opening a window. decode / translate / IR: add ImageAtomicFMin32 / ImageAtomicFMax32 SPIR-V: implement the float atomic through a compare-and-swap loop on the raw 32-bit texel using OpImageTexelPointer + OpAtomicCompareExchange, matching the existing buffer/shared float atomic lowering and avoiding an SPV_EXT_shader_atomic_float dependency resource/descriptors: allow k32SInt / k32Float atomic image descriptors and expose them as R32Uint 2. DPP8 The next blocker was src0 escape 0xe9 (0xea for fetch-inactive) on VOP1/VOP2/VOPC. Only DPP16 (0xfa) was recognised, so the second dword was interpreted as a normal source operand and failed with: unsupported scalar source operand 0xe9 This adds: DPP8/DPP8FI decoding for VOP1, VOP2 and VOPC Dpp8MoveU32 / Dpp8UpdateU32 IR operations SPIR-V lowering using the 8×3-bit lane selectors and OpGroupNonUniformShuffle, following the existing DPP16 path Testing Ghost of Yōtei, Windows Release build, Vulkan with shader validation enabled: before: 0 shaders compiled after IMAGE_ATOMIC_FMIN/FMAX: 2 after DPP8: 22 no SPIR-V validation errors Yōtei now gets past both recompiler blockers and stops later on an unrelated compute workgroup-size limit: LocalSize Z 256 > device max 64. The changes only add previously unsupported opcodes/formats; existing shader paths are unchanged.
Add IMAGE_ATOMIC_FMIN/FMAX support for R32F storage images using a raw-texel compare-and-swap loop.

Add DPP8 and DPP8FI operand decoding, IR operations, and SPIR-V subgroup-shuffle lowering for VOP1, VOP2, and VOPC instructions.

Together these changes allow Ghost of Yotei to progress from zero to 22 compiled boot shaders without SPIR-V validation errors.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:16:50 +00:00
github-bot closed this pull request 2026-11-26 09:16:50 +00:00
Author
Owner

@⁠Nmzik on GitHub · 2026-10-06 17:18 UTC · original

duplicate #338

**@⁠Nmzik** on GitHub · 2026-10-06 17:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/340#issuecomment-6021583669) duplicate #338

Pull request closed

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