OSDN Git Service

spirv: Use a simpler and more correct implementaiton of tanh()
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 9 Dec 2016 17:34:50 +0000 (09:34 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 15 Dec 2016 16:46:28 +0000 (16:46 +0000)
commitfb9f0a1197e10f9b1c727b5b2956f36827308ad1
treed2d27d5e8ed04b9be2ae7d0062e45a229ebaf140
parent41c688a6c31ac5b985a3318e082f78103f061977
spirv: Use a simpler and more correct implementaiton of tanh()

The new implementation is more correct because it clamps the incoming value
to 10 to avoid floating-point overflow.  It also uses a much reduced
version of the formula which only requires 1 exp() rather than 2.  This
fixes all of the dEQP-VK.glsl.builtin.precision.tanh.* tests.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "13.0" <mesa-dev@lists.freedesktop.org>
(cherry picked from commit da1c49171d0df185545cfbbd600e287f7c6160fa)
src/compiler/spirv/vtn_glsl450.c