d3d12: stop using the deprecated fetch_update for the doubles host state #654
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/654"
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 brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-02T14:31:46Z.
Summary
Rust 1.99 deprecates
AtomicU8::fetch_update, so Clippy with-D warningsfails atruntime/d3d12/src/device/shader_cache/native_doubles.rs:27. This also failscheck --no-gpuon current main.The replacement,
try_update, is newer than our Rust 1.95 minimum, and#[allow(deprecated)]would only hide the warning.note_hostnow runs the same compare-exchange loop by hand (compare_exchange_weak, AcqRel/Acquire), applyingjoined()to the current value until the exchange succeeds. The state it settles on is unchanged.Tested
No behavior changes, so no new test.
joined()holds the logic and already has tests insrc/tests/device/shader_cache/native_doubles.rs. The loop itself is mechanical. This is not a shader-translation or GPU path change, so I ran no GPU checks.GPU, driver and backend: none, CPU-only checks.
Commands run and their results:
I cross-built the crate's test binary with
cargo xwin test -p tuxbox-d3d12 --lib --no-run --target x86_64-pc-windows-msvcand ran it under Wine in a throwaway prefix.native_doublespasses: 2 passed, 0 failed.