Support wave32 NGG passthrough programs #727
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!727
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/727/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@carbonimax on GitHub · 2026-09-20 08:13 UTC · original
carbonimax:codex/ngg-passthrough-wave32→main· +475 −39 · 10 files · 11 commits · closed without mergingSummary
Validation
main:kyty_emulatorandshader_cfg_testsbuildshader_cfg_testspasses, including the wave32 ABI regressionThis demonstrates shader and draw progression in the game; correct visuals and playability are not yet confirmed.
@coderabbitai[bot] on GitHub · 2026-09-20 08:26 UTC · original · edited 2026-10-01 17:19 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
📝 Walkthrough
Walkthrough
The change adds merged geometry-shader passthrough detection and mesh setup. Mesh translation now supports wave32 and wave64, validates mesh dimensions, and derives wave metadata from the selected wave size. Passthrough allocation data is emitted through SGPR2, and packed vertex indices are emitted through VGPR0. The SPIR-V emitter adds packed wave32 subgroup lane and ballot handling. Regression tests cover passthrough compilation, ABI values, and subgroup isolation.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Feature
Merge Risk: 🟡 Moderate · up to
58c9aSome passthrough shaders can receive incorrect user parameters. Correct the SGPR placement before merging; partial-wave behavior also remains untested.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 4.21% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 261 functions across 40 files. (1 skipped: 1 too large.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-09-20 08:26 UTC · original · reviewed
🧹 Nitpick comments (1)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
64f7586c-4a37-49e9-b571-0bc9a6fd6add📥 Commits
Reviewing files that changed from the base of the PR and between
8cecaf4e30and 27467b10067d890c4e8b9830fd669a8baaa428aa.📒 Files selected for processing (4)
src/graphics/shader/recompiler/frontend/translate/Translate.cppsrc/graphics/shader/shader.cppsrc/graphics/shader/shader.htests/shaderCfgTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-09-21 09:33 UTC · original · reviewed
🧹 Nitpick comments (1)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
513081fd-8e45-4f18-ad55-e6e009ca257a📥 Commits
Reviewing files that changed from the base of the PR and between 27467b10067d890c4e8b9830fd669a8baaa428aa and 6f14b96618612bbcf66e53a41744c2fbe4997830.
📒 Files selected for processing (1)
tests/shaderCfgTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@ -14136,0 +14367,4 @@TestMeshPassthrough(64, 0, 0u | (1u << 10u) | (2u << 20u));TestMeshPassthrough(64, 1, 3u | (4u << 10u) | (5u << 20u));TestMeshPassthrough(64, 2, 6u | (7u << 10u) | (8u << 20u));TestMeshPassthrough(64, 64u - 1u, 189u | (190u << 10u) | (191u << 20u));@coderabbitai[bot] on GitHub · 2026-09-22 22:37 UTC · original · edited 2026-10-01 17:20 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 10740
Add a wave32 case for lane 32.
The wave32 cases only exercise wave 0. Lane 32 produces wave index 1 in
s3, so the current assertion must expect0x21000000for that case.🐛 Suggested fix
@coderabbitai[bot] on GitHub · 2026-09-22 22:37 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
46368f45-6f08-4ba1-9db5-261cd7fd3f1c📥 Commits
Reviewing files that changed from the base of the PR and between 180493e55fc79b7ce2d8f79585037ac3450c352b and
b29d26e0a5.📒 Files selected for processing (2)
src/graphics/shader/shader.cpptests/shaderCfgTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
@coderabbitai[bot] on GitHub · 2026-09-23 15:27 UTC · original · edited 2026-10-01 17:20 UTC
On
src/graphics/shader/shader.cppline 872 (outdated):🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 21710
Check the user-SGPR base for non-merged passthrough programs.
GetShaderParamsuses user data base0unlessmergedis true. Passthrough detection occurs afterparamsis built, sopassthrough_geometrycannot affect that base.When a non-merged
kGsshader passes the protocol scan, the passthrough path compiles it as Mesh code. That path writes the passthrough allocation value to SGPR2. With user data also starting at SGPR0, this overwrites guest user data at SGPR2.Derive the base from
merged || passthrough_geometry, and scan the shader code before buildingparams.Suggested reorder
✅ Confirmed as addressed by @carbonimax
@coderabbitai[bot] on GitHub · 2026-09-23 15:27 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
f5939d3a-ced3-406f-be50-a770d3525cd4📥 Commits
Reviewing files that changed from the base of the PR and between
b29d26e0a5and58c9a672e2.📒 Files selected for processing (40)
src/graphics/guest_gpu/command_processor/commandProcessor.hsrc/graphics/guest_gpu/command_processor/pm4Handlers.cppsrc/graphics/guest_gpu/graphicsRun.cppsrc/graphics/guest_gpu/pm4.hsrc/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.hsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/render.hsrc/graphics/host_gpu/renderer/renderCompute.cppsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/presentation/systemOverlay.cppsrc/graphics/presentation/window/hostInput.cppsrc/graphics/presentation/window/swapchain.cppsrc/graphics/presentation/window/vulkanWindow.cppsrc/graphics/presentation/window/window.cppsrc/graphics/presentation/window/windowInternal.hsrc/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cppsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppsrc/graphics/shader/recompiler/ir/passes/ResourceTracking.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.hsrc/graphics/shader/shader.cppsrc/graphics/shader/shader.hsrc/graphics/shader/shaderCompiler.hsrc/kernel/fileSystem.cppsrc/launcher/src/configurationEditDialog.cppsrc/libs/audio.cppsrc/libs/controller.cppsrc/libs/libKernel.cppsrc/libs/libNet.cpptests/shaderCfgTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@carbonimax on GitHub · 2026-10-01 17:20 UTC · original
On
src/graphics/shader/shader.cppline 872 (outdated):Already addressed by
895cd62fand retained in the main update: the merged passthrough protocol is detected before GetShaderParams, and merged || passthrough_geometry reserves the first eight SGPRs. TestPassthroughShaderUserDataBase checks both wave64 and wave32, including the zero prefix and the captured user data starting at s8.@ -14136,0 +14367,4 @@TestMeshPassthrough(64, 0, 0u | (1u << 10u) | (2u << 20u));TestMeshPassthrough(64, 1, 3u | (4u << 10u) | (5u << 20u));TestMeshPassthrough(64, 2, 6u | (7u << 10u) | (8u << 20u));TestMeshPassthrough(64, 64u - 1u, 189u | (190u << 10u) | (191u << 20u));@carbonimax on GitHub · 2026-10-01 17:20 UTC · original
Covered by TestMeshPassthrough(32, 32u, 96u | (97u << 10u) | (98u << 20u)), alongside lane 31 and both wave sizes. The lane-32 case checks the second guest wave has zero allocation counts while retaining the packed-index ABI. The updated branch also retains TestMeshWave32PackedSubgroupIsolation for two guest wave32 waves in a physical subgroup64.
@coderabbitai[bot] on GitHub · 2026-10-01 17:20 UTC · original
On
src/graphics/shader/shader.cppline 872 (outdated):@carbonimax, confirmed in the supplied code. Passthrough detection now runs beforeGetShaderParams. The conditionmerged || passthrough_geometryplaces user data at s8, which prevents the SGPR2 allocation value from overwriting user data.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@ -14136,0 +14367,4 @@TestMeshPassthrough(64, 0, 0u | (1u << 10u) | (2u << 20u));TestMeshPassthrough(64, 1, 3u | (4u << 10u) | (5u << 20u));TestMeshPassthrough(64, 2, 6u | (7u << 10u) | (8u << 20u));TestMeshPassthrough(64, 64u - 1u, 189u | (190u << 10u) | (191u << 20u));@coderabbitai[bot] on GitHub · 2026-10-01 17:20 UTC · original
Oops, something went wrong! Please try again later. 🐰 💔
@Nmzik on GitHub · 2026-10-08 14:48 UTC · original
Stale
Pull request closed