Backed out changeset 8fc3326bce7f (bug 1943032) for causing failures at browser_tab_g...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / extra / point-no-attributes-stress.html
blobf567264907cf83b89f300e0c2d50fb4c321e4ef6
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 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
10 <meta charset="utf-8">
11 <link rel="stylesheet" href="../resources/js-test-style.css"/>
12 <script src="../js/js-test-pre.js"></script>
13 <script src="../js/webgl-test-utils.js"></script>
14 <script id="vshader" type="x-shader/x-vertex">
15 void main()
17 gl_PointSize = 1.0;
18 gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
20 </script>
22 <script id="fshader" type="x-shader/x-fragment">
23 precision mediump float;
25 void main()
27 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
29 </script>
30 </head>
31 <body>
32 <canvas id="testbed" width="1" height="1" style="width: 100px; height: 100px;"></canvas>
33 <div id="description"></div>
34 <div id="console"></div>
35 <script>
36 "use strict";
37 description('Stress test drawing a huge number of points without enabling any attributes');
39 debug('This test stresses drawing a large number of points and workarounds created to run WebGL with simulated attrib 0');
41 if (confirm('After clicking OK your machine may become unresponsive or crash.')) {
42 var wtu = WebGLTestUtils;
43 var gl = wtu.create3DContext('testbed');
45 var program1 = wtu.setupProgram(gl, ['vshader', 'fshader']);
47 gl.enable(gl.BLEND);
49 debug('Draw 2^31 points with a shader that takes no attributes and verify it fills the whole canvas.');
51 gl.drawArrays(gl.POINTS, 0, Math.pow(2, 31) - 1);
52 wtu.glErrorShouldBe(gl, gl.NO_ERROR);
53 wtu.checkCanvas(gl, [0, 255, 0, 255]);
56 var successfullyParsed = true;
57 </script>
58 <script src="../js/js-test-post.js"></script>
60 </body>
61 </html>