shader-with-arbitrary-indexing.frag.html (1133B)
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 --> 6 7 <!DOCTYPE html> 8 <html> 9 <head> 10 <meta charset="utf-8"> 11 <title>WebGL GLSL Conformance Tests</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="fragmentShader" type="text/something-not-javascript"> 22 // fragment shader with arbitrary indexing expression should fail 23 // http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS 24 precision mediump float; 25 26 uniform vec4 u_colors[8]; 27 varying float a_index; 28 29 void main() 30 { 31 int index = int(floor(a_index)); 32 gl_FragColor = u_colors[index]; 33 } 34 </script> 35 <script> 36 "use strict"; 37 GLSLConformanceTester.runTest(); 38 var successfullyParsed = true; 39 </script> 40 </body> 41 </html>