MCPcopy Index your code
hub / github.com/processing/p5.js / getWebGLShaderAttributes

Function getWebGLShaderAttributes

src/webgl/utils.js:378–399  ·  view source on GitHub ↗
(shader, gl)

Source from the content-addressed store, hash-verified

376}
377
378export 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
401export function populateGLSLHooks(shader, src, shaderType) {
402 const main = "void main";

Callers 2

constructorMethod · 0.90
_getShaderAttributesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected