New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 795269 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Compat



Sign in to add a comment

GLSL bug (Angle): tanh(88) = 0, tanh(>=88) = NaN

Reported by fabrice....@gmail.com, Dec 15 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Example URL:
https://www.shadertoy.com/view/XtlBWj

Steps to reproduce the problem:
see url. On windows angle,
tanh(v) for v = 87; 88 or more, with v not const.
( Note that const would give the right result = 1. )

What is the expected behavior?
tanh(v) = 1 for v > 8 down to an error less than floating point precision.

What went wrong?
tanh = NaN for values >= 88
tanh = 0 for 87

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? No
 firefox

Chrome version: 62.0.3202.94  Channel: n/a
OS Version: 10
Flash Version: Shockwave Flash 27.0 r0

may somebody please add the tags  
Blink>WebGL , Internals>GPU ?   thanks !

ok on linux and windows+OpenGL. 
wrong on windows angles.

the error consist in compiling tanh as sinh/cosh , which leads to inf/inf instead of 1 for "large" numbers (100 is "large"). openGl does the simple test: abs(x)>= 8 (or 15 for doubles)  -> return sign(x) instead. Angle or hlsl doesn't.
 
Labels: Needs-Milestone
Components: Blink>WebGL

Comment 3 by kbr@chromium.org, Dec 18 2017

Cc: oetu...@nvidia.com
Components: Internals>GPU>ANGLE
Labels: -Pri-2 Pri-3
Not sure whether this is an issue in ANGLE's constant folding or in the underlying HLSL compiler.

Comment 4 by oetu...@nvidia.com, Dec 19 2017

Owner: oetu...@nvidia.com
Status: Started (was: Unconfirmed)
ANGLE is currently using HLSL's native tanh() function to implement tanh. Using emulation instead would cost some performance, but I think it would be reasonable to add it in this case. That way GL and D3D would behave consistently. We might also pass a few more dEQP tests that are currently failing:

dEQP-GLES3.functional.shaders.builtin_functions.precision.tanh*

Comment 6 by oetu...@nvidia.com, Dec 29 2017

Status: Fixed (was: Started)
Works on current Chrome Canary.

Sign in to add a comment