Shaders: a thread-id count field of 3 still means three components #339
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!339
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/339/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?
@SkippySteve on GitHub · 2026-11-24 02:24 UTC · original
SkippySteve/shader-tidig-count→main· +15 −2 · 1 files · 1 commits · closed without mergingWhat
`ComputeIo::thread_id_vgprs` (crates/victory-shader/src/native.rs) read `COMPUTE_PGM_RSRC2.TIDIG_COMP_CNT` (bits 11-12) and added one, so a field value of 3 gave 4 thread-id VGPRs. `io::raise` then mapped v3 to `Input::ThreadIdInGroup(3)`, and `emit/lower.rs` passes that component straight to DXIL's `threadIdInGroup.i32` — a component that doesn't exist (only 0-2 are valid). On the console-lanes path, component 3 fell into the `_` arm and was silently computed as z.
Fix
A thread id has only x, y and z, so the field is clamped to 2 before adding one: 3 now means v0-v2 like 2 does, and v3 stays an ordinary VGPR. One line plus a doc comment.
Tests
@SkippySteve on GitHub · 2026-11-24 02:25 UTC · original
superseded by #333 (combined native.rs: SGPR bound + refusal tests + TIDIG_COMP_CNT clamp)
Pull request closed