Repository navigation
Conversation
RDNA2 saturates a 32-bit UINT channel of a d16 format load to 0xFFFF and a SINT one to -32768..32767; d16_channels kept the low 16 bits (70000 loaded as 0x1170). Measured on gfx1031 (xcl-dev/xcl#1488, XCL-BT-020) and gfx1036 (boykopovar/AnyPS5#22750). 8- and 16-bit formats never leave that range, so they are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5b42f8f to
53affcc
Compare
|
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. |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
144 passed / 0 failed / 2 ignored. d16 format loads saturate 32-bit integer channels — pairs with #1940 (same d16 load path, UNORM/SNORM rounding); both pass independently, maintainer should check they compose.
|
Automated triage for the maintainers. Merge candidate.
CI: Generated by Claude Code |
Offline measurement on a retail dumpResult: no count change against I merged head 53affcc onto No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
tbuffer_load_format_d16_*/buffer_load_format_d16_*of a 32-bit integer channel kept its low 16 bits. RDNA2 saturates it instead: UINT to0xFFFF, SINT to-32768..32767. So 70000 in a32_UINTbuffer loaded as0x1170here, and as0xFFFFon the console's GPU.Sources for the rule: measured on gfx1031 for buffer format loads (xcl-dev/xcl#1488, item XCL-BT-020) and on gfx1036 for D16 image reads (boykopovar/AnyPS5#22750).
What is in it
emit/lower.rs,d16_channels: UINT channels go throughmin(x, 0xFFFF)and SINT ones through a clamp to-32768..32767before the 16-bit mask. 8- and 16-bit integer formats never leave that range, so they're unchanged. Float formats are unchanged too: the legacy f32→f16 conversion already rounds toward zero, which matches RDNA2.emit/valu_tests.rs:tbuffer_d16_loads_saturate_32_bit_integerscovers32_UINTand32_SINT, past both ends and in range. It compares only the low half, so it doesn't depend on what an odd last channel leaves in the high half (Shaders: preserve the unwritten high half of packed D16 buffer loads #1441 changes that part, and the two merge cleanly).Tested on Windows 11, RTX 3070 (Ampere, driver 616.56), and WARP, debug, on
main42363ab:cargo test -p victory-shader --locked -- tbuffer_d16: 2 passed. Without thelower.rschange, the new test fails:d16_x format 20 of 0x11170 = 0x00001170, want low half 0xffff.cargo test -p victory-shader --locked: 244 passed, 3 failed, 3 ignored. The 3 are Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744's NVIDIA failures onmain.cargo xtask policyandcargo clippy -p victory-shader --all-targets --locked -- -D warnings: pass.Not tested: a title.
AI-assisted (Claude Code).
🤖 Generated with Claude Code