aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-18 16:30:56 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-18 16:30:56 -0700
commit275a2432935ac8b54ac1130bb3439a61d9cc2e56 (patch)
treef06b56e15e4afaaffdc5f050fd52490973cc0c12
parent6b99a030aa27bb76f8111688c602720886a8d335 (diff)
track the current program
-rw-r--r--src/webGLWorker.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js
index 8604f82e..965e76b8 100644
--- a/src/webGLWorker.js
+++ b/src/webGLWorker.js
@@ -40,7 +40,8 @@ function WebGLWorker() {
var bindings = {
texture2D: null,
arrayBuffer: null,
- elementArrayBuffer: null
+ elementArrayBuffer: null,
+ program: null
};
//===========
@@ -506,6 +507,9 @@ function WebGLWorker() {
case this.ELEMENT_ARRAY_BUFFER_BINDING: {
return bindings.elementArrayBuffer;
}
+ case this.CURRENT_PROGRAM: {
+ return bindings.program;
+ }
default: throw 'TODO: get parameter ' + name + ' : ' + revname(name);
}
};
@@ -648,6 +652,7 @@ function WebGLWorker() {
};
this.useProgram = function(program) {
commandBuffer.push('useProgram', 1, program ? program.id : 0);
+ bindings.program = program;
};
this.uniform1i = function(location, data) {
if (!location) return;