Repository navigation
shader: handle dword-straddling 16-bit typed buffer loads at byte offset 3 - #1669
geiyiliyabumo wants to merge 1 commit into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.
Dword-straddling 16-bit typed buffer loads at byte offset 3 and tail bounds handled (tbuffer_load_format_offen, run_cases_with_uav_dwords); tests cover 16_UINT/16_SINT straddle and tail offsets on hardware/WARP.
|
Automated triage for the maintainers. Needs rebase. This PR no longer merges cleanly into From the earlier needs-work note, still open: evidence (console capture or a title program) that 16-bit format loads at byte offset 3 straddle two dwords on the console. Generated by Claude Code |
|
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
Not tested: Windows MSVC build, the title itself. AI-assisted. |
|
Rebased cleanly onto \main\ (\ccfb029). \cargo test -p victory-shader --locked tbuffer\ (verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll), \cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings, and \cargo xtask policy\ all pass. |
70d3a82 to
7607291
Compare
Summary
total == 16:16_*and8_8_*families) inLower::format_load(crates/victory-shader/src/emit/lower.rs) when the byte offset satisfiesoff & 3 == 3.format_loadalignedat = off & !3, loaded a single dword, and shifted right by(off & 3) * 8, which left bits[15:8]zeroed whenever a 16-bit element straddled into dwordat + 4.total == 16loads the second dword atselect(byte == 3, at + 4, at)and merges(w0 >> 24) | (w1 << 8)whenbyte == 3. Re-readingatwhenbyte != 3ensures loads atbuffer_end - 2never touch past the buffer end; 8-bit formats (total == 8) remain single-dword loads.Verification
cargo test -p victory-shader --lib: 121 passed, 0 failed, 1 ignored on both AMD Radeon RX 9060 XT (D3D12 hardware) and Microsoft Basic Render Driver (WARP), includingtbuffer_16bit_format_loads_handle_dword_straddling_and_tail_boundscovering16_UINTacross all byte offsets0..=6(including straddling offset 3 and tail offsetbuffer_end - 2on both 8-byte and 4-byte buffers),16_SINTnegative sign extension at offset 3,16_FLOATat offset 3, and 2-channel8_8_UINT(tbuffer_load_format_xy) at offset 3.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: pass (154 files).AI-assisted; synthetic tests only, no game files.