mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +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")
This commit is contained in:
parent
49c658972f
commit
82a31a7339
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