(type, source, keywords)
| 203 | } |
| 204 | |
| 205 | function compileShader(type, source, keywords) { |
| 206 | source = addKeywords(source, keywords); |
| 207 | const shader = gl.createShader(type); |
| 208 | gl.shaderSource(shader, source); |
| 209 | gl.compileShader(shader); |
| 210 | if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) console.trace(gl.getShaderInfoLog(shader)); |
| 211 | return shader; |
| 212 | } |
| 213 | |
| 214 | function addKeywords(source, keywords) { |
| 215 | if (!keywords) return source; |
no test coverage detected