summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-06-03 16:12:14 -0700
committerEric Anholt <[email protected]>2019-06-04 23:35:38 +0000
commitfb872748ec63f26213ca2021846c4c3a1c6ab1a8 (patch)
treeadf61a62200243356f3a6ccf6e74ccbc094c23e3 /src/freedreno
parentff63b995310def60ac6a259f8d1c6e46d3c9a5a4 (diff)
freedreno: Improve the pi approximations in trig lowering.
When comparing our sin/cos behavior to the closed source driver, I noticed that we were off by a bit (or, in the case of 1/2pi, 3 bits). Fixes: dEQP-GLES3.functional.shaders.random.trigonometric.vertex.52 dEQP-GLES3.functional.shaders.random.all_features.vertex.0 Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/ir3/ir3_nir_trig.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/freedreno/ir3/ir3_nir_trig.py b/src/freedreno/ir3/ir3_nir_trig.py
index 3968aea543c..7e2d554b0d0 100644
--- a/src/freedreno/ir3/ir3_nir_trig.py
+++ b/src/freedreno/ir3/ir3_nir_trig.py
@@ -26,8 +26,8 @@ import argparse
import sys
trig_workarounds = [
- (('fsin', 'x'), ('fsin', ('fsub', ('fmul', 6.283185, ('ffract', ('fadd', ('fmul', 0.159155, 'x'), 0.5))), 3.141593))),
- (('fcos', 'x'), ('fcos', ('fsub', ('fmul', 6.283185, ('ffract', ('fadd', ('fmul', 0.159155, 'x'), 0.5))), 3.141593))),
+ (('fsin', 'x'), ('fsin', ('fsub', ('fmul', 6.2831853, ('ffract', ('fadd', ('fmul', 0.15915494, 'x'), 0.5))), 3.14159265))),
+ (('fcos', 'x'), ('fcos', ('fsub', ('fmul', 6.2831853, ('ffract', ('fadd', ('fmul', 0.15915494, 'x'), 0.5))), 3.14159265))),
]