diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library_gl.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 53e587de..0d7d58d5 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -343,7 +343,11 @@ var LibraryGL = { throw 'Invalid type (' + type + ') passed to glTexImage2D'; } var bytes = GL.computeImageSize(width, height, sizePerPixel, GL.unpackAlignment); - pixels = {{{ makeHEAPView('U8', 'pixels', 'pixels+bytes') }}}; + if (type == 0x1401 /* GL_UNSIGNED_BYTE */) { + pixels = {{{ makeHEAPView('U8', 'pixels', 'pixels+bytes') }}}; + } else { + pixels = {{{ makeHEAPView('U16', 'pixels', 'pixels+bytes') }}}; + } } else { pixels = null; } |