nir/lower_double_ops: lower mod()

There are rounding errors with the division in i965 that affect
the mod(x,y) result when x = N * y. Instead of returning '0' it
was returning 'y'.

This lowering pass fixes those cases.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Samuel Iglesias Gonsálvez
2016-04-12 10:55:44 +02:00
parent 9f81434c5f
commit b902377a56
2 changed files with 31 additions and 1 deletions
+2 -1
View File
@@ -2425,7 +2425,8 @@ typedef enum {
nir_lower_dfloor = (1 << 4),
nir_lower_dceil = (1 << 5),
nir_lower_dfract = (1 << 6),
nir_lower_dround_even = (1 << 7)
nir_lower_dround_even = (1 << 7),
nir_lower_dmod = (1 << 8)
} nir_lower_doubles_options;
void nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options);