aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-31 14:05:56 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-31 14:17:29 -0700
commitf1416eb63e0a127aace21108333511d408adf415 (patch)
tree6b021ee16f0229434c4f99e89ba2e5a232581535
parent0ab1802b4d10ba893a9b3c82b92805fad7590dc6 (diff)
invalidate renderers using stride
-rw-r--r--src/library_gl.js3
-rwxr-xr-xtests/runner.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 1d37ca91..0912b5da 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1801,6 +1801,7 @@ var LibraryGL = {
lastRenderer: null, // used to avoid cleaning up and re-preparing the same renderer
lastArrayBuffer: null, // used in conjunction with lastRenderer
lastProgram: null, // ""
+ lastStride: -1, // ""
// The following data structures are used for OpenGL Immediate Mode matrix routines.
matrix: {},
@@ -2071,6 +2072,7 @@ var LibraryGL = {
var canSkip = this == lastRenderer &&
arrayBuffer == GL.immediate.lastArrayBuffer &&
(GL.currProgram || this.program) == GL.immediate.lastProgram &&
+ GL.immediate.stride == GL.immediate.lastStride &&
!GL.immediate.matricesModified;
if (!canSkip && lastRenderer) lastRenderer.cleanup();
#endif
@@ -2091,6 +2093,7 @@ var LibraryGL = {
GL.immediate.lastRenderer = this;
GL.immediate.lastArrayBuffer = arrayBuffer;
GL.immediate.lastProgram = GL.currProgram || this.program;
+ GL.immediate.lastStride == GL.immediate.stride;
GL.immediate.matricesModified = false;
#endif
diff --git a/tests/runner.py b/tests/runner.py
index 2c38882f..008d4607 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -11529,7 +11529,7 @@ elif 'browser' in str(sys.argv):
def test_gl_ps_strides(self):
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
- self.btest('gl_ps_strides.c', reference='gl_ps_strides.png', args=['--preload-file', 'screenshot.png', '-s', 'GL_UNSAFE_OPTS=0'])
+ self.btest('gl_ps_strides.c', reference='gl_ps_strides.png', args=['--preload-file', 'screenshot.png'])
def test_gl_renderers(self):
self.btest('gl_renderers.c', reference='gl_renderers.png', args=['-s', 'GL_UNSAFE_OPTS=0'])