mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
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 <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
parent
2795fbcae3
commit
a6046d217d
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue