2 Copyright (c) 2021 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>Fragment shader containing loop should not crash
</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=
"vshader" type=
"x-shader/x-vertex">#version
300 es
22 precision highp float;
27 v_tex_coord = vec2(
0.0,
0.0);
28 gl_Position = vec4(
0.0,
0.0,
0.0,
0.0);
31 <script id=
"fshader" type=
"x-shader/x-fragment">#version
300 es
32 precision highp float;
37 uniform sampler2D texture_1;
38 uniform vec2 resolution;
43 for (int i =
0; i <
16; i++)
51 out_color = do_loops(vec4(
0.2,
0.4,
0.6,
1.0)) - texture(texture_1, v_tex_coord);
54 <script type=
"application/javascript">
57 const wtu = WebGLTestUtils;
60 vShaderSource: wtu.getScript('vshader'),
61 fShaderSource: wtu.getScript('fshader'),
65 passMsg: 'Fragment shader containing a simple loop should compile and link'
69 GLSLConformanceTester.runTests(tests,
2);