shader: order buffer and image memory at compute S_BARRIER when the shader stores to them #1894
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!1894
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1894/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?
@ghost on GitHub · 2026-10-25 07:05 UTC · original
pr/compute-barrier-memory→main· +17 −2 · 1 files · 1 commits · closed without mergingS_BARRIER in a compute shader acquired and released only workgroup memory. The store completion wait (S_WAITCNT_VSCNT) releases buffer and image stores, but nothing acquired them in the waves that read them after the barrier. A compute shader that writes buffers or storage images now gets UniformMemory | ImageMemory on its workgroup barrier as well (shaders without stores are unchanged).
UFC 6 (PPSA23566) builds per-pixel lists in buffers in its hair compute shader and walks them after the barrier; with workgroup memory alone a wave could read an old next pointer and loop forever. In our runs GPU hangs while a fight loads went from about 3-4 per 60 loads to 1 in 120.
Related: #1495 also orders buffer memory at s_barrier as part of a larger bring-up; this PR is the narrow change on its own.
Tests: shader_recompiler_compute_tests all cases passed.
🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-10-25 07:07 UTC · original
No actionable comments were generated in the recent review.
dde71e16-3bcb-4bd5-90d5-7eef76d70a16Reviewing files that changed from the base of the PR and between
83f8bfd3c9and33d2806c95.src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Walkthrough
EmitBarriernow builds mutable memory-semantics flags. For non-tessellation compute shaders, it adds uniform-memory and image-memory semantics when address operations or written buffer or image resources are present. Other stages and compute shaders without those writes retain the previous semantics. Tessellation retains no memory semantics.Suggested reviewers:
nmzikPriority:
Normal
Change: Bug fix
Merge Risk:
Minimal · up to
33d28No actionable barrier-semantics issue remains identified; the change is mergeable after normal checks.
Pre-merge checks:
4 ·
1
S_BARRIERwhen the shader stores to them.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.Pull request closed