Cesium crashes in old versions of Chrome and Firefox
See original GitHub issueCesium crashes in browsers with old versions of ANGLE when using D3D9, since Cesium 1.50.
This happens to me on Windows 10 x64, with Chrome 59 after disabling D3D11.
GL_RENDERER: ANGLE (NVIDIA GeForce 940MX Direct3D9Ex vs_3_0 ps_3_0)
GL_VERSION: OpenGL ES 2.0 (ANGLE 2.1.0.a9042d3c1952)
It’s caused by an old ANGLE bug triggered by this line in GroundAtmosphere.glsl:
float fLightAngle = useSunLighting ? dot(czm_sunDirectionWC, v3Pos) / length(v3Pos) : 1.0;
which was added in Cesium 1.50. On my machine, the above line is translated to the HLSL code: (with my comments)
{
bool s6 = _webgl_38a54cf7838b624e; // _webgl_38a54cf7838b624e is useSunLighting
if (s6)
{
(s3 = (dot(_webgl_fa5fcdcb25e91339, _webgl_fa0dc18b0c5cfc1c) / length(_webgl_fa0dc18b0c5cfc1c)));
}
else
{
if ((!s6))
{
(s3 = 1.0);
}
else
{
return (webgl_cd16f13802bc8948)0; // webgl_cd16f13802bc8948 is the AtmosphereColor constructor, notice it's missing a "_" prefix
}
The last else section isn’t even needed but seems to be a workaround to an HLSL error, see this ANGLE commit for more details. This workaround appends a dummy return value, whose type is taken from the current function’s return type. But due to a bug in ANGLE, if the current function’s return type is a custom struct (like AtmosphereColor in our case) then the constructor of the dummy value isn’t prefixed with a “_”, and so it causes an undefined identifier error and a program linking failure. This bug was fixed, but it still affects old versions of Chrome and Firefox.
This seems to be the same issue mentioned in the forum: https://groups.google.com/forum/#!topic/cesium-dev/okbIEFu5Hcw, regarding Firefox.
On my machine I can simply use a newer version of Chrome and that will solve the problem, but I’ve encountered it also on other standalone devices with old chrome versions.
Two possible simple workarounds that have worked for me are:
- Make the
computeGroundAtmosphereFromSpace
function a void type with anAtmosphereColor
out argument. - Instead of using a ternary operator, use
mix()
.
I’ll be glad to open a pull request.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
This issue happend to my customer too. He have for some reasons old version of chrome. The solution that we use to solve it is:
I know that it’s less beautiful, but it works.
Congratulations on closing the issue! I found these Cesium forum links in the comments above:
https://groups.google.com/forum/#!topic/cesium-dev/okbIEFu5Hcw](https
If this issue affects any of these threads, please post a comment like the following: