aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-06 16:49:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-06 16:49:35 -0700
commita79ec24da5008537230aac63619e344b45e6fe0c (patch)
tree6793e4fd8767ccc1aea822e154d4ce50352224bf
parent5e981894dd503ec8767aefa9225b349a03dd2ab3 (diff)
compileShader
-rw-r--r--src/webGLClient.js1
-rw-r--r--src/webGLWorker.js11
2 files changed, 8 insertions, 4 deletions
diff --git a/src/webGLClient.js b/src/webGLClient.js
index ad55acc4..fdd96964 100644
--- a/src/webGLClient.js
+++ b/src/webGLClient.js
@@ -5,6 +5,7 @@ function WebGLClient() {
function fixArgs(command, args) {
switch (command) {
+ case 'compileShader':
case 'shaderSource': args[0] = objects[args[0]]; break;
}
}
diff --git a/src/webGLWorker.js b/src/webGLWorker.js
index 3457f097..3ddbdf76 100644
--- a/src/webGLWorker.js
+++ b/src/webGLWorker.js
@@ -455,13 +455,13 @@ function WebGLWorker() {
}
};
- // GL
-
function revname(name) {
for (var x in that) if (that[x] === name) return x;
return null;
}
+ // GL
+
this.getParameter = function(name) {
assert(name);
if (name in this.prefetchedParameters) return this.prefetchedParameters[name];
@@ -492,10 +492,13 @@ function WebGLWorker() {
var id = nextId++;
commandBuffer.push('createShader', -2, type, id);
return { id: id, what: 'shader', type: type };
- }
+ };
this.shaderSource = function(shader, source) {
commandBuffer.push('shaderSource', 2, shader.id, source);
- }
+ };
+ this.compileShader = function(shader) {
+ commandBuffer.push('compileShader', 1, shader.id);
+ };
// Setup
var postMainLoop = Module['postMainLoop'];