mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-08 13:50:20 +00:00
Native OpFConvert and UnpackHalf2x16 round and handle denormals as RDNA does under RoundingModeRTE and DenormPreserve 16, but Vulkan leaves the NaN they return to the driver, so every conversion rebuilds RDNA's NaN with integer selects (about 55 words per f32 to f16 conversion, 29 per f16 to f32). ProbeFloat16Conversions runs when the device is created: v_cvt_f32_f16 over all 65,536 halves and v_cvt_f16_f32, v_cvt_pkrtz_f16_f32 and a round trip over every NaN payload class, signalling NaNs, denormals, ties and overflow, under four float modes, each compiled with the rebuilt NaN and with the native result, inputs read from a buffer. SpirvTarget::float16WidenNans and float16NarrowNans are set per direction only when every result matches; both are in the recompile cache key. APS5_NO_NATIVE_F16_NANS skips the probe. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PHJtpJ4hw3KWJhobipK8ia