diff options
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 0f7d251c..374ba9e5 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1534,9 +1534,11 @@ var LibraryGL = { this.clientColor = new Float32Array([1, 1, 1, 1]); - // Replace some functions with immediate-mode aware versions + // Replace some functions with immediate-mode aware versions. If there are no client + // attributes enabled, and we use webgl-friendly modes (no GL_QUADS), then no need + // for emulation _glDrawArrays = function(mode, first, count) { - if (GL.immediate.totalEnabledClientAttributes == 0) { + if (GL.immediate.totalEnabledClientAttributes == 0 && mode <= 6) { Module.ctx.drawArrays(mode, first, count); return; } @@ -1546,7 +1548,7 @@ var LibraryGL = { }; _glDrawElements = function(mode, count, type, indices) { - if (GL.immediate.totalEnabledClientAttributes == 0) { + if (GL.immediate.totalEnabledClientAttributes == 0 && mode <= 6) { Module.ctx.drawElements(mode, count, type, indices); return; } |