glsl/float64: Fix fmax with NaNs

We have to invert the condition to select the non-NaN source, instead of
just swapping a and b. The equivalent float32 function was failing
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.denorm_nmax_nan_preserve_frag
without this fix.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37608>
This commit is contained in:
Connor Abbott
2025-09-27 00:14:16 -04:00
committed by Marge Bot
parent 8c16d7f18a
commit 9e477555c5
+1 -1
View File
@@ -1733,7 +1733,7 @@ __fmax64(uint64_t a, uint64_t b)
bool a_lt_b = __flt64_nonnan_minmax(a, b);
bool a_nan = __is_nan(a);
return (b_nan || a_lt_b) && !a_nan ? b : a;
return (!b_nan && a_lt_b) || a_nan ? b : a;
}
uint64_t