Repository navigation
Shaders: lower compute thread-group info and s_get_waveid_in_workgroup - #551
kilvynsilveira-tech wants to merge 1 commit into
Conversation
|
Check on Linux, not Windows: pass. Head
On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed. |
|
Triage note: overlaps #521 ( |
f96ce29 to
9670518
Compare
|
Rebased onto current \main\ (\fe310e) and updated the new tests to pass \Some(&st)\ to Regarding the overlap with #521:
If #521 lands first, I'm happy to rebase again and keep only the distinct pieces. Re-verified after rebasing:
|
|
Overlap with #1686: this PR also lowers pixel sample coverage via |
|
Automated triage for the maintainers. Thanks for rebasing and for dropping the coverage part in favour of #1686. The new head merges cleanly and is now reviewed. In This also covers the wave-count part of #521, so only one of the two should land. Verdict: merge candidate (a recommendation to look, not an approval). CI: passing. Generated by Claude Code |
|
Triage is right: the branch is based on fe310e and crates/victory-shader/src/emit/lower.rs has moved since. I do not have push access to your fork, but the conflict is confined to the lower match arms for the group-info ops; a git rebase origin/main and keeping the new arms alongside the added ones resolves it. Happy to review the rebased head. |
Model the full COMPUTE_PGM_RSRC2.TG_SIZE_EN layout ({first_wavefront, 14'b0, wave_id[10:0], wave_count[5:0]}), lower s_get_waveid_in_workgroup in compute and mesh stages, and share wave_id() with MergedWaveInfo. Drop SampleCoverage in favour of Marvisak#1686.
9670518 to
b97b7bb
Compare
|
Rebased onto latest
Verified locally:
|
Lower two workgroup wave-identity inputs the emitter previously refused:
COMPUTE_PGM_RSRC2.TG_SIZE_EN): was"the thread-group info SGPR". Now packs the full hardware layout{first_wavefront, 14'b0, ordered_append_term[10:0], wave_count[5:0]}(LLVM AMDGPUUsage, Initial Kernel Execution State):5:0: wave count in the group (threads.div_ceil(wave) & 0x3F, counting partial trailing waves).11:6: wave index in the group (flattenedThreadIdInGroup >> log2(wave)), matching Mesa ACO'stg_sizesubgroup-id extraction (& 0xfc0/s_bfe_u32at offset 6, width 6) when GDS ordered append is disabled.31:first_wavefront(1on wave0,0otherwise).s_get_waveid_in_workgroup: was"a scalar memory read as data". Now writes the same wave index to its destination SGPR in compute and mesh stages (nulldestination is a no-op), and refuses cleanly outside compute and mesh (Ps/Vs).Input::MergedWaveInfonow shares the sameLower::wave_id()helper.(Note: pixel
Input::SampleCoveragewas dropped from this PR in favour of #1686 so the two PRs do not overlap.)Tests (synthetic machine code only;
cargo xtask policypasses)emit::tests::group_info_and_waveid_in_workgroup_lower_and_validate(cross-platform +dxil.dllcontainer/hash validation on Windows): compute inwave32andwave64([96, 1, 1], joined across control flow, plusnulldestination),s_get_waveid_in_workgroupinHwStage::Ms, and clean refusals inHwStage::PsandHwStage::Vs.emit::valu_tests::compute_group_info_and_waveid_in_workgroup_match_the_group: 3D[8, 4, 3](96-thread) compute dispatch in bothwave32(3 waves) andwave64(2 waves, partial trailing wave), verifying all 32 bits ofTG_SIZE(first_wavefront | wave_id << 6 | wave_count) ands_get_waveid_in_workgroupper thread on available SM 6.6 hardware and WARP backends.Validation
cargo clippy --workspace --all-targets --locked -- -D warnings— cleancargo clippy --workspace --all-targets --all-features --locked -- -D warnings— cleancargo run -p xtask --locked -- policy— clean (191 files ok)cargo test -p victory-shader --locked— new tests and non-SM 6.6 suite pass locally (dxil.dllvalidated; live SM 6.6 / WARP dispatch runs in CI and on SM 6.6 hosts; local GPU is RX 580)