Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / array-element-increment.html
blob2a3e555472c0bfeed9c94d660b28437c33ddde54
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>GLSL initialized array element increment/decrement 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="fshaderFloatArrayIncrement" type="x-shader/x-fragment">#version 300 es
21 precision mediump float;
23 out vec4 my_FragColor;
25 void main() {
26 float A[2] = float[2](0.0, 1.0);
27 A[0]++;
28 my_FragColor = vec4(1.0 - A[0], A[0], 0.0, 1.0);
30 </script>
31 <script id="fshaderVectorArrayIncrement" type="x-shader/x-fragment">#version 300 es
32 precision mediump float;
34 out vec4 my_FragColor;
36 void main() {
37 vec4 V[2] = vec4[2](vec4(0.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0));
38 V[0][0]++;
39 my_FragColor = vec4(1.0 - V[0][0], V[0][0], 0.0, 1.0);
41 </script>
42 <script id="fshaderVectorElementIncrement" type="x-shader/x-fragment">#version 300 es
43 precision mediump float;
45 out vec4 my_FragColor;
47 void main() {
48 vec4 v = vec4(0.0, 2.0, 3.0, 4.0);
49 v[0]++;
50 my_FragColor = vec4(1.0 - v[0], v[0], 0.0, 1.0);
52 </script>
53 <script id="fshaderFloatArrayDecrement" type="x-shader/x-fragment">#version 300 es
54 precision mediump float;
56 out vec4 my_FragColor;
58 void main() {
59 float A[2] = float[2](2.0, 1.0);
60 A[0]--;
61 my_FragColor = vec4(1.0 - A[0], A[0], 0.0, 1.0);
63 </script>
64 <script id="fshaderVectorArrayDecrement" type="x-shader/x-fragment">#version 300 es
65 precision mediump float;
67 out vec4 my_FragColor;
69 void main() {
70 vec4 V[2] = vec4[2](vec4(2.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0));
71 V[0][0]--;
72 my_FragColor = vec4(1.0 - V[0][0], V[0][0], 0.0, 1.0);
74 </script>
75 <script id="fshaderVectorElementDecrement" type="x-shader/x-fragment">#version 300 es
76 precision mediump float;
78 out vec4 my_FragColor;
80 void main() {
81 vec4 v = vec4(2.0, 2.0, 3.0, 4.0);
82 v[0]--;
83 my_FragColor = vec4(1.0 - v[0], v[0], 0.0, 1.0);
85 </script>
86 <script type="application/javascript">
87 "use strict";
88 description("Incrementing or decrementing elements of arrays with initializers should work.");
90 GLSLConformanceTester.runRenderTests([
92 fShaderId: 'fshaderFloatArrayIncrement',
93 fShaderSuccess: true,
94 linkSuccess: true,
95 passMsg: 'Increment an element of a vector array'
98 fShaderId: 'fshaderVectorArrayIncrement',
99 fShaderSuccess: true,
100 linkSuccess: true,
101 passMsg: 'Increment an element of a vector array'
104 fShaderId: 'fshaderVectorElementIncrement',
105 fShaderSuccess: true,
106 linkSuccess: true,
107 passMsg: 'Increment an element of a vector'
110 fShaderId: 'fshaderFloatArrayDecrement',
111 fShaderSuccess: true,
112 linkSuccess: true,
113 passMsg: 'Decrement an element of a vector array'
116 fShaderId: 'fshaderVectorArrayDecrement',
117 fShaderSuccess: true,
118 linkSuccess: true,
119 passMsg: 'Decrement an element of a vector array'
122 fShaderId: 'fshaderVectorElementDecrement',
123 fShaderSuccess: true,
124 linkSuccess: true,
125 passMsg: 'Decrement an element of a vector'
127 ], 2);
128 </script>
129 </body>
130 </html>