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.
10 <meta charset=
"utf-8">
11 <title>Tests that resources allocated by a WebGL context are freed in a reasonable timeframe.
</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>
17 <div id=
"description"></div>
18 <div id=
"console"></div>
19 <canvas id=
"canvas" width=
"32" height=
"32">
25 debug("Creates a WebGL context and textures consuming ~80 MB of video memory, then reloads the page and does it over again.")
26 debug("GPU memory usage should be capped. It should not grow unboundedly.")
28 var wtu
= WebGLTestUtils
;
30 var gl
= wtu
.create3DContext(document
.getElementById("canvas"));
33 for (var ii
= 0; ii
< 20; ++ii
) {
34 var tex
= gl
.createTexture();
35 gl
.bindTexture(gl
.TEXTURE_2D
, tex
);
36 gl
.texImage2D(gl
.TEXTURE_2D
, 0, gl
.RGBA
, 1024, 1024, 0, gl
.RGBA
, gl
.UNSIGNED_BYTE
,
41 setTimeout(function() { debug("Reloading..."); window
.location
.reload(); }, 500);
43 var successfullyParsed
= true;