Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jul 1, 2022
1 parent 4a7a26c commit 4e317f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webgl-memory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* webgl-memory@1.0.13, license MIT */
/* webgl-memory@1.0.14, license MIT */
(function (factory) {
typeof define === 'function' && define.amd ? define(factory) :
factory();
@@ -368,9 +368,11 @@
}
function computeDrawingbufferSize(gl, drawingBufferInfo) {
// this will need to change for hi-color support
if (gl.isContextLost()) {
return 0;
}
const {samples, depthBits, contextAttributes} = drawingBufferInfo;
const {width, height} = gl.canvas;
const size = width * height * 4;
const size = gl.drawingBufferWidth * gl.drawingBufferHeight * 4 || 0;
const depth = contextAttributes.depth ? 1 : 0;
const stencil = contextAttributes.stencil ? 1 : 0;
const depthSize = Math.min(stencil + depthBits > 16 ? 4 : 2, 4);

0 comments on commit 4e317f4

Please sign in to comment.