File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
- /* webgl-memory@1.0.13 , license MIT */
1
+ /* webgl-memory@1.0.14 , license MIT */
2
2
( function ( factory ) {
3
3
typeof define === 'function' && define . amd ? define ( factory ) :
4
4
factory ( ) ;
368
368
}
369
369
function computeDrawingbufferSize ( gl , drawingBufferInfo ) {
370
370
// this will need to change for hi-color support
371
+ if ( gl . isContextLost ( ) ) {
372
+ return 0 ;
373
+ }
371
374
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 ;
374
376
const depth = contextAttributes . depth ? 1 : 0 ;
375
377
const stencil = contextAttributes . stencil ? 1 : 0 ;
376
378
const depthSize = Math . min ( stencil + depthBits > 16 ? 4 : 2 , 4 ) ;
You can’t perform that action at this time.
0 commit comments