summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-03-02 23:50:04 -0800
committerKenneth Graunke <[email protected]>2016-03-03 21:31:22 -0800
commita6046d217d14130a46f6ffe42992fd745551a928 (patch)
tree0c58db5ec1f9bfd2c99ebc10e27afb9ec6537f5e /src/compiler
parent2795fbcae302cd8821b23821ebf8a2b256ff10d5 (diff)
glsl: Improve the accuracy of the acos() approximation.
The adjusted polynomial coefficients come from the numerical minimization of the L2 norm of the relative error. The old coefficients would give a maximum relative error of about 15000 ULP in the neighborhood around acos(x) = 0, the new ones give a relative error bounded by less than 2000 ULP in the same neighborhood. Fixes four dEQP subtests: dEQP-GLES31.functional.shaders.builtin_functions.precision.acos. highp_compute.{scalar,vec2,vec3,vec4} Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 0d289c1615c..10fb21b9a0d 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -3262,7 +3262,7 @@ builtin_builder::_acos(const glsl_type *type)
ir_variable *x = in_var(type, "x");
MAKE_SIG(type, always_available, 1, x);
- body.emit(ret(sub(imm(M_PI_2f), asin_expr(x, 0.086566724f, -0.03102955f))));
+ body.emit(ret(sub(imm(M_PI_2f), asin_expr(x, 0.08132463f, -0.02363318f))));
return sig;
}