shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$shader$GlUniformGroupSystem = function(global, require, module, exports) {
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  var generateUniformsSync = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$shader$utils$generateUniformsSync");
  "use strict";
  class GlUniformGroupSystem {
    constructor(renderer) {
      this._uniformGroupSyncHash = {};
      this._renderer = renderer;
      this.gl = null;
      this._cache = {};
    }
    contextChange(gl) {
      this.gl = gl;
    }
    updateUniformGroup(group, program, syncData) {
      const programData = this._renderer.shader._getProgramData(program);
      group.isStatic && group._dirtyId === programData.uniformDirtyGroups[group.uid] || (programData.uniformDirtyGroups[group.uid] = group._dirtyId, this._getUniformSyncFunction(group, program)(programData.uniformData, group.uniforms, this._renderer, syncData));
    }
    _getUniformSyncFunction(group, program) {
      return this._uniformGroupSyncHash[group._signature]?.[program._key] || this._createUniformSyncFunction(group, program);
    }
    _createUniformSyncFunction(group, program) {
      const uniformGroupSyncHash = this._uniformGroupSyncHash[group._signature] || (this._uniformGroupSyncHash[group._signature] = {}), id = this._getSignature(group, program._uniformData, "u");
      this._cache[id] || (this._cache[id] = this._generateUniformsSync(group, program._uniformData));
      uniformGroupSyncHash[program._key] = this._cache[id];
      return uniformGroupSyncHash[program._key];
    }
    _generateUniformsSync(group, uniformData) {
      return generateUniformsSync.generateUniformsSync(group, uniformData);
    }
    _getSignature(group, uniformData, preFix) {
      group = group.uniforms;
      preFix = [`${preFix}-`];
      for (const i in group) {
        preFix.push(i), uniformData[i] && preFix.push(uniformData[i].type);
      }
      return preFix.join("-");
    }
    destroy() {
      this._cache = this._renderer = null;
    }
  }
  GlUniformGroupSystem.extension = {type:[global.ExtensionType.WebGLSystem], name:"uniformGroup"};
  exports.GlUniformGroupSystem = GlUniformGroupSystem;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$shader$GlUniformGroupSystem.js.map
