diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-13 14:23:18 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-13 14:23:18 -0700 |
commit | 1b5036619a81daea2f781dc8dab101bda8292fa8 (patch) | |
tree | ccdd5ae424aec134744a0c304430a3164fe9d45a /src | |
parent | e3445d96338343a67084b03ecd0a9c6643962265 (diff) |
getProgramParameter(LINK_STATUS)
Diffstat (limited to 'src')
-rw-r--r-- | src/webGLClient.js | 5 | ||||
-rw-r--r-- | src/webGLWorker.js | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js index 1c34f12d..663c693a 100644 --- a/src/webGLClient.js +++ b/src/webGLClient.js @@ -9,6 +9,7 @@ function WebGLClient() { function fixArgs(command, args) { switch (command) { + case 'getProgramParameter': case 'getShaderParameter': case 'uniform4fv': case 'uniformMatrix4fv': @@ -46,8 +47,8 @@ function WebGLClient() { var args = fixArgs(command, buffer.slice(i, i+numArgs)); i += numArgs; //dump('issue+: ' + command + '(' + args + '), ' + numArgs + '\n'); - if (command === 'getShaderParameter') { - assert(ctx.getShaderParameter(args[0], args[1]), 'we cannot handle errors, we are async proxied WebGL'); + if (command === 'getShaderParameter' || command === 'getProgramParameter') { + assert(ctx[command](args[0], args[1]), 'we cannot handle errors, we are async proxied WebGL'); } else { ctx[command].apply(ctx, args); } diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 997f79d8..a7731767 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -573,10 +573,15 @@ function WebGLWorker() { }); }; this.getProgramParameter = function(program, name) { - if (name === this.ACTIVE_UNIFORMS) { - return program.uniformVec.length; + switch (name) { + case this.ACTIVE_UNIFORMS: return program.uniformVec.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', program.id, name); + return true; + } + default: throw 'bad getProgramParameter ' + revname(name); } - throw 'bad getProgramParameter ' + revname(name); }; this.getActiveUniform = function(program, index) { var name = program.uniformVec[index]; |