Backed out changeset 8fc3326bce7f (bug 1943032) for causing failures at browser_tab_g...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / sampler-array-indexing.html
blobf2f124873bd5eba3fdc61ec6968f2b5af6372e3c
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>ESSL300 sampler array indexing rules</title>
12 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
13 <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
14 <script src="../../js/js-test-pre.js"></script>
15 <script src="../../js/webgl-test-utils.js"></script>
16 <script src="../../js/glsl-conformance-test.js"></script>
17 </head>
18 <body>
19 <div id="description"></div>
20 <div id="console"></div>
21 <script id="vs" type="text/plain">#version 300 es
22 void main() {}
23 </script>
24 <script id="fs_constant_integer_expression" type="text/plain">#version 300 es
25 precision mediump float;
26 uniform sampler2D u_tex[2];
28 void main()
30 texture(u_tex[0], vec2(0));
31 texture(u_tex[1], vec2(0));
33 </script>
34 <script id="fs_constant_index_expression" type="text/plain">#version 300 es
35 precision mediump float;
36 uniform sampler2D u_tex[2];
38 void main()
40 for (int i = 0; i < 2; i++) {
41 texture(u_tex[i], vec2(0));
44 </script>
45 <script id="fs_constant_integer_expression_switch" type="text/plain">#version 300 es
46 precision mediump float;
47 uniform sampler2D u_tex[2];
49 void main()
51 for (int i = 0; i < 2; i++) {
52 switch (i) {
53 case 0:
54 texture(u_tex[0], vec2(0));
55 break;
56 case 1:
57 texture(u_tex[1], vec2(0));
58 break;
62 </script>
63 <script type="application/javascript">
64 "use strict";
65 description();
66 GLSLConformanceTester.runTests([
68 vShaderId: "vs",
69 vShaderSuccess: true,
70 fShaderId: "fs_constant_integer_expression",
71 fShaderSuccess: true,
72 linkSuccess: true,
73 passMsg: "indexing into an array of samplers with constant-integer-expression is required",
76 vShaderId: "vs",
77 vShaderSuccess: true,
78 fShaderId: "fs_constant_index_expression",
79 fShaderSuccess: false,
80 linkSuccess: false,
81 passMsg: "indexing into an array of samplers with constant-index-expression is forbidden in essl300",
84 vShaderId: "vs",
85 vShaderSuccess: true,
86 fShaderId: "fs_constant_integer_expression_switch",
87 fShaderSuccess: true,
88 linkSuccess: true,
89 passMsg: "constant-index-expression can be converted into fs_constant_integer_expression via a switch",
91 ], 2);
92 </script>
93 </body>
94 </html>