shader-with-limited-indexing.frag.html (1474B)
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="vertexShader" type="text/something-not-javascript"> 22 // vertex shader should succeed 23 attribute vec4 a_weights; 24 varying vec4 v_weights; 25 26 void main() { 27 v_weights = a_weights; 28 gl_Position = vec4(0.0, 0.0, 0.0, 1.0); 29 } 30 </script> 31 <script id="fragmentShader" type="text/something-not-javascript"> 32 // fragment shader with appropriately limited indexing expression should succeed 33 // http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS 34 precision mediump float; 35 36 uniform vec4 u_colors[8]; 37 varying vec4 v_weights; 38 39 void main() 40 { 41 vec4 color = vec4(0.0, 0.0, 0.0, 0.0); 42 for (int i = 0; i < 4; i++) { 43 color += u_colors[i] * v_weights[i]; 44 } 45 gl_FragColor = color; 46 } 47 </script> 48 <script> 49 "use strict"; 50 GLSLConformanceTester.runTest(); 51 var successfullyParsed = true; 52 </script> 53 </body> 54 </html>