shader: keep a NaN input a NaN in the depth-mask v_fract_f32 cap #1246
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1253"
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 tedin7 on 2026-11-24T05:34:14Z.
Change
The depth-mask translator lowered
v_fract_f32_e32asmin(frac(x), asfloat(0x3f7fffffu)). D3Dminreturns its other operand for a NaN, so a NaN input became the finite cap, whilev_fract_f32returns a NaN. It now emits(frac(x) >= 1.0f ? asfloat(0x3f7fffffu) : frac(x)), the cap the pixel translator already uses; a NaN fails the comparison and passes through. Same fix as #1202 and #1223 for other translators; this PR touches onlytools/depth_mask_aot.py, its check and the docs.This change was AI-assisted.
Verification
python3 -B tests/depth_mask_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passes (LLVM 15 is what CI uses; not available locally).fract_nan(new, in the same mode) against the unchanged translator from main: fails on the emitted expression; with the change: passes.python3 -B tests/rdna2_tools_check.py: OK. No Windows or GPU run.Evidence and follow-up
fract_nanlowers the fixture, evaluates the emitted expression with D3D semantics and compares binary32 bits with an independent reference (NaN stays NaN; -2^-30 and -2^-28 give0x3f7fffff). Controls: the previousminform must mismatch on both NaN payloads, and an uncappedfracon both tiny negative inputs. No store or atomic is involved. The draw fixtures are unchanged.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T05:36:53Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
af36254ℹ️ 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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:52:49Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at commit
af36254cacfd9d1583553efd8f548171aa9ff742:cmake --preset dev+cmake --build --preset dev --target offscreen_check+ctest --preset dev -R "^depth_mask_.*_warp$": 3/3 passed (depth_mask_draw_warp,depth_mask_ops_draw_warp,depth_mask_cmpx_draw_warp)cmake --preset release+cmake --build --preset release --target offscreen_check+ctest --preset release -R "^depth_mask_.*_warp$": 3/3 passed (depth_mask_draw_warp,depth_mask_ops_draw_warp,depth_mask_cmpx_draw_warp)