<!--Copyright (c) 2021 The Khronos Group Inc.Use of this source code is governed by an MIT-style license that can befound in the LICENSE.txt file.--><!DOCTYPE html><html><head><metacharset="utf-8"><title>Fragment shader containing loop should not crash</title><linkrel="stylesheet"href="../../resources/js-test-style.css"/><linkrel="stylesheet"href="../../resources/glsl-feature-tests.css"/><scriptsrc="../../js/js-test-pre.js"></script><scriptsrc="../../js/webgl-test-utils.js"></script><scriptsrc="../../js/glsl-conformance-test.js"></script></head><body><divid="description"></div><divid="console"></div><scriptid="vshader"type="x-shader/x-vertex">#version300esprecisionhighpfloat;outvec2v_tex_coord;uniformmat4matrix;voidmain(){v_tex_coord=vec2(0.0,0.0);gl_Position=vec4(0.0,0.0,0.0,0.0);}</script><scriptid="fshader"type="x-shader/x-fragment">#version300esprecisionhighpfloat;invec2v_tex_coord;outvec4out_color;uniformsampler2Dtexture_1;uniformvec2resolution;vec4do_loops(vec4z){vec4v[16];for(inti=0;i<16;i++){v[i]=z;}returnv[1];}voidmain(){out_color=do_loops(vec4(0.2,0.4,0.6,1.0))-texture(texture_1,v_tex_coord);}</script><scripttype="application/javascript">"use strict";description();constwtu=WebGLTestUtils;consttests=[{vShaderSource:wtu.getScript('vshader'),fShaderSource:wtu.getScript('fshader'),vShaderSuccess:true,fShaderSuccess:true,linkSuccess:true,passMsg:'Fragment shader containing a simple loop should compile and link'}];GLSLConformanceTester.runTests(tests,2);</script></body></html>