gl-enable-vertex-attrib.html (1296B)
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 Enable Vertex Attrib 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> 15 <script src="../../js/tests/invalid-vertex-attrib-test.js"></script> 16 </head> 17 <body> 18 <canvas id="example" width="50" height="50"> 19 </canvas> 20 <div id="description"></div> 21 <div id="console"></div> 22 23 <script> 24 "use strict"; 25 description("tests that turning on attribs that have no buffer bound fails to draw"); 26 const wtu = WebGLTestUtils; 27 const gl = wtu.create3DContext("example"); 28 29 async function runInvalidAttribTests() { 30 const invalidAttribTestFn = createInvalidAttribTestFn(gl); 31 32 function drawArrays(gl) { 33 gl.drawArrays(gl.TRIANGLES, 0, 6); 34 } 35 36 function drawElements(gl) { 37 gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0); 38 } 39 40 await invalidAttribTestFn(drawArrays); 41 await invalidAttribTestFn(drawElements); 42 finishTest(); 43 } 44 runInvalidAttribTests(); 45 46 var successfullyParsed = true; 47 </script> 48 49 </body> 50 </html>