nir/spirv/glsl450: increase asin(x) precision
authorArcady Goldmints-Orlov <agoldmints@igalia.com>
Wed, 15 Apr 2020 21:55:53 +0000 (16:55 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Jun 2020 07:10:17 +0000 (07:10 +0000)
commitb38d3cdceab07803a7dd81f8870a892fd82a077c
treedd8067113dd9569263723bb785f0654e33971da4
parent008b0d1701a143df4a7e01f6c56d9ed66f68166c
nir/spirv/glsl450: increase asin(x) precision

asin(x) is now implemented using a piecewise approximation, which
improves the precision for |x| < 0.5
Previously, we were using a polynomial approximation for both the
asin() and acos() functions. Unfortunately, for asin(), this polynomial
does not have enough precision to satisfy the Vulkan CTS requiremenents,
which define the asin() precision based on the precision of
atan2(x, sqrt(1.0 - x*x)). The piecewise approximation gives the needed
precision in the problematic range.

v2: Skip the piecewise approximation for acos

Closes: #1843
Acked-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3809>
.gitlab-ci/deqp-radv-fiji-aco-fails.txt
.gitlab-ci/deqp-radv-navi10-aco-fails.txt
.gitlab-ci/deqp-radv-pitcairn-aco-fails.txt
.gitlab-ci/deqp-radv-polaris10-aco-fails.txt
.gitlab-ci/deqp-radv-raven-aco-fails.txt
.gitlab-ci/deqp-radv-vega10-aco-fails.txt
src/compiler/spirv/vtn_glsl450.c