shader: accept 32-bit SINT images for atomics #1256
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!1256
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1256/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?
@NeySlim on GitHub · 2026-10-08 20:37 UTC · original
NeySlim:fix/sint-image-atomics→main· +78 −6 · 3 files · 2 commits · closed without mergingProblem
God of War Ragnarök (PPSA08332, 05.005) stops a minute after boot on current main:
Format 21 is
k32SInt. 32-bit image atomics accept onlyk32UIntandk32Floatdescriptors, and a storage image with a SINT numeric class is rejected outright.The same stop (
atomic image descriptor 0 uses unsupported format 21inMaterializeResources) is reported for FIFA 22 (PPSA02187) when loading an 11v11 match, in #1301; not tested here.Change
On the hardware, 32-bit image atomics are typed by the opcode (
IMAGE_ATOMIC_SMINvsIMAGE_ATOMIC_UMIN, ...), not by the descriptor's numeric format. A 32-bit SINT descriptor used by atomics is now bound through the same R32_UINT view as a UINT one, ask32Floatalready is:BuildResourceSpecializationacceptsk32SIntfor 32-bit atomics and does not reject the SINT class for atomic storage images, andValidateStorageTextureaccepts it. Non-atomic SINT storage images keep their current handling.Test
New
ImageAtomicSintDescriptor: ak32SIntstorage image updated withIMAGE_ATOMIC_SMINandIMAGE_ATOMIC_SMAXon values chosen so that an unsigned comparison would pick the other operand (for example SMAX(-5, 7) = 7 and SMIN(3, -2) = -2), with GLC returning the previous texels. It fails without the change (translated resources could not be materialized).ImageAtomicVariants,ImageAtomicSwapReturnsPreviousTexelandImageStoreAndAtomicUseSeparateBindingsstill pass.The GPU case creates its image as R32_UINT directly, so it does not reach the renderer's
ValidateStorageTexture. New host checkAtomicSintStorageTexture(runs on every platform in the default run) validates ak32SIntdescriptor for an atomic storage image that is also read, as an image with loads and atomics is; it exits without thedescriptors.cppchange (unsupported storage texture ... format=0). On non-Windows it also checks that a 64-bit atomic on the same descriptor is still rejected.Validation
Linux, Ryzen AI Max+ 395, Radeon 8060S, Mesa RADV 26.2.3.
shader_recompiler_compute_tests, one case per process: 596 of 605 pass, the 9 others fail on main too on this setup.resource_tracking_testsandresource_materialization_testspass.Not tested on Windows or macOS; the change is platform-independent.
AI use
I used Claude Code (AI agent) to find the failing descriptor, write the change and the test, and run the test and the game above on my machine. I reviewed the diff and the results before opening this PR.
@coderabbitai[bot] on GitHub · 2026-10-08 20:40 UTC · original · edited 2026-10-12 16:02 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
e7862ec6-5dd2-4ded-8965-9db7897d1c8f📥 Commits
Reviewing files that changed from the base of the PR and between
2f4b8a335dand 0ab3b956ad17ba318d48a83e9fe4c4a52e30dda2.📒 Files selected for processing (3)
src/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
📝 Walkthrough
📝 Walkthrough
Walkthrough
Storage-image validation now accepts
k32SIntformats for non-64-bit atomic images while retaining the existing UINT handling for atomic images. A new compute test checks signed image atomic minimum and maximum operations across four input cases.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
0ab3bNo actionable issue is established for this change; it is mergeable after normal checks.
Pre-merge checks |
4 |
1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 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.@overlordxrz-source on GitHub · 2026-10-11 00:57 UTC · original
A second game hits this exact stop: FIFA 22 (PPSA02187), reported in #1301 by @Ransonlee on official build
7b9997b(Windows 11, i5-13400, RTX 4080). Menus and the practice arena run; loading an 11v11 kick-off match fails every time withThat is the same
k32SIntatomic-image rejection inBuildResourceSpecializationthat this PR removes. Current main (947627d10) still has it, and this PR still applies cleanly there. I've asked the reporter to retest with a build of this PR.AI-assisted: yes
@NeySlim on GitHub · 2026-10-11 00:59 UTC · original
Thanks for linking #1301. I added it to the description as a second affected game (not tested here).
@NeySlim on GitHub · 2026-10-14 06:17 UTC · original
Covered by
aec8c887on main (32-bit atomics on 32_SINT views). Closing.Pull request closed