Shaders: s_atc_probe's immediate is not a register #1021
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1021"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by CaravelaLabs on 2026-11-24T15:08:04Z.
s_atc_probeands_atc_probe_bufferwere decoded as ordinary scalar loads, so the 7-bit immediate became a register and the buffer resource was 2 dwords instead of 4.On main
ffe310e,llvm-mc -arch=amdgcn -mcpu=gfx1030reads0xF4981FF4 0x0A000001ass_atc_probe 0x7f, s[104:105], s5 offset:0x1. The printer produceds_atc_probe exec_hi, s[104:105], s5 offset:0x000001.s_atc_probe_buffer 7, s[8:11], 0x20was printed withs[8:9].LLVM's probe form takes an immediate in that field, a 2-dword address or a 4-dword buffer resource, and no GLC/DLC operand (those bits are ignored). Translation still rejects these two opcodes, so this is the disassembly and the decoded fields, not a miscompiled shader. Ordinary
s_load/s_buffer_loadtext is unchanged.The new test fails on main (
s7where the immediate is7) and passes with this change. Shader library tests: 97 passed, 0 failed, 1 ignored. Windows clippy-D warningson the workspace, with and without--all-features, is clean.AI-assisted; tests run on this machine.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:40:18Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
3d71ad1:cargo test -p victory-shaderpasses, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T16:29:01Z.
Review: APPROVED
s_atc_probe/s_atc_probe_buffer decoding fix: SDATA is a 7-bit immediate (not an SGPR), buffer form resource is 4 dwords, GLC/DLC are not operands. Cases verified against llvm-mc disassembly per the comment; sp3 printer renders the immediate. Decode + print tests run on macOS. 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) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. victory-shader: 97 passed, 0 failed.