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 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>
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; }
33 outColor = vec4(
0.0,
0.0,
0.0,
1.0);
34 for (int i =
0; i <
2; ++i) {
35 if (useStruct(s[i])) {
41 <script type=
"application/javascript">
46 // http://crbug.com/
871434
48 GLSLConformanceTester.runTests([
50 fShaderId: 'fShaderTest',
53 passMsg: 'Passing a struct from a dynamically indexed const array into a non-const function parameter should work.',