Lower gfx1013 add, mul, sqrt, rsq, floor and fract in pixel shader translation #120
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/121"
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 PrivacyOnion on 2026-11-21T16:36:26Z.
Change
Extends
tools/pixel_aot.pyto lowerv_add_f32,v_mul_f32,v_sqrt_f32,v_rsq_f32,v_floor_f32andv_fract_f32(_e32and_e64, including optionalclamp) intoprecise floatHLSL expressions (+,*,sqrt,rsqrt,floor,frac).tests/pixel_aot_check.pyadds ashaping()program andshaping_case()CPU reference that exercise all six new instructions with bound constant buffer parameters across the 8x8 UNORM ramp, checks LLVM 15exp mrt0comma formatting and arity rejection controls, includesshaping()in thegfx1013binary round-trip check, and verifies D3D12 readback and constant corruption rejection on both hardware and WARP.Verification
Built and verified at
734d09bon Windows 11 with VS Build Tools 2022 17.14 (MSVC 19.44.35228.0), Windows SDK10.0.26100.0, Python3.12, onNVIDIA GeForce RTX 5070(vendor=10de device=2f04, driver32.0.16.1664,debug_layer=enabled) andMicrosoft Basic Render Driver(WARP,vendor=1414 device=008c, driver10.0.26100.9818,debug_layer=enabled):pixel_aot_hardware: passed (pixels=4096 channels=16384 max_absolute_error=0across all 6 draws,debug_errors=0 debug_warnings=0, negative controls rejected).pixel_aot_warp: passed (pixels=4096 channels=16384 max_absolute_error=0across all 6 draws,debug_errors=0 debug_warnings=0, negative controls rejected).Evidence and follow-up
All test inputs are synthetic
gfx1013assembly programs and CPU-computed binary16 round-toward-zero reference cases generated at test time.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:18:27Z.
The six-instruction fixture looks good. GitHub now reports conflicts with main. Please keep the current select, absolute and dual-texture controls when reconciling pixel_aot_check.py and run the assembled and rendered fixtures. #144 can follow this PR.
Imported from R0Y00/Xbox2Windows. Originally posted by PrivacyOnion on 2026-11-21T17:39:53Z.
Rebased onto
main, keeping theselect,absolute_value, anddual_program(forward,reverse,reuse, swapped bindings, and swapped weights) controls alongsideshapingandshaping_case. Verifiedpixel_aot_hardwareandpixel_aot_warp: