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 constructor assignment 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=
"fshaderNonConstantConstructorParameter" type=
"x-shader/x-fragment">#version
300 es
21 precision mediump float;
24 out vec4 my_FragColor;
27 // Test assigning a constructor result as opposed to initializing with a
28 // constructor result.
32 for (int i =
0; i <
2; ++i) {
40 my_FragColor = vec4(
0.0, (fail ?
0.0 :
1.0),
0.0,
1.0);
43 <script id=
"fshaderArrayOfStructs" type=
"x-shader/x-fragment">#version
300 es
44 precision mediump float;
46 out vec4 my_FragColor;
53 // Test assigning a constructor result as opposed to initializing with a
54 // constructor result.
56 a = S[
3](S(
0), S(
1), S(
2));
58 for (int i =
0; i <
3; ++i) {
63 my_FragColor = vec4(
0.0, (fail ?
0.0 :
1.0),
0.0,
1.0);
66 <script type=
"application/javascript">
68 description(
"Assigning return values of array constructors should work.");
71 // This test only covers cases which are not covered by the dEQP tests.
73 GLSLConformanceTester.runRenderTests([
75 fShaderId: 'fshaderNonConstantConstructorParameter',
78 passMsg: 'Assigning a constructor result',
79 uniforms: [{name:
"u", functionName:
"uniform1i", value:
5}]
82 fShaderId: 'fshaderArrayOfStructs',
85 passMsg: 'Assigning an array of structs'