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>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>
19 <div id=
"description"></div>
20 <div id=
"console"></div>
21 <script id=
"vs" type=
"text/plain">#version
300 es
24 <script id=
"fs_constant_integer_expression" type=
"text/plain">#version
300 es
25 precision mediump float;
26 uniform sampler2D u_tex[
2];
30 texture(u_tex[
0], vec2(
0));
31 texture(u_tex[
1], vec2(
0));
34 <script id=
"fs_constant_index_expression" type=
"text/plain">#version
300 es
35 precision mediump float;
36 uniform sampler2D u_tex[
2];
40 for (int i =
0; i <
2; i++) {
41 texture(u_tex[i], vec2(
0));
45 <script id=
"fs_constant_integer_expression_switch" type=
"text/plain">#version
300 es
46 precision mediump float;
47 uniform sampler2D u_tex[
2];
51 for (int i =
0; i <
2; i++) {
54 texture(u_tex[
0], vec2(
0));
57 texture(u_tex[
1], vec2(
0));
63 <script type=
"application/javascript">
66 GLSLConformanceTester.runTests([
70 fShaderId:
"fs_constant_integer_expression",
73 passMsg:
"indexing into an array of samplers with constant-integer-expression is required",
78 fShaderId:
"fs_constant_index_expression",
79 fShaderSuccess: false,
81 passMsg:
"indexing into an array of samplers with constant-index-expression is forbidden in essl300",
86 fShaderId:
"fs_constant_integer_expression_switch",
89 passMsg:
"constant-index-expression can be converted into fs_constant_integer_expression via a switch",