Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / compare-structs-containing-arrays.html
blob4748ae515395fa82f0edf0023e2ccaec921844ea
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 array equality test with structs containing arrays</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 <!--
21 Structure array comparisons are detailed in the ESSL 3.00 spec section 5.7
22 -->
23 <script id="fshader-same-struct" type="x-shader/x-fragment">#version 300 es
24 precision mediump float;
25 out vec4 color;
27 struct MyStruct {
28 bool a[2];
31 void main() {
32 MyStruct b;
33 b.a[0] = true;
34 b.a[1] = false;
36 MyStruct c;
37 c.a[0] = true;
38 c.a[1] = false;
40 color = b == c ? vec4(0, 1.0, 0, 1.0) : vec4(1.0, 0, 0, 1.0);
42 </script>
43 <script id="fshader-different-struct" type="x-shader/x-fragment">#version 300 es
44 precision mediump float;
45 out vec4 color;
47 struct MyStruct {
48 bool a[2];
51 void main() {
52 MyStruct b;
53 b.a[0] = true;
54 b.a[1] = true;
56 MyStruct c;
57 c.a[0] = true;
58 c.a[1] = false;
60 color = b != c ? vec4(0, 1.0, 0, 1.0) : vec4(1.0, 0, 0, 1.0);
62 </script>
63 <script type="application/javascript">
64 "use strict";
65 description("Comparing structs containing arrays should work.");
66 debug("");
68 GLSLConformanceTester.runRenderTests([
70 fShaderId: 'fshader-same-struct',
71 fShaderSuccess: true,
72 linkSuccess: true,
73 passMsg: 'Comparing two structs containing arrays with the same values should equal to each other'
76 fShaderId: 'fshader-different-struct',
77 fShaderSuccess: true,
78 linkSuccess: true,
79 passMsg: 'Comparing two structs containing arrays with different values should not equal to each other'
81 ], 2);
83 </script>
84 </body>
85 </html>