aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-01 16:55:24 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-05-01 17:20:57 -0700
commit13ead4463cac1f7860524210ed02991618aa9771 (patch)
tree1e2403e493a2bda2f3805f3d8e651ebc5f899b6f
parent4c0580aa21a18beac0973dc37056348790fe10d1 (diff)
capture clientAttributes to a local
-rw-r--r--src/library_gl.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index f3932053..bf8cb706 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -2262,14 +2262,16 @@ var LibraryGL = {
if (this.modelViewLocation) Module.ctx.uniformMatrix4fv(this.modelViewLocation, false, GL.immediate.matrix['m']);
if (this.projectionLocation) Module.ctx.uniformMatrix4fv(this.projectionLocation, false, GL.immediate.matrix['p']);
+ var clientAttributes = GL.immediate.clientAttributes;
+
Module.ctx.vertexAttribPointer(this.positionLocation, positionSize, positionType, false,
- GL.immediate.stride, GL.immediate.clientAttributes[GL.immediate.VERTEX].offset);
+ GL.immediate.stride, clientAttributes[GL.immediate.VERTEX].offset);
Module.ctx.enableVertexAttribArray(this.positionLocation);
if (this.hasTextures) {
for (var i = 0; i < textureSizes.length; i++) {
if (textureSizes[i] && this.texCoordLocations[i] >= 0) {
Module.ctx.vertexAttribPointer(this.texCoordLocations[i], textureSizes[i], textureTypes[i], false,
- GL.immediate.stride, GL.immediate.clientAttributes[GL.immediate.TEXTURE0 + i].offset);
+ GL.immediate.stride, clientAttributes[GL.immediate.TEXTURE0 + i].offset);
Module.ctx.enableVertexAttribArray(this.texCoordLocations[i]);
}
}
@@ -2281,7 +2283,7 @@ var LibraryGL = {
}
if (this.hasColorAttrib) {
Module.ctx.vertexAttribPointer(this.colorLocation, colorSize, colorType, true,
- GL.immediate.stride, GL.immediate.clientAttributes[GL.immediate.COLOR].offset);
+ GL.immediate.stride, clientAttributes[GL.immediate.COLOR].offset);
Module.ctx.enableVertexAttribArray(this.colorLocation);
Module.ctx.uniform1i(this.hasColorAttribLocation, 1);
} else if (this.hasColorUniform) {
@@ -2290,7 +2292,7 @@ var LibraryGL = {
}
if (this.hasNormal) {
Module.ctx.vertexAttribPointer(this.normalLocation, normalSize, normalType, true,
- GL.immediate.stride, GL.immediate.clientAttributes[GL.immediate.NORMAL].offset);
+ GL.immediate.stride, clientAttributes[GL.immediate.NORMAL].offset);
Module.ctx.enableVertexAttribArray(this.normalLocation);
}
if (!useCurrProgram) { // otherwise, the user program will set the sampler2D binding and uniform itself