diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-20 16:48:33 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-20 16:52:52 -0700 |
commit | ed7beb28461bc76e467ccfa29af6a1729b726c1e (patch) | |
tree | 5473e7753bd296cfe884acab2b9b1d8fc4754e31 | |
parent | 6db9f86c1e92d2fc8aaa2e1e05c02778811f2c25 (diff) |
fix getUniformLocation on indexed values
-rw-r--r-- | src/webGLWorker.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 9c62f352..14f00885 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -644,7 +644,7 @@ function WebGLWorker() { return program.uniforms[name]; }; this.getUniformLocation = function(program, name) { - if (!(name in program.uniforms)) return null; + var fullname = name; var index = -1; var open = name.indexOf('['); if (open >= 0) { @@ -652,8 +652,9 @@ function WebGLWorker() { index = parseInt(name.substring(open+1, close)); name = name.substr(0, open); } + if (!(name in program.uniforms)) return null; var id = nextId++; - commandBuffer.push('getUniformLocation', -3, program.id, name, id); + commandBuffer.push('getUniformLocation', -3, program.id, fullname, id); return { what: 'location', uniform: program.uniforms[name], id: id, index: index }; }; this.getProgramInfoLog = function(shader) { |