diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-19 15:25:32 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-19 15:45:44 -0700 |
commit | f167c351c3b062316f67dc8f363b1cb9b615eb72 (patch) | |
tree | 0f4c597378a9c92e3adba1bd5d0d1077c72d7a53 | |
parent | f8ecbf36df9383f142441bdacb4a166a8b772d90 (diff) |
share prefetched gl data among all instances of WebGLWorker
-rw-r--r-- | src/webGLWorker.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 00cb6e32..5fc69bd3 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -30,9 +30,6 @@ function WebGLWorker() { // State //======= - this.prefetchedParameters = {}; - this.prefetchedExtensions = {}; - var commandBuffer = []; var nextId = 1; // valid ids are > 0 @@ -479,8 +476,8 @@ function WebGLWorker() { //dump('worker GL got ' + JSON.stringify(msg) + '\n'); switch(msg.op) { case 'setPrefetched': { - that.prefetchedParameters = msg.parameters; - that.prefetchedExtensions = msg.extensions; + WebGLWorker.prototype.prefetchedParameters = msg.parameters; + WebGLWorker.prototype.prefetchedExtensions = msg.extensions; break; } default: throw 'weird gl onmessage ' + JSON.stringify(msg); @@ -876,3 +873,8 @@ function WebGLWorker() { }; } +// share prefetched data among all instances + +WebGLWorker.prototype.prefetchedParameters = {}; +WebGLWorker.prototype.prefetchedExtensions = {}; + |