Shaders: helper lanes take their own value in a pixel shader's first-lane read (#908) #1039
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1039
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1039/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?
@acleofe on GitHub · 2026-11-24 15:14 UTC · original
fix/shader-helper-lanes-readfirstlane→main· +73 −0 · 2 files · 1 commits · closed without mergingDraft: the translation validates, but it has not been run on a GPU. Testers who see DEVICE_HUNG in pixel shaders with a readfirstlane loop, please try it.
What
In pixel shaders,
v_readfirstlane_b32lowered toWaveReadLaneFirstnow gives helper lanes their own value:select(IsHelperLane(), own, WaveReadLaneFirst(own)). Other stages, and the waterfall reads proven inffe310e, are unchanged.Why
Wave operations leave helper lanes out. In a loop over the first lane's value that is not proven a waterfall loop, the real lanes of a quad finish and leave; once only helper lanes remain,
WaveReadLaneFirsthas no lane to read, the compare never matches, and each helper lane runs to the loop limit (2^20 iterations). That can end in DEVICE_HUNG (#908).Taking their own value, helper lanes match on the first pass and leave. They write nothing, so what they compute meanwhile is not seen; real lanes still read the first active real lane, as before.
IsHelperLane(opcode 221) is shader model 6.6, which the translator already emits.Test
a_pixel_shaders_first_lane_read_leaves_helper_lanes_their_own: a pixel shader with a first-lane read translates, and dxil.dll accepts the helper-lane test (it refuses a wrong opcode there, so the call is checked).cargo clippy --workspace --all-targets [--all-features] --locked -- -D warningsandcargo test --workspace --lockedpass.Not verified on hardware: whether this clears the hang in the world needs a GPU run.
🤖 Generated with Claude Code
Pull request closed