(type, source, keywords)
| 416 | } |
| 417 | |
| 418 | function compileShader (type, source, keywords) { |
| 419 | source = addKeywords(source, keywords); |
| 420 | |
| 421 | const shader = gl.createShader(type); |
| 422 | gl.shaderSource(shader, source); |
| 423 | gl.compileShader(shader); |
| 424 | |
| 425 | if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) |
| 426 | console.trace(gl.getShaderInfoLog(shader)); |
| 427 | |
| 428 | return shader; |
| 429 | }; |
| 430 | |
| 431 | function addKeywords (source, keywords) { |
| 432 | if (keywords == null) return source; |
no test coverage detected