mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-10 01:18:18 +02:00
nir/lower_alu: fix lower_fminmax_signed_zero for denorms
When both inputs are denorms, the bcsel picks the integer min/max result,
which does not flush denorms and therefore might return the wrong result.
Fixes OpenCL fmin/fmax on asahi.
Fixes: d238d766c6 ("nir: add lower_fminmax_signed_zero")
Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
This commit is contained in:
parent
641d9f35ae
commit
d25e7e330f
1 changed files with 1 additions and 0 deletions
|
|
@ -213,6 +213,7 @@ lower_alu_instr(nir_builder *b, nir_alu_instr *instr, UNUSED void *cb_data)
|
|||
/* Fallback on the emulation */
|
||||
if (!lowered) {
|
||||
nir_def *iminmax = max ? nir_imax(b, s0, s1) : nir_imin(b, s0, s1);
|
||||
iminmax = nir_fcanonicalize(b, iminmax);
|
||||
lowered = nir_bcsel(b, nir_feq(b, s0, s1), iminmax, fminmax);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue