Skip to content

Commit 4e317f4

Browse files
committed
build
1 parent 4a7a26c commit 4e317f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

webgl-memory.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* webgl-memory@1.0.13, license MIT */
1+
/* webgl-memory@1.0.14, license MIT */
22
(function (factory) {
33
typeof define === 'function' && define.amd ? define(factory) :
44
factory();
@@ -368,9 +368,11 @@
368368
}
369369
function computeDrawingbufferSize(gl, drawingBufferInfo) {
370370
// this will need to change for hi-color support
371+
if (gl.isContextLost()) {
372+
return 0;
373+
}
371374
const {samples, depthBits, contextAttributes} = drawingBufferInfo;
372-
const {width, height} = gl.canvas;
373-
const size = width * height * 4;
375+
const size = gl.drawingBufferWidth * gl.drawingBufferHeight * 4 || 0;
374376
const depth = contextAttributes.depth ? 1 : 0;
375377
const stencil = contextAttributes.stencil ? 1 : 0;
376378
const depthSize = Math.min(stencil + depthBits > 16 ? 4 : 2, 4);

0 commit comments

Comments
 (0)