shader-with-preprocessor-whitespace.html (1550B)
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="vertexWhitespace" type="text/something-not-javascript"> 22 // GLSL ES spec section 3.4 23 # ifdef GL_ES 24 attribute vec4 v_Position; 25 void main() 26 { 27 gl_Position = v_Position; 28 } 29 #endif 30 </script> 31 <script id="fragmentWhitespace" type="text/something-not-javascript"> 32 // GLSL ES spec section 3.4 33 # ifdef GL_ES 34 precision mediump float; 35 void main() 36 { 37 gl_FragColor = vec4(0.0,0.0,0.0,1.0); 38 } 39 #endif 40 </script> 41 <script> 42 "use strict"; 43 GLSLConformanceTester.runTests([ 44 { 45 vShaderId: 'vertexWhitespace', 46 vShaderSuccess: true, 47 linkSuccess: true, 48 passMsg: 'Vertex shader using space and tab characters around # should succeed' 49 }, 50 { 51 fShaderId: 'fragmentWhitespace', 52 fShaderSuccess: true, 53 linkSuccess: true, 54 passMsg: 'Fragment shader using space and tab characters around # should succeed' 55 } 56 ]); 57 var successfullyParsed = true; 58 </script> 59 </body> 60 </html>