fix(shader): try loop-barrier-free wave-wide form before approximate local waves (VICTORY_WAVE_WIDE_APPROX) #282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/282"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by Mikey970 on 2026-11-27T20:40:32Z.
Problem
When a console wave64 compute shader on a 32-lane host cannot be lowered by the exact non-widened forms,
emitfalls directly back tolocal waves (APPROXIMATE)(where each 32-lane host wave ballots/counts only its own half), because globalVICTORY_WAVE_WIDE=1is unsafe for shaders whose widened barriers fall inside loops.Fix
VICTORY_WAVE_WIDE_APPROX=1(opt-in, off by default; keyed inshader_cache.rs).lower::watch_loop_barriers—accepting it only when it lowers to 32 lanes and puts no translator barrier inside a CFG loop (keepingptfx_CS_lightAtlas_Sprite/_Trailon their safe path).shader_binning_utils:CS_GenerateShaderBinOffsetsandlens_flares:CS_ScanMip0..3) while refusing all loop-barrier shaders.watch_loop_barriershelper inlower.rsso this PR is standalone and can be reviewed/merged independently of theVICTORY_WAVE_WIDE_AUTOPR.)Testing
emit::wide_approx_tests(a_count_in_a_kept_lane_branch_takes_the_wave_wide_form_before_an_approximate_oneanda_count_in_a_kept_lane_branch_in_a_loop_keeps_its_form), both DXIL-validated and passing.cargo check -p victory-gpupasses.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:23:39Z.
Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.
Pull request closed