2 Copyright (c) 2021 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
10 <meta charset=
"utf-8">
11 <title>Shader identified as containing reciprocal square root of sum of squares should not crash
</title>
12 <link rel=
"stylesheet" href=
"../../resources/js-test-style.css"/>
13 <link rel=
"stylesheet" href=
"../../resources/glsl-feature-tests.css"/>
14 <script src=
"../../js/js-test-pre.js"></script>
15 <script src=
"../../js/webgl-test-utils.js"></script>
16 <script src=
"../../js/glsl-conformance-test.js"></script>
19 <div id=
"description"></div>
20 <div id=
"console"></div>
21 <script id=
"vshader" type=
"x-shader/x-vertex">#version
300 es
23 gl_Position = vec4(
0.0,
0.0,
0.0,
0.0);
26 <script id=
"fshader" type=
"x-shader/x-fragment">#version
300 es
27 precision highp float;
31 out vec4 fragmentColor;
34 vec2 p = gl_FragCoord.xy;
35 // This expression meets the requirement of being the reciprocal
36 // square root of a sum of squares.
37 float d =
1.0 / length(p);
44 fragmentColor = vec4(d);
47 <script type=
"application/javascript">
50 debug('Regression test for
<a href=
"https://crbug.com/1079309">crbug.com/
1079309</a>');
51 const wtu = WebGLTestUtils;
54 vShaderSource: wtu.getScript('vshader'),
55 fShaderSource: wtu.getScript('fshader'),
59 passMsg: 'Shader containing expression that driver recognizes as reciprocal square root of sum of squares should compile and link'
63 GLSLConformanceTester.runTests(tests,
2);