(keywords)
| 358 | } |
| 359 | |
| 360 | setKeywords (keywords) { |
| 361 | let hash = 0; |
| 362 | for (let i = 0; i < keywords.length; i++) |
| 363 | hash += hashCode(keywords[i]); |
| 364 | |
| 365 | let program = this.programs[hash]; |
| 366 | if (program == null) |
| 367 | { |
| 368 | let fragmentShader = compileShader(gl.FRAGMENT_SHADER, this.fragmentShaderSource, keywords); |
| 369 | program = createProgram(this.vertexShader, fragmentShader); |
| 370 | this.programs[hash] = program; |
| 371 | } |
| 372 | |
| 373 | if (program == this.activeProgram) return; |
| 374 | |
| 375 | this.uniforms = getUniforms(program); |
| 376 | this.activeProgram = program; |
| 377 | } |
| 378 | |
| 379 | bind () { |
| 380 | gl.useProgram(this.activeProgram); |
no test coverage detected