Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / const-array-init.html
blobc992c03b636bd969c85987a4ac3506056e96a3a8
1 <!--
2 Copyright (c) 2019 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.
5 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
10 <meta charset="utf-8">
11 <title>Constant array initialization test</title>
12 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
13 <script src="../../js/js-test-pre.js"></script>
14 <script src="../../js/webgl-test-utils.js"></script>
15 <script src="../../js/glsl-conformance-test.js"></script>
16 </head>
17 <body>
18 <div id="description"></div>
19 <div id="console"></div>
20 <script id="fshaderGlobalConstArray" type="x-shader/x-fragment">#version 300 es
21 precision mediump float;
22 out vec4 my_FragColor;
24 const vec4 constants[2] = vec4[] (
25 vec4(0.6, 0.3, 0.0, 3.0),
26 vec4(-0.6, 0.7, 0.0, -2.0)
29 void main()
31 my_FragColor = constants[0] + constants[1];
32 return;
34 </script>
35 <script id="fshaderGlobalConstArrayWithReferenceToConstArray" type="x-shader/x-fragment">#version 300 es
36 precision mediump float;
37 out vec4 my_FragColor;
39 const vec4 constants[2] = vec4[] (
40 vec4(0.6, 0.3, 0.0, 3.0),
41 vec4(-0.6, 0.7, 0.0, -2.0)
44 const vec4 constants2[2] = vec4[] (
45 constants[1],
46 constants[0]
49 void main()
51 my_FragColor = constants2[0] + constants2[1];
52 return;
54 </script>
55 <script id="fshaderGlobalConstArrayInitializedToConstArray" type="x-shader/x-fragment">#version 300 es
56 precision mediump float;
57 out vec4 my_FragColor;
59 const vec4 constants[2] = vec4[] (
60 vec4(0.6, 0.3, 0.0, 3.0),
61 vec4(-0.6, 0.7, 0.0, -2.0)
64 const vec4 constants2[2] = constants;
66 void main()
68 my_FragColor = constants2[0] + constants2[1];
69 return;
71 </script>
72 <script type="text/javascript">
73 "use strict";
74 description("Test initializing a constant global array");
76 GLSLConformanceTester.runRenderTests([
78 fShaderId: 'fshaderGlobalConstArray',
79 fShaderSuccess: true,
80 linkSuccess: true,
81 passMsg: "Global constant array with vec4 constructors and literals in the initializer"
84 fShaderId: 'fshaderGlobalConstArrayWithReferenceToConstArray',
85 fShaderSuccess: true,
86 linkSuccess: true,
87 passMsg: "Global constant array which indexes another global constant array in the initializer"
90 fShaderId: 'fshaderGlobalConstArrayInitializedToConstArray',
91 fShaderSuccess: true,
92 linkSuccess: true,
93 passMsg: "Global constant array initialized to another global constant array"
95 ], 2);
96 </script>
97 </body>
98 </html>