shader: keep v_readlane VGPRs per lane in LDS (LaneMirror) #2
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/edsuuu--VI-BR-PORT!2
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2/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?
@vilja22 on GitHub · 2026-11-26 23:49 UTC · original
vilja22:lanemirror→main· +94 −0 · 1 files · 1 commits · merged 2026-11-27 00:40 UTCWhat
A translation-only change for compute programs whose host waves are their console waves
(no
exchange, nohalves):v_readlane_b32;8,192-dword LDS limit; skipped if it does not fit);
value into its own LDS slot;
v_readlane_b32reads the requested lane's slot from LDS instead ofwaveReadLaneAt.One file, +94 lines: a
LaneMirrorstruct, the prologue allocation afters.wave_size, a per-instruction write hook in the block loop, and the read path.Why
On NVIDIA, the RT compute passes either ask for 64-lane waves (refused by the host, as
your
e600d22log now reports) or containwaveReadLaneAtinside a branch. dxil-spirvinside vkd3d-proton moves those lane reads out of the branches, and on these programs it
recurses without end, so the pipeline is never made. The mirror removes the
waveReadLaneAtwhen every lane's value is available in LDS, which also removes thereason for the compiler to restructure the branch.
Evidence
With this change, the emitted DXIL changes for 4 of the 6 RT compute passes that hang
(compare
victory translate --listdigests, old → new):02737aba304c298adeferred_tiled:CS_ComputeClosestDepth47c46db387f30d7eindirect_diffuse_lighting:CS_DeferredGather_Shared_Wave32306e8053bb5c7b83indirect_diffuse_lighting:CS_ScreenProbes_TraceRays_RayBinning_BVH3adb6fc86da11a5bindirect_diffuse_lighting:CS_ScreenProbes_TraceRays_RayBinning_BVHUnchanged, by design:
ec34a3f2e09aed11(InstanceCulling:CS_Prop_BatchCullReflect) and37d9c18c015bc7f3(dirt_normal_tnt:CS_RaytracingResolve). They take the cross-halfpath; mirroring them needs the LDS write plus a group sync before the read, since the two
host waves may be on different compute units. That is a follow-up, not part of this PR.
What this does not claim
It does not by itself make the RT world load here: the run still stopped later on other
compute programs (reported separately with hashes and the pipeline trace). This PR is one
piece of the wave64 puzzle, with the cross-half half still to do.
Credit and licence
The idea and the shape of the mirror are from AnyXboxX's merged VIctory base (they credit
Exorion for it); this is a port to this translator's layout, GPL-3.0-or-later, same as
the repository.
Testing
cargo xwin build --profile release -p victory --features diagnostics --target x86_64-pc-windows-msvc— clean.victory translate --liston the shader archive: the four digests above change, therest are unaffected; no new translation failures.
v_readlane.