shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$shader$program$extractAttributesFromGlProgram = function(global, require, module, exports) { var getAttributeInfoFromFormat = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$geometry$utils$getAttributeInfoFromFormat"), mapType = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$shader$program$mapType"); "use strict"; exports.extractAttributesFromGlProgram = function(program, gl, sortAttributes = !1) { const attributes = {}; var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); for (let i = 0; i < totalAttributes; i++) { const attribData = gl.getActiveAttrib(program, i); if (attribData.name.startsWith("gl_")) { continue; } const format = mapType.mapGlToVertexFormat(gl, attribData.type); attributes[attribData.name] = {location:0, format, stride:getAttributeInfoFromFormat.getAttributeInfoFromFormat(format).stride, offset:0, instance:!1, start:0}; } totalAttributes = Object.keys(attributes); if (sortAttributes) { totalAttributes.sort((a, b) => a > b ? 1 : -1); for (sortAttributes = 0; sortAttributes < totalAttributes.length; sortAttributes++) { attributes[totalAttributes[sortAttributes]].location = sortAttributes, gl.bindAttribLocation(program, sortAttributes, totalAttributes[sortAttributes]); } gl.linkProgram(program); } else { for (sortAttributes = 0; sortAttributes < totalAttributes.length; sortAttributes++) { attributes[totalAttributes[sortAttributes]].location = gl.getAttribLocation(program, totalAttributes[sortAttributes]); } } return attributes; }; }; //# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$shader$program$extractAttributesFromGlProgram.js.map