shader: lower scalar-offset returning compute atomic adds #2382

Manually merged
github merged 1 commit from gh-pr/2382/head into gh-pr/2382/base 2026-11-27 00:46:59 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-25 14:34 UTC · original
R0Y00:codex/compute-atomic-soffset → main · +101 −13 · 3 files · 1 commits · merged 2026-11-25 14:47 UTC

Refs #1723, #1412. Extends the startup compute path in #2331.

Translate a returning 32-bit buffer atomic add addressed by a scalar byte offset with no vector address. Preserve the old value in the destination VGPR. The source-built programs exercise register offsets 0 and 32, add instruction immediates 0 and 4, and write the observed old value to a separate word. Both positive cases compare 320 words per adapter. Dropping the register offset, immediate, return value or observer store produces a mismatch.

Windows 11 26200.9974, x64 MSVC Release, commit 4a8b0439. The portable check and both D3D12 dispatch tests (hardware and WARP) passed, 3/3 with zero skips.

cmake --build --preset release --target offscreen_check
ctest --preset release --no-tests=error -j 1 -R '^startup_compute_buffer_atomics(_warp|_hardware)?$' -V

This change covers one instruction form through a fixed-table UAV. Dynamic descriptor-heap loads and complete application producer bindings remain separate work.

**@⁠R0Y00** on GitHub · 2026-11-25 14:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2382) `R0Y00:codex/compute-atomic-soffset` → `main` · +101 −13 · 3 files · 1 commits · merged 2026-11-25 14:47 UTC Refs #1723, #1412. Extends the startup compute path in #2331. Translate a returning 32-bit buffer atomic add addressed by a scalar byte offset with no vector address. Preserve the old value in the destination VGPR. The source-built programs exercise register offsets 0 and 32, add instruction immediates 0 and 4, and write the observed old value to a separate word. Both positive cases compare 320 words per adapter. Dropping the register offset, immediate, return value or observer store produces a mismatch. Windows 11 26200.9974, x64 MSVC Release, commit 4a8b0439. The portable check and both D3D12 dispatch tests (hardware and WARP) passed, 3/3 with zero skips. ```powershell cmake --build --preset release --target offscreen_check ctest --preset release --no-tests=error -j 1 -R '^startup_compute_buffer_atomics(_warp|_hardware)?$' -V ``` This change covers one instruction form through a fixed-table UAV. Dynamic descriptor-heap loads and complete application producer bindings remain separate work.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:46:58 +00:00
github manually merged commit 4a8b0439e9 into gh-pr/2382/base 2026-11-27 00:46:59 +00:00
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 14:46 UTC · original

I ran tests/startup_compute_buffer_atomics_check.py --dispatch <dxc> <offscreen_check> hardware on 4a8b0439 with the Intel UHD 770 selected (8086:a780, driver 32.0.101.5973). Both scalar-offset programs dispatched two groups and compared all 320 words with zero mismatches. The four new controls first differed at word 1 (dropped scalar offset), 0 (dropped immediate), 16 (dropped GLC return), and 16 (dropped observer store). At word 16 the latter two produced 00000006 and c5c5c5c5 respectively, against c5c5c5c4. The local debug layer was unavailable.

The portable controls passed with and without LLVM 15.0.7's clang -cc1as -triple amdgcn-amd-amdhsa -target-cpu gfx1013 -filetype asm -show-encoding as the --llvm-mc encoding provider.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 14:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2382#issuecomment-7165782144) I ran `tests/startup_compute_buffer_atomics_check.py --dispatch <dxc> <offscreen_check> hardware` on `4a8b0439` with the Intel UHD 770 selected (8086:a780, driver 32.0.101.5973). Both scalar-offset programs dispatched two groups and compared all 320 words with zero mismatches. The four new controls first differed at word 1 (dropped scalar offset), 0 (dropped immediate), 16 (dropped GLC return), and 16 (dropped observer store). At word 16 the latter two produced `00000006` and `c5c5c5c5` respectively, against `c5c5c5c4`. The local debug layer was unavailable. The portable controls passed with and without LLVM 15.0.7's `clang -cc1as -triple amdgcn-amd-amdhsa -target-cpu gfx1013 -filetype asm -show-encoding` as the `--llvm-mc` encoding provider.
This discussion has been locked. Commenting is limited to contributors.
No description provided.