diff options
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 2659a9d9..e67ec29b 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -833,6 +833,7 @@ var LibraryGL = { for (var i = 0; i < n; i++) { var id = {{{ makeGetValue('textures', 'i*4', 'i32') }}}; var texture = GL.textures[id]; + if (!texture) continue; GLctx.deleteTexture(texture); texture.name = 0; GL.textures[id] = null; @@ -1316,7 +1317,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform view = GL.miniTempBufferViews[0]; view[0] = {{{ makeGetValue('value', '0', 'float') }}}; @@ -1333,7 +1334,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform view = GL.miniTempBufferViews[1]; view[0] = {{{ makeGetValue('value', '0', 'float') }}}; @@ -1351,7 +1352,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform view = GL.miniTempBufferViews[2]; view[0] = {{{ makeGetValue('value', '0', 'float') }}}; @@ -1370,7 +1371,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform view = GL.miniTempBufferViews[3]; view[0] = {{{ makeGetValue('value', '0', 'float') }}}; @@ -1390,7 +1391,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform matrix view = GL.miniTempBufferViews[3]; for (var i = 0; i < 4; i++) { @@ -1409,7 +1410,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform matrix view = GL.miniTempBufferViews[8]; for (var i = 0; i < 9; i++) { @@ -1428,7 +1429,7 @@ var LibraryGL = { #endif location = GL.uniforms[location]; var view; - if (count == 1) { + if (count === 1) { // avoid allocation for the common case of uploading one uniform matrix view = GL.miniTempBufferViews[15]; for (var i = 0; i < 16; i++) { @@ -4347,6 +4348,10 @@ var LibraryGL = { } break; } + case 0x84FF: { // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT + {{{ makeSetValue('params', '0', '0', 'i32') }}}; // no valid value to return here + return; + } } glGetIntegerv(pname, params); }; |