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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user