shader: lower v_cvt_i32_f64 and v_cvt_u32_f64 in direct compute path #3371
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3371"
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 R0D4X on 2026-11-28T14:53:44Z.
Fixes #3370. Refs #2935.
Summary
v_cvt_i32_f64(0x03/0x183) andv_cvt_u32_f64(0x15/0x195) in the native direct-DXIL compute path (src/gfx1013_direct_compute.inl):v[a:a+1]or evens[a:a+1]) to a saturated 32-bit signed or unsigned integer (truncation toward zero,NaN -> 0, signed saturation to[INT32_MIN, INT32_MAX], unsigned saturation to[0, UINT32_MAX]) using pure 32-bit integer arithmetic, requiring neitherDoublePrecisionFloatShaderOpsnorInt64ShaderOps.abs/negon the binary64 source sign; refusespixel_stage,graphics_input,clamp,omod,op_sel,subword,dpp, unused VOP3 sources/modifiers, and non-pairS0.tests/native_cvt_int_f64_check.py(irCPU evaluation +controls+hardware),tests/cmake/native_int_f64_cvt.cmake, anddocs/experiments/native-cvt-int-f64.md.Verification
7d8ada1e10.0.26300.9974), MSVC19.44.35230, Windows SDK / DXC10.0.26100.0, NVIDIA GeForce RTX 5080 (10de:2c02, driver32.0.16.2140), D3D12 debug layer off.cmake --build --preset dev --target native_compute_ir_dump compile_dxil native_store_replay&release: succeeded.ctest --preset dev --no-tests=error -R '^native_cvt_int_f64_' -V: 3/3 passed (0 skipped); 32 CPU-evaluated IR words + 8 refusals + 2064 hardware readback words matched.ctest --preset release --no-tests=error -R '^native_cvt_int_f64_' -V: 3/3 passed (0 skipped); all 2064 hardware words matched.tests/docs_links_check.py,tests/bidi_controls_check.py,git diff --check: passed.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T19:27:47Z.
Review: APPROVED
GPU review of
7d8ada1e._irtest runs the emitted code on the CPU, so it checks values.mainf2972840with this PR and 17 other open PRs merged locally:native_cvt_int_f64_ir,_controlsand_hardwarepass. Changing the signed bound1054to1055makes_irand_hardwarefail.Not covered: no ±Inf case and no input ≥ 2^32, so removing the u32 saturation would pass; the
lo != 0NaN term (lo = 1,hi = 0x7FF00000) is also untested.Approve.