Shader: preserve scalar loop exits in native wave32 compute #647
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/647"
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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ANDREANIADS on 2026-11-27T16:23:07Z.
Related to #352; complements the split-wave64 work in #366.
Native wave32 compute currently lets lanes leave a divergent loop before its scalar result has reached the final wave-wide value. On an RTX 3070 the synthetic 64-thread probe returned 1..64 instead of 32 for the first wave and 64 for the second.
This routes a conservative subset of native wave32 loops through the existing structured wide emitter: 1D compute, no LDS, spills or waterfalls, properly nested EXEC backedges, and scalar results used after the latch. Unsupported control flow, mask-as-data and cross-lane operations are rejected by the detector. The emitted wave width stays 32 even when the host allows 64. Translator cache version increases from 2 to 3.
Validation on Windows / NVIDIA RTX 3070 / driver 621.40 / Rust 1.98.1:
Credit: the conservative loop detector is adapted from fladit123's #366; the synthetic scalar-loop fixture builds on adrianmjim's 471e11b. This does not claim to fix all of #352. No gameplay or performance claims.
AI-assisted with Codex.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.