shader: lower single-word constant buffer reads #273
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/277"
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 R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T20:08:52Z.
Change
Lower gfx1013
s_buffer_load_dwordfor reads from the existing four-SGPR constant-buffer binding. The translator validates the descriptor's provenance and readiness, accepts dword-aligned immediate offsets within the 256-byte desktop binding and waits for LGKM completion before scalar consumption. The destination can overwrite a consumed descriptor word, so a subsequent read through that descriptor is rejected.The shared interface is
tools/pixel_aot.py::lower. The scalar ALU work in #257 consumes values from the existing four-word reader. Partial VM waits in #176 and outstanding VGPR destination checks in #273 concern texture samples. This change stays within constant-buffer loads and scalar LGKM readiness.Verification
Commit
a284cb6f3f782c170a73fcf1747c581b354f20faon upstream496fc28aafe3755637ee394b6404044457dfe292.cmake --preset devin the Visual Studio x64 environment with the local venv set asINTAKE_PYTHON, followed bycmake --build --preset dev --target offscreen_check. Passed from a fresh build.ctest --preset dev --no-tests=error -R '^pixel_aot_warp$' --output-on-failureagainst the test-only change. Failed at instruction 17 on the firsts_buffer_load_dword, as reproduced by the standalone Python test.ctest --preset dev --no-tests=error -R '^pixel_aot_(warp|hardware)$' --output-on-failure. Both regression targets passed on WARP 10.0.26100.9818 and RTX 5080 driver 32.0.16.1692. Neither adapter skipped the test. The debug layer was unavailable. The neighboring-word control produced its first mismatch at (0, 0) on both adapters, where green expected 0.625 and got 0.python -B tests/pixel_aot_check.py binary $asm $objcopy $llvm. The Windows LLVM 15.0.7 binaries passed the synthetic envelope and instruction round trip. The local assembler wrapper runsclang -cc1as -triple amdgcn--amdpal -target-cpu gfx1013 -filetype obj <source> -o <object>, with matchingllvm-objcopy.exeandLLVM-C.dll. Ubuntu CI usesllvm-mc-15.python -B tests/docs_links_check.py,ctest --preset dev --no-tests=error -R '^docs_links$' --output-on-failureandgit diff --check. Passed. The link check verified 64 links in 10 files.Evidence and follow-up
The MIT-licensed fixture uses original assembly and the existing synthetic texture and constant buffer. It reads the words at byte offsets 0, 8 and 252 with two sets of values. The CPU reference supplies the readback color. Controls cover the wrong offset, misalignment, resource provenance, an overwritten descriptor, and read or write attempts before the corresponding wait.
Read-only inspection of one archived pixel program identified a word load from a ready descriptor with an aligned immediate offset. That observation motivated the new fixture. The title's execution masks and coordinate dependencies need separate work. Experiment and reproduction commands
Checklist
This contribution was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T20:08:59Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
a284cb6ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.