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.
10 <meta charset=
"utf-8">
11 <title>GLSL array equality 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>
18 <div id=
"description"></div>
19 <div id=
"console"></div>
20 <script id=
"fshaderSimple" type=
"x-shader/x-fragment">#version
300 es
21 precision mediump float;
23 out vec4 my_FragColor;
26 // This simple test uses the ESSL1 style array initialization in order
27 // to be able to test array equality independently of array constructors.
31 for (int i =
0; i <
3; ++i) {
36 bool success = (a == b) && (a != c);
37 my_FragColor = vec4(
0.0, (success ?
1.0 :
0.0),
0.0,
1.0);
40 <script id=
"fshaderArrayOfStructs" type=
"x-shader/x-fragment">#version
300 es
41 precision mediump float;
43 out vec4 my_FragColor;
50 // This simple test uses the ESSL1 style array initialization in order
51 // to be able to test array equality independently of array constructors.
55 for (int i =
0; i <
3; ++i) {
60 bool success = (a == b) && (a != c);
61 my_FragColor = vec4(
0.0, (success ?
1.0 :
0.0),
0.0,
1.0);
64 <script id=
"simple-float-array-fs" type=
"x-shader/x-fragment">#version
300 es
65 precision mediump float;
73 fragColor = vec4(
0.0,
0.0,
0.0,
1.0);
80 <script id=
"simple-vec-array-fs" type=
"x-shader/x-fragment">#version
300 es
81 precision mediump float;
89 fragColor = vec4(
0.0,
0.0,
0.0,
1.0);
96 <script id=
"simple-mat-array-fs" type=
"x-shader/x-fragment">#version
300 es
97 precision mediump float;
105 fragColor = vec4(
0.0,
0.0,
0.0,
1.0);
112 <script type=
"application/javascript">
114 description(
"Comparing arrays should work.");
116 GLSLConformanceTester.runRenderTests([
118 fShaderId: 'fshaderSimple',
119 fShaderSuccess: true,
121 passMsg: 'Arrays of integers'
124 fShaderId: 'fshaderArrayOfStructs',
125 fShaderSuccess: true,
127 passMsg: 'Arrays of structs'
130 fShaderId:
"simple-float-array-fs",
131 fShaderSuccess: true,
134 passMsg:
"Simple float array with default values",
137 fShaderId:
"simple-float-array-fs",
138 fShaderSuccess: true,
141 renderColor: [
0,
0,
0,
255],
143 { name: 'a', functionName: 'uniform1fv', value: [
1,
2,
3]},
144 { name: 'b', functionName: 'uniform1fv', value: [
1,
2,
4]},
146 passMsg:
"Simple float array with different values",
149 fShaderId:
"simple-float-array-fs",
150 fShaderSuccess: true,
154 { name: 'a', functionName: 'uniform1fv', value: [
1,
2,
3]},
155 { name: 'b', functionName: 'uniform1fv', value: [
1,
2,
3]},
157 passMsg:
"Simple float array with same values",
160 fShaderId:
"simple-vec-array-fs",
161 fShaderSuccess: true,
164 passMsg:
"Simple vec array with default values",
167 fShaderId:
"simple-vec-array-fs",
168 fShaderSuccess: true,
171 renderColor: [
0,
0,
0,
255],
173 { name: 'a', functionName: 'uniform3fv', value: [
1,
2,
3,
4,
5,
6,
7,
8,
9]},
174 { name: 'b', functionName: 'uniform3fv', value: [
1,
2,
3,
4,
5,
6,
7,
8,
10]},
176 passMsg:
"Simple vec array with different values",
179 fShaderId:
"simple-vec-array-fs",
180 fShaderSuccess: true,
184 { name: 'a', functionName: 'uniform3fv', value: [
1,
2,
3,
4,
5,
6,
7,
8,
9]},
185 { name: 'b', functionName: 'uniform3fv', value: [
1,
2,
3,
4,
5,
6,
7,
8,
9]},
187 passMsg:
"Simple vec array with same values",
190 //
"simple-mat-array-fs"
191 fShaderId:
"simple-mat-array-fs",
192 fShaderSuccess: true,
195 passMsg:
"Simple mat array with default values",
198 fShaderId:
"simple-mat-array-fs",
199 fShaderSuccess: true,
202 renderColor: [
0,
0,
0,
255],
204 { name: 'a', functionName: 'uniformMatrix3fv', value: [
205 11,
12,
13,
14,
15,
16,
17,
18,
19,
206 21,
22,
23,
24,
25,
26,
27,
28,
29,
207 31,
32,
33,
34,
35,
36,
37,
38,
39,
209 { name: 'b', functionName: 'uniformMatrix3fv', value: [
210 11,
12,
13,
14,
15,
16,
17,
18,
19,
211 21,
22,
23,
24,
25,
26,
27,
28,
29,
212 31,
32,
33,
34,
35,
36,
37,
30,
39,
215 passMsg:
"Simple vec array with different values",
218 fShaderId:
"simple-mat-array-fs",
219 fShaderSuccess: true,
223 { name: 'a', functionName: 'uniformMatrix3fv', value: [
224 11,
12,
13,
14,
15,
16,
17,
18,
19,
225 21,
22,
23,
24,
25,
26,
27,
28,
29,
226 31,
32,
33,
34,
35,
36,
37,
38,
39,
228 { name: 'b', functionName: 'uniformMatrix3fv', value: [
229 11,
12,
13,
14,
15,
16,
17,
18,
19,
230 21,
22,
23,
24,
25,
26,
27,
28,
29,
231 31,
32,
33,
34,
35,
36,
37,
38,
39,
234 passMsg:
"Simple vec array with same values",