[Mesa-dev] [PATCH v3 30/44] intel/nir: call nir_opt_constant_folding before brw_nir_apply_trig_workarounds
Samuel Iglesias Gonsálvez
siglesias at igalia.com
Wed Feb 6 10:44:59 UTC 2019
If we have fsin or fcos trigonometric operations with constant values as inputs,
we will multiply the result by 0.99997 in brw_nir_apply_trig_workarounds,
making the result wrong. Running nir_opt_constant_folding before, we will
calculate correctly the result for these trignometric ops.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
src/intel/compiler/brw_nir.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index 1d62f2adde8..e797794bfb8 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -751,8 +751,10 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
/* See also brw_nir_trig_workarounds.py */
if (compiler->precise_trig &&
- !(devinfo->gen >= 10 || devinfo->is_kabylake))
+ !(devinfo->gen >= 10 || devinfo->is_kabylake)) {
+ OPT(nir_opt_constant_folding);
OPT(brw_nir_apply_trig_workarounds);
+ }
static const nir_lower_tex_options tex_options = {
.lower_txp = ~0,
--
2.19.1
More information about the mesa-dev
mailing list