diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-06 17:51:34 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-06 17:51:34 -0700 |
commit | d8f33afa263d8243ef393ce359647b4a803c18dc (patch) | |
tree | 666e33f83ef6f78f18c08d886391b86bec896a59 | |
parent | f376765f7040585f2b61306a8177190ef4336d95 (diff) |
track shaders and their sources
-rw-r--r-- | src/webGLWorker.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 76ee488f..4a1f8164 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -494,6 +494,7 @@ function WebGLWorker() { return { id: id, what: 'shader', type: type }; }; this.shaderSource = function(shader, source) { + shader.source = source; commandBuffer.push('shaderSource', 2, shader.id, source); }; this.compileShader = function(shader) { @@ -505,11 +506,11 @@ function WebGLWorker() { this.createProgram = function() { var id = nextId++; commandBuffer.push('createProgram', -1, id); - return { id: id, what: 'program' }; + return { id: id, what: 'program', shaders: [] }; }; this.attachShader = function(program, shader) { + program.shaders.push(shader); commandBuffer.push('attachShader', 2, program.id, shader.id); - // TODO: save shader list for getAttachedShaders }; this.bindAttribLocation = function(program, index, name) { commandBuffer.push('bindAttribLocation', 3, program.id, index, name); |