shader: lower buffer_atomic_sub as an add of the negated data (#363) #364
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/364"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:13:35Z.
Refs #363
Shape.
buffer_atomic_subwas refused by name, because DXIL'sAtomicBinOphas no subtraction.Change. In
Lower::bufferit is nowatomicBinOpadd (0) of0 - data, marked by theATOMIC_SUBsentinel. Modulo 2^32 the dword left is the same, and withglcthe value returned is the old one either way. Every other buffer atomic is unchanged.By-output corpus sweep. 12,020 containers from my own boot-to-menus run (Series S), native host options, main
905e7aaagainst this head:Gained:
49b8b58b93edb335,b1454a15c3e09497,dfc4a2c9e8be67ba.Test.
heap_tests::a_buffer_atomic_sub_leaves_the_difference_and_returns_the_old_value(victory-gpu, on Metal with MSC 4.0 beta 3). Lane 0 subtracts 3 from a raw UAV dword withglcand stores the returned value next to it:[7, 10];[0xfffffffe, 1].On main it fails at translation.
Checks.
cargo test -p victory-shader -p victory-hle -p victory -p victory-gpu -p victory-metal -p xtask: 955 passed, 0 failed, 10 ignored.-D warnings: clean.cargo xtask policy: ok.The 64-bit, image and global
_subforms are not covered, because no shader in the corpus uses them.docs/native-host.mdhas a short section on this. @Olima34, for the board.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T16:05:11Z.
Merged in
be7dc1b5with the other shader PRs from tonight. Ran the tests (native arm64), Windows clippy, the policy check and a release build on the merged tree, and swept my full corpus of 21,600 shaders before and after: 0 lost, 352 newly translated, every changed output accounted for. I have not run the game on it yet. Thanks.