Shaders: reuse the wave32 group barrier across consecutive LDS reads (port of gomeaw bb61bb7) #628

Open
github-bot wants to merge 1 commit from github-bot/gh-628 into a-publier AGit
Owner

@⁠jptorres96 on GitHub · 2026-11-27 14:59 UTC · original
jptorres96:port-lds-barrier-reuse → a-publier · +120 −9 · 4 files · 1 commits · open

Port of gomeaw/VIctory-7900XTX bb61bb7 (via 301e10e): reuse the wave32 group barrier across consecutive LDS reads (avatarmanz/VIctory-7900XTX#143, #152). Authorship kept (cherry-pick -x). The only conflict was TRANSLATOR_VERSION, bumped here from 2 to 3 so cached translations are redone.

On a synthetic fixture the wave32 lowering goes from 7 group barriers to 4. Barriers that order reads against a later write or atomic are kept. Wave64 keeps its one explicit barrier.

Verified on RTX 4080 SUPER (driver 621.01), DXIL validator from DXC 1.9.2609.5:

  • wave32_lds_read_runs_share_a_barrier: 4 barriers, validator accepts, all 64 lanes read the right old and new LDS values on the card
  • cargo test -p victory-shader --lib --test-threads=1: 304 passed, 0 failed, 4 ignored, no hardware case skipped
  • cargo clippy --workspace --all-targets -- -D warnings: clean

Not measured in-game (no game dump here). An in-game GPU ms/frame A/B on any card would be welcome.

**@⁠jptorres96** on GitHub · 2026-11-27 14:59 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/628) `jptorres96:port-lds-barrier-reuse` → `a-publier` · +120 −9 · 4 files · 1 commits · open Port of gomeaw/VIctory-7900XTX `bb61bb7` (via `301e10e`): reuse the wave32 group barrier across consecutive LDS reads (avatarmanz/VIctory-7900XTX#143, #152). Authorship kept (cherry-pick `-x`). The only conflict was `TRANSLATOR_VERSION`, bumped here from 2 to 3 so cached translations are redone. On a synthetic fixture the wave32 lowering goes from 7 group barriers to 4. Barriers that order reads against a later write or atomic are kept. Wave64 keeps its one explicit barrier. Verified on RTX 4080 SUPER (driver 621.01), DXIL validator from DXC 1.9.2609.5: - `wave32_lds_read_runs_share_a_barrier`: 4 barriers, validator accepts, all 64 lanes read the right old and new LDS values on the card - `cargo test -p victory-shader --lib --test-threads=1`: 304 passed, 0 failed, 4 ignored, no hardware case skipped - `cargo clippy --workspace --all-targets -- -D warnings`: clean Not measured in-game (no game dump here). An in-game GPU ms/frame A/B on any card would be welcome.
Reuse a barrier after an explicit full-group wait or an all-lane block entry. Preserve the barriers that order writes and atomics and start the read phase afresh at block boundaries and after other operations. Cover cross-half reads on both sides of a write and verify the actual DXIL barrier count.

(cherry picked from commit bb61bb7aa0680b50ea66bf89894dce59150256d5)
(cherry picked from commit 301e10eb8e9fe19f045118f996bd66af4d78434d)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:03:16 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/628/head:github-bot/gh-628'
git switch 'github-bot/gh-628'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-628'
git switch 'github-bot/gh-628'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-628'
git switch 'github-bot/gh-628'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-628'
git switch 'a-publier'
git merge --squash 'github-bot/gh-628'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-628'
git switch 'a-publier'
git merge 'github-bot/gh-628'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.