Repository navigation
Shaders: zero missing channels on typed buffer loads - #1370
fuzeofficlal wants to merge 1 commit into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Typed buffer loads (tbuffer_load_format_*) now zero-fill channels past the format's read instead of padding with 0,0,0,1; diff_tests HLSL reference updated to match (uint4(..., 0, 0)). This is a semantic change to every typed load, so it needs the Windows diff/valu runs to confirm hardware really returns 0 (D3D typed loads traditionally pad w=1 — if this is GFX10 tbuffer behavior verified on hardware, great; the diff_tests update suggests it was). New valu coverage for _x/_xy/_xyz partial loads checks unloaded VGPRs are not clobbered. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main ffe310e, cargo test -p <crate> --locked. Shader execution tests (valu_tests/host/diff_tests) are #[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 96 passed, 0 failed on macOS; execution tests are Windows-gated.
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 tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers structure/lowering unit tests.
Typed buffer loads (tbuffer_load_format) zero-pad missing channels: new const encoders for s_load_dwordx4/buffer_store_dwordx4/tbuffer_load_format and tbuffer_load_format_zero_pads_missing_channels across formats.
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1516. Missing channels of typed buffer loads read 0 instead of (0, 0, 0, 1). The lowering change is line for line the one in #1516, which merges clean. Either one contradicts main's stated rule (lower.rs:4428) and rewrites the console-vs-PC differential case to fit; it rests on the measurement in issue #1060, so decide it on #1516. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Offline measurement on a retail dump, and the shader tests on AdaResult: no count change against Offline. I merged head 44d9c2d onto No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on Tests: with the same merge, No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
…d-and-dstorage-errors Shaders, HLE: zero-pad missing channels in typed loads and preserve Win32 errors in DirectStorage (Marvisak#1370, Marvisak#1383)
Addresses the missing-channel padding bug in #1060 (orthogonal to #1112 and #169).
Summary
0(out.resize(channels as usize, self.s.m.i32(0))) instead of(0, 0, 0, 1), matching GFX10buffer_load_format_*/tbuffer_load_format_*hardware behavior for 1-, 2-, and 3-channel formats.snorm16x2expectation indiff_testsaccordingly.Verification
valu_tests::tbuffer_load_format_zero_pads_missing_channelscovering 25tbuffer_load_format_{xy,xyz,xyzw}cases acrossUNORM,SNORM,UINT,SINT,USCALED,SSCALED, andFLOAT1/2/3/4-channel formats:dxil.dllvalidation: passedcargo clippy --workspace --all-targets --all-featuresandcargo xtask policy: passed.