shader: lower native pixel raw buffer atomic add #3217
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3217"
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 xiaoqi72665 on 2026-11-27T22:12:46Z.
# Scope
Refs #3216, #3212, #3215, #3074, #3198. #3215 has merged as
0b17c52. Rebased only the independent atomic commit onto main4b0350e(77cc88a; range-diff identical). Follow-upf06fb39adds WQM+GLC tests and documentation.Reuse existing raw DWORD buffer atomic lowering and the raw pixel UAV runtime binding. Guard side effects with exact pixel coverage, proven EXEC and view size. GLC uses an SSA phi for old value, preserves inactive VGPRs and returns zero for active out-of-view access. Without GLC the original addend is untouched. Only proven straight-line guest blocks (including flattened mask regions); no general CFG, indexed atomics, other operations or unproven WQM. Single raw pixel UAV, direct non-indexed draw without SRVs.
Verification
Before: synthetic native raw pixel Atomic Add with and without GLC refused as graphics buffer atomic; ordinary raw store compiled.
After: native request -> offline cache -> PSO -> Draw -> GPU readback. RX 7900 XT (32.0.32029.2010) and WARP (1.0.22.0), app-local Agility 1.620.2.
4b0350e, Debug and Release: 17/17 selected CTest per build (34/34, no skips/failures).Reproduce: cmake --build --preset dev --target startup_stream_consumer compile_dxil; ctest --preset dev --no-tests=error -j1 -R "^native_pixel_atomic_(warp|hardware)$" -V. Repeat release. Supported scope and reproduction are also in docs/experiments.md.
AI-assisted; Buhe.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T22:57:58Z.
Review: COMMENTED
With #3215 on
main, I applied only this draft's atomic commit2ed64102over4b0350ea. That applies cleanly (trial tree76ea0130) although the existing stacked branch still shows a conflict because it carries the pre-squash parent. Applying only the child when you rebase preserves the already merged raw-store changes.Built
startup_stream_consumer d3d12_xs_shim compile_dxil native_raw_buffer_view_check native_store_replay offscreen_check. In Debug and Release /O2 the pixel atomic, raw pixel UAV, existing pixel UAV, device-free raw view, indexed atomic, and adjacent image atomic hardware selections passed 10/10 per configuration, no capability skips. The atomic fixture passed 11 actual draws and four compiler refusals on each of WARP 10.0.26100.9818 and RTX 4060 Laptop (32.0.16.1656) per build on Windows 11 26200.9974. It checks contended old-value multisets, no-return, sparse and empty EXEC, out-of-view and the odd-edge post-WQM helper-read case. The pixel fixture enabled the debug layer and reported no errors. These are source-built results on the isolated integration. Please rebase the draft ontomainand include a short reproducible scope note when marking it ready.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T23:16:10Z.
Review: APPROVED
Independently reviewed
f06fb399integrated over currentmain2e12dd8e(clean trial tree55002fb5). The rebase keeps the already-merged #3215 binding. The final revision adds the WQM+GLC return and out-of-view controls plus a reproducible scope note. I traced the explicit coverage/EXEC predicate before the atomic side effect and the GLC merge of the returned value, zero for active OOB, and preserved inactive value.Built
startup_stream_consumer d3d12_xs_shim compile_dxil native_raw_buffer_view_check native_store_replay offscreen_check, then ranctest --test-dir <build> --no-tests=error -j1 -V -R '^(native_(pixel_(atomic|raw_uav)_(warp|hardware)|raw_buffer_view_controls|.*atomic.*_hardware)|startup_(pixel_uav|stream_draw)_(warp|hardware))$'. Debug and Release /O2 each passed 12/12, no skips. On WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656, each configuration passed 13 actual atomic draws and four refusal controls per adapter. The two new WQM+GLC cases matched all 64 DWORDs and 32 pixels per draw, including odd-edge coverage and OOB. D3D12 debug layer enabled, Windows 11 26200.9974. The docs check and hosted Windows passed.