{"version":3,"file":"GLProgram.mjs","sources":["../../src/shader/GLProgram.ts"],"sourcesContent":["import type { Dict } from '@pixi/utils';\n\n/**\n * @private\n */\nexport class IGLUniformData\n{\n    location: WebGLUniformLocation;\n    value: number | boolean | Float32Array | Int32Array | Uint32Array | boolean[];\n}\n\n/**\n * Helper class to create a WebGL Program\n * @memberof PIXI\n */\nexport class GLProgram\n{\n    /** The shader program. */\n    public program: WebGLProgram;\n\n    /**\n     * Holds the uniform data which contains uniform locations\n     * and current uniform values used for caching and preventing unneeded GPU commands.\n     */\n    public uniformData: Dict<any>;\n\n    /**\n     * UniformGroups holds the various upload functions for the shader. Each uniform group\n     * and program have a unique upload function generated.\n     */\n    public uniformGroups: Dict<any>;\n\n    /** A hash that stores where UBOs are bound to on the program. */\n    public uniformBufferBindings: Dict<any>;\n\n    /** A hash for lazily-generated uniform uploading functions. */\n    public uniformSync: Dict<any>;\n\n    /**\n     * A place where dirty ticks are stored for groups\n     * If a tick here does not match with the Higher level Programs tick, it means\n     * we should re upload the data.\n     */\n    public uniformDirtyGroups: Dict<any>;\n\n    /**\n     * Makes a new Pixi program.\n     * @param program - webgl program\n     * @param uniformData - uniforms\n     */\n    constructor(program: WebGLProgram, uniformData: {[key: string]: IGLUniformData})\n    {\n        this.program = program;\n        this.uniformData = uniformData;\n        this.uniformGroups = {};\n        this.uniformDirtyGroups = {};\n        this.uniformBufferBindings = {};\n    }\n\n    /** Destroys this program. */\n    destroy(): void\n    {\n        this.uniformData = null;\n        this.uniformGroups = null;\n        this.uniformDirtyGroups = null;\n        this.uniformBufferBindings = null;\n        this.program = null;\n    }\n}\n"],"names":[],"mappings":"AAKO,MAAM,eACb;AAGA;AAMO,MAAM,UACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkCI,YAAY,SAAuB,aACnC;AACI,SAAK,UAAU,SACf,KAAK,cAAc,aACnB,KAAK,gBAAgB,CAAC,GACtB,KAAK,qBAAqB,CAC1B,GAAA,KAAK,wBAAwB;EACjC;AAAA;AAAA,EAGA,UACA;AACI,SAAK,cAAc,MACnB,KAAK,gBAAgB,MACrB,KAAK,qBAAqB,MAC1B,KAAK,wBAAwB,MAC7B,KAAK,UAAU;AAAA,EACnB;AACJ;"}