mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-06 13:30:00 +00:00
Since #8697 every device with shaderDenormPreserveFloat32 and an independent f32 denormal behaviour gets DenormPreserve 32. RADV on Vega (GCN 5, Mesa 26.0.8) miscompiles the preserving forms of the transcendental ops: its v_log_f32 lowering picks the denormal scale with a v_cndmask_b32 that reads two SGPRs, which GFX9 cannot do, so log2(2.0) is 25.0 in some lanes and agc_driver_log_near_one, vop1_float_unary, fp16_overflow and float16_result_modifiers fail. ProbeFloat32DenormPreserve runs v_log_f32, v_sqrt_f32, v_rsq_f32, v_rcp_f32 and v_exp_f32 on normal values with and without the mode, after the flush probe. The mode only changes denormal handling, but Vulkan does not require these ops to be correctly rounded, so Float32ResultsAgree accepts each of the 256 result pairs when they are no further apart than the width of the interval the Vulkan precision bound allows around the exact result (sqrt's bound inherited from 1.0 / inversesqrt(), an absolute 2^-21 for log2 inputs in [0.5, 2.0]). When one falls outside, float32DenormPreserve stays off and the device keeps its default f32 denormal handling.