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>Short circuit in loop condition 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>
17 <div id=
"description"></div>
18 <div id=
"console"></div>
19 <script id=
"vertex-shader" type=
"x-shader/x-vertex">#version
300 es
20 precision highp float;
24 gl_Position = aPosition;
27 <script id=
"fragment-shader" type=
"x-shader/x-fragment">#version
300 es
28 precision highp float;
32 uniform sampler2D iChannel0;
36 return texture(iChannel0, vec2(p, p),
0.0).y;
45 for(int i=
0; i
<1000; i++)
47 if( sum
> 0.99 ) break;
48 float p = iMouse.x + gl_FragCoord.x;
55 <script type=
"text/javascript">
57 description("Test an HLSL compiler freeze on a gradient inside a discontinuous loop.");
59 var wtu
= WebGLTestUtils
;
60 var gl
= wtu
.create3DContext(undefined, undefined, 2);
61 wtu
.setupUnitQuad(gl
);
64 testFailed("context does not exist");
66 var program
= wtu
.setupProgram(gl
, ["vertex-shader", "fragment-shader"], ['aPosition'], undefined, true);
68 testFailed('Program compilation failed');
71 var successfullyParsed
= true;