UNPKG

1.48 kBTypeScriptView Raw
1import type { Dict } from '@pixi/utils';
2/**
3 * @private
4 */
5export declare class IGLUniformData {
6 location: WebGLUniformLocation;
7 value: number | boolean | Float32Array | Int32Array | Uint32Array | boolean[];
8}
9/**
10 * Helper class to create a WebGL Program
11 * @memberof PIXI
12 */
13export declare class GLProgram {
14 /** The shader program. */
15 program: WebGLProgram;
16 /**
17 * Holds the uniform data which contains uniform locations
18 * and current uniform values used for caching and preventing unneeded GPU commands.
19 */
20 uniformData: Dict<any>;
21 /**
22 * UniformGroups holds the various upload functions for the shader. Each uniform group
23 * and program have a unique upload function generated.
24 */
25 uniformGroups: Dict<any>;
26 /** A hash that stores where UBOs are bound to on the program. */
27 uniformBufferBindings: Dict<any>;
28 /** A hash for lazily-generated uniform uploading functions. */
29 uniformSync: Dict<any>;
30 /**
31 * A place where dirty ticks are stored for groups
32 * If a tick here does not match with the Higher level Programs tick, it means
33 * we should re upload the data.
34 */
35 uniformDirtyGroups: Dict<any>;
36 /**
37 * Makes a new Pixi program.
38 * @param program - webgl program
39 * @param uniformData - uniforms
40 */
41 constructor(program: WebGLProgram, uniformData: {
42 [key: string]: IGLUniformData;
43 });
44 /** Destroys this program. */
45 destroy(): void;
46}