(shader, gl)
| 376 | } |
| 377 | |
| 378 | export function getWebGLShaderAttributes(shader, gl) { |
| 379 | const attributes = {}; |
| 380 | |
| 381 | const numAttributes = gl.getProgramParameter( |
| 382 | shader._glProgram, |
| 383 | gl.ACTIVE_ATTRIBUTES, |
| 384 | ); |
| 385 | for (let i = 0; i < numAttributes; ++i) { |
| 386 | const attributeInfo = gl.getActiveAttrib(shader._glProgram, i); |
| 387 | const name = attributeInfo.name; |
| 388 | const location = gl.getAttribLocation(shader._glProgram, name); |
| 389 | const attribute = {}; |
| 390 | attribute.name = name; |
| 391 | attribute.location = location; |
| 392 | attribute.index = i; |
| 393 | attribute.type = attributeInfo.type; |
| 394 | attribute.size = attributeInfo.size; |
| 395 | attributes[name] = attribute; |
| 396 | } |
| 397 | |
| 398 | return attributes; |
| 399 | } |
| 400 | |
| 401 | export function populateGLSLHooks(shader, src, shaderType) { |
| 402 | const main = "void main"; |
no outgoing calls
no test coverage detected