shader: keep tessellation ring attributes static, reject HS stores outside their record #1791
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!1791
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1791"
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?
@NeySlim on GitHub · 2026-10-21 16:20 UTC · original
NeySlim:fix/tess-static-ring→main· +121 −1 · 3 files · 2 commits · openProblem
Follow-up to #1482, whose main part landed in
1ce663b5a. Two changes from it are not in main.address % stride), even though the guest always addresses them asstride * control point + constant. On RADV this hits a driver bug: when a TCS writes a per-vertex output at a dynamic location, the TES reads 0 from its non-constant patch outputs. In God of War Ragnarök (PPSA08332, 05.005) with--tessellation, the snowy terrain in the Freya fight turns into a flat grey slab in front of the characters (the depth prepass and the G-buffer pass get different tessellated positions). Still the case with Mesa 26.2.5; a standalone GLSL reproducer shows it outside the emulator.constant + offset + sizegoes past its control point record is lowered as a store to the invocation's own output, which writes the wrong record without any error.Change
stride * cp - 16 + (offset + 16)keeps its record offset. Other addresses keep theOpUModpath.ReflectTessellationLayoutstops with an error on an HS store that leaves its control point record.Test
CheckTessellationProgramrequires noOpUModin the LS, HS and TES of the stride programs, and the same record offsets for an HS read through a negative inline constant. Fails on main.TessellationStoreOutsideRecord(--tessellation-only, not on Windows: usesfork): an HS whose stores land in the next record must stop with a fatal error. Fails on main.Validation
Linux, Radeon 8060S (RDNA 3.5), Mesa RADV 26.2.5.
shader_recompiler_compute_testsone case per process: same results as main (770 of 823 pass).--tessellation, together with my other open PRs: no slab with this branch; the slab is back without it, same scene.Not tested on Windows. Nothing platform specific in the change.
AI use
I used Claude Code (AI agent) to find the cause, write the change and the tests, and run the tests and game runs above on my machine. I reviewed the diff and the results.
@coderabbitai[bot] on GitHub · 2026-10-21 16:41 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
c4cc72aa-389b-421e-93c5-354f33c24eba📥 Commits
Reviewing files that changed from the base of the PR and between
4644c52927andeac74a25fe.📒 Files selected for processing: 3
src/graphics/shader/recompiler/Tessellation.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterTessellation.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
The change rejects control-point HS stores that extend beyond the per-control-point record. The SPIR-V tessellation pointer logic now derives a constant record offset for supported address expressions and uses modulo-stride calculation when it cannot derive one. Tests check generated assembly for modulo operations and verify that an out-of-record HS store causes analysis to fail.
Suggested reviewers:
mrbigbritches,nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
eac74No actionable merge-blocking issue was established for the tessellation changes. Merge after normal validation.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 too large.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.