aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webGLClient.js7
-rw-r--r--src/webGLWorker.js11
2 files changed, 17 insertions, 1 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js
index 173078c3..1c34f12d 100644
--- a/src/webGLClient.js
+++ b/src/webGLClient.js
@@ -9,6 +9,7 @@ function WebGLClient() {
function fixArgs(command, args) {
switch (command) {
+ case 'getShaderParameter':
case 'uniform4fv':
case 'uniformMatrix4fv':
case 'getUniformLocation':
@@ -45,7 +46,11 @@ function WebGLClient() {
var args = fixArgs(command, buffer.slice(i, i+numArgs));
i += numArgs;
//dump('issue+: ' + command + '(' + args + '), ' + numArgs + '\n');
- ctx[command].apply(ctx, args);
+ if (command === 'getShaderParameter') {
+ assert(ctx.getShaderParameter(args[0], args[1]), 'we cannot handle errors, we are async proxied WebGL');
+ } else {
+ ctx[command].apply(ctx, args);
+ }
} else {
// negative means a constructor, last argument is the id to save as
numArgs = -numArgs - 1;
diff --git a/src/webGLWorker.js b/src/webGLWorker.js
index 37756fa0..997f79d8 100644
--- a/src/webGLWorker.js
+++ b/src/webGLWorker.js
@@ -663,6 +663,17 @@ function WebGLWorker() {
this.activeTexture = function(texture) {
commandBuffer.push('activeTexture', 1, texture);
};
+ this.getShaderParameter = function(shader, pname) {
+ switch (pname) {
+ case this.SHADER_TYPE: return shader.type;
+ case this.COMPILE_STATUS: {
+ // optimisticaly return success; client will abort on an actual error. we assume an error-free async workflow
+ commandBuffer.push('getShaderParameter', shader.id, pname);
+ return true;
+ }
+ default: throw 'unsupported getShaderParameter ' + pname;
+ }
+ };
// Setup
var dropped = 0;