Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / webgl-mochitest / test_depth_tex_lazy_clear.html
bloba3f2dc409af61e0be90f5792cd900776820e54c7
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset='utf-8'/>
5 <script src='/tests/SimpleTest/SimpleTest.js'></script>
6 <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
7 <script src='webgl-util.js'></script>
8 </head>
9 <body>
10 <script id='vs' type='x-shader/x-vertex'>
12 attribute vec2 aVertCoord;
14 void main(void) {
15 gl_Position = vec4(aVertCoord, 0.0, 1.0);
18 </script>
19 <script id='fs' type='x-shader/x-fragment'>
21 precision mediump float;
22 uniform sampler2D uTexUnit;
24 void main(void) {
25 vec4 tex = texture2D(uTexUnit, vec2(0));
26 gl_FragColor = vec4(tex.r, 1.0, 0.0, 1.0);
29 </script>
30 <script>
31 'use strict';
33 var gl = null;
35 do {
36 var c = document.createElement('canvas');
37 gl = c.getContext('webgl');
38 if (!gl) {
39 todo(false, 'Get GL working here first.');
40 break;
43 var ext = gl.getExtension('WEBGL_depth_texture');
44 if (!ext) {
45 todo(false, 'WEBGL_depth_texture not supported, which is fine.');
46 break;
49 var prog = WebGLUtil.createProgramByIds(gl, 'vs', 'fs');
50 if (!prog) {
51 ok(false, 'Program linking should succeed.');
52 break;
55 var tex = gl.createTexture();
56 gl.bindTexture(gl.TEXTURE_2D, tex);
57 gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, 1, 1, 0, gl.DEPTH_COMPONENT,
58 gl.UNSIGNED_INT, null);
60 var uTexUnit = gl.getUniformLocation(prog, 'uTexUnit');
61 gl.useProgram(prog);
62 gl.uniform1i(uTexUnit, 0);
64 gl.drawArrays(gl.POINTS, 0, 1);
66 ok(!gl.getError(), 'Should have no errors.');
67 } while (false);
69 ok(true, 'Test complete.');
71 </script>
72 </body>
73 </html>