From 5f777e08f2affe3e640edf0be757ccfae13cba99 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 20 Jun 2014 15:19:43 -0700 Subject: handle ACTIVE_ATTRIBUTES --- src/webGLWorker.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/webGLWorker.js b/src/webGLWorker.js index d6d1404e..1a051bbd 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -600,15 +600,15 @@ function WebGLWorker() { program.uniforms = {}; program.uniformVec = []; - program.existingAttributes = {}; + var existingAttributes = {}; program.shaders.forEach(function(shader) { parseElementType(shader, 'uniform', program.uniforms, program.uniformVec); - parseElementType(shader, 'attribute', program.existingAttributes, null); + parseElementType(shader, 'attribute', existingAttributes, null); }); // bind not-yet bound attributes - for (var attr in program.existingAttributes) { + for (var attr in existingAttributes) { if (!(attr in program.attributes)) { var index = program.attributeVec.length; this.bindAttribLocation(program, index, attr); @@ -620,6 +620,7 @@ function WebGLWorker() { this.getProgramParameter = function(program, name) { switch (name) { case this.ACTIVE_UNIFORMS: return program.uniformVec.length; + case this.ACTIVE_ATTRIBUTES: return program.attributeVec.length; case this.LINK_STATUS: { // optimisticaly return success; client will abort on an actual error. we assume an error-free async workflow commandBuffer.push('getProgramParameter', 2, program.id, name); -- cgit v1.2.3-18-g5258