Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / const-struct-from-array-as-function-parameter.html
blobe67e0e0dd540303516a75f1cdbc8fb2031cfb6c0
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 passing struct from a const array into a function parameter bug</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="fShaderTest" type="x-shader/x-fragment">#version 300 es
22 precision highp float;
23 struct S { float member; };
25 const S s[2] = S[]( S(1.), S(2.));
27 bool useStruct( S s) { return s.member > 0.0; }
29 out vec4 outColor;
31 void main( void )
33 outColor = vec4(0.0, 0.0, 0.0, 1.0);
34 for (int i = 0; i < 2; ++i) {
35 if (useStruct(s[i])) {
36 outColor.g++;
40 </script>
41 <script type="application/javascript">
42 "use strict";
43 description();
45 // Covers bug:
46 // http://crbug.com/871434
48 GLSLConformanceTester.runTests([
50 fShaderId: 'fShaderTest',
51 fShaderSuccess: true,
52 linkSuccess: true,
53 passMsg: 'Passing a struct from a dynamically indexed const array into a non-const function parameter should work.',
54 render: true
56 ], 2);
57 </script>
58 </body>
59 </html>