Repository navigation
Shaders: keep pixel helper lanes out of wave-first loops and quad permutes - #895
sagouindupm wants to merge 1 commit into
Conversation
Both remaining "port from the fork" phases turned out to be taken, and the manifest could not say so, so the next session would have rebuilt them. J's two halves are open PRs by other people: fxceless#895 by sagouindupm already lowers pixel quad reads through quadReadLaneAt with the helper lanes reached, and fxceless#917 is the constant-in-place-of-indirect-light switch this phase describes. Building either would duplicate an open PR and conflict with it in the same file. K is gated on fxceless#653: 113 upstream fixes across 28 files that rewrite the same files, with a conflict already open in it. Re-reading that diff for cd94d35 once it merges decides K without writing anything. The gate caught a stray vertical tab in the note text -- TOML forbids control characters in strings, and the error pointed at the line.
|
Ran this on AMD with 64-lane waves, since the description only has Windows test runs. Setup: RX 7900 XT, RADV (Mesa 26.3.1), Wine 11.22 with vkd3d-proton from GE-Proton11-14, diagnostics build. Tree:
So nothing breaks on RADV with it; whether it fixes something visible I couldn't tell from these scenes. |
|
Scope. Second path. Tests. The body's Attribution to #1733/ |
|
I ported the original #1733 first-lane change to our Wine-free Linux branch, preserving Vax's author credit. The native regression translates a source-built pixel shader, checks for both the wave read and helper-lane test, and creates its host graphics pipeline. Microsoft’s DXIL validator and Vulkan validation accepted it on RADV and Lavapipe. This covers the first-lane change separately from the quad-read changes in this PR. Native test branch In the headless Lavapipe title run, the last captured frame was 800 and still showed illustrated loading. Both the control and this build exited at the same title-side null write, roughly five minutes after launch. I have no open-world performance measurement from this experiment. Tested-on: Radeon RX 6800 and Lavapipe, Fedora Linux 45, native vkd3d-proton with Vulkan validation |
Ports two complementary pixel-shader helper-lane fixes onto
main(f85101b), both fromGPL-3.0-or-laterupstreams/forks:helpers_read): Inds_swizzle_b32and DPP instructions, pixel quad permutations (quad) now lower throughquad_pick(dx.op.quadReadLaneAt.i32) instead of wave-widewaveReadLaneAt, regardless of whether the shader hasdiscards. At triangle edges, neighboring lanes of a 2x2 quad are helper lanes that quad reads see cleanly whereas wave reads exclude them. (Adapted fromBelobug/VIctory-Belobug-AMDcommit03629f3f.)v_readfirstlane_b32(helper_reads_own): Guardv_readfirstlane_b32results in pixel shaders withdx.op.isHelperLane.i1(SM 6.6 opcode221) so helper lanes read their own value instead of spinning when only helper lanes remain in a waterfall loop (WaveReadLaneFirstignoring helper lanes). Computes remain unchanged. (Ported fromMarvisak/VIctoryPR#1733/ commit0601955byVax.)Summary of changes
crates/victory-shader/src/emit/lower.rs: Addhelpers_readandhelper_reads_own; applyhelpers_read(quad)inds_swizzle_b32anddpp, and wrapv_readfirstlane_b32results (includingVICTORY_FIRSTLANE_OWN=1path) withhelper_reads_own.crates/victory-shader/src/emit/bitcode.rs&crates/victory-shader/src/emit/mod.rs: Expose#[cfg(test)] Module::func_names()andLowered::funcs, and add unit testspixel_readfirstlane_uses_is_helper_lane_and_compute_does_notandpixel_quad_swizzle_without_discards_uses_quad_read_lane_atvalidated throughdxil.dll.Attribution
Vax/Marvisak/VIctoryPR#1733(0601955,GPL-3.0-or-later)Belobug/VIctory-Belobug-AMDcommit03629f3f(GPL-3.0-or-later)Verification
Run on Windows 11 Pro (x86_64-pc-windows-msvc, Rust 1.98.1,
dxil.dllpresent):cargo test --release -j 6 -p victory-shader -- barycentric_tests --test-threads=1-> 10 passed; 0 failed (including both new tests +dxil.dllvalidation).cargo test --release -j 6 -p victory-shader -- waterfall_tests --test-threads=1-> all passed; 0 failed.cargo test --release -j 6 -p victory-shader -- wave64_tests --test-threads=1-> 6 passed; 0 failed.cargo clippy -j 6 -p victory-shader --all-targets --no-deps -- -D warnings-> 0 warnings, exit 0.cargo run -j 6 -p xtask -- policy->asset policy: 175 files ok.AI-assisted: ported to
origin/main(f85101b), tested withdxil.dllvalidation, and written with AI assistance.