Shaders: omit unnecessary fixed WaveSize for single-wave LDS compute shaders #22
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!22
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-22"
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?
@vicennpacheco on GitHub · 2026-11-25 12:27 UTC · original
vicennpacheco:fix/single-thread-lds-wave-size→main· +77 −2 · 2 files · 1 commits · openProblem
On 64-lane-only AMD GCN GPUs (e.g. Radeon Vega 8 /
gfx90c), all 9 hardware tests invictory-shader'semit::memory_testsfailCreateComputePipelineStatewithE_INVALIDARG(0x80070057).Root cause
In
crates/victory-shader/src/emit/lower.rs,one_wave && s.lds_dwords > 0emitted[WaveSize(32)]wheneverthreads <= 32andrsrc2reserved LDS — even when:group == 1(a single thread never needs wave lockstep),Fields::Ds/Fields::Buffer { lds: true }), ortarget.lanes_min >= group, e.g.<= 32threads on a 64-lane-only GCN GPU).Drivers that only support 64-lane waves reject
[WaveSize(32)]withE_INVALIDARG.Fix
one_waveincrates/victory-shader/src/emit/lower.rstogroup > 1 && group <= wave && uses_lds && x.target.lanes_min < group.emit::memory_tests::one_wave_lds_wave_size_policycovering all four cases (placed inmemory_tests.rssolower.rsdoes not grow further).Verification
Tested on Windows 11, AMD Radeon Vega 8 iGPU (Ryzen 7 5825U, GCN 5 /
gfx90c, PCI1002:15E7, AMD driver31.0.21921.13001), Rust1.98.1(x86_64-pc-windows-msvc), without game files:cargo test -p victory-shader --lib -- emit::memory_tests: 10 passed, 0 failed, 1 ignored (was 0 passed, 9 failed)VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --lib -- emit::memory_tests: 10 passed, 0 failed, no debug-layer errors(AI-assisted investigation and patch.)
@Ekabusto on GitHub · 2026-11-25 12:47 UTC · original
Checked locally:
cargo test -p victory-shader --libpasses (267 passed, 6 ignored, including the new test). This host supports 32-lane waves, so I could not reproduce theE_INVALIDARGon a 64-lane-only GCN part. No conflicts withmainor the other open PRs.On coverage:
uses_ldscountsFields::DsandFields::Buffer { lds: true }but notFields::Flat { lds: true }. That is fine, becauseLower::flat(lower.rs:1584) already refuses a global load into LDS, so no translated program can reach LDS that way. Checkinglanes_min < groupis also the right condition: when the host's smallest wave already holds the whole group, the group runs as one wave without the attribute. Looks good to me.Reviewed on Windows 11 (build 26300), Rust 1.98.1, each PR in its own worktree; no game data, not run in the game. AI-assisted (Claude Code).
@ySKELLETONX on GitHub · 2026-11-25 16:35 UTC · original
Tested on an RX 7600 XT 16 GB (RDNA3, Navi 33), driver 32.0.32015.2008, Windows 11 Pro build 26300, Rust 1.98.1, at
72c7b01:cargo test -p victory-shader --lib --locked: 267 passed, 0 failed, 6 ignored, hardware dispatch tests included (mainat01aadd1: 266 passed). Workspace tests only; not run in the title.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.