aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-07-03 11:41:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-07-03 11:41:57 -0700
commit4b0724583b7da6bab1273459df70c4273ce2431b (patch)
treecf6a238477a8a208a7a7b28daa47061df09af752 /src
parent80b4a4b910a7310266131de926086013249febc6 (diff)
support non-GL_UNSIGNED_BYTE in glTexSubImage2D as well
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 0d7d58d5..6daee6fc 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -386,7 +386,11 @@ var LibraryGL = {
throw 'Invalid type (' + type + ') passed to glTexSubImage2D';
}
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;
}