UNPKG

951 BTypeScriptView Raw
1import type { Dict } from '@pixi/utils';
2import type { IUniformData } from '../Program';
3import type { UniformGroup } from '../UniformGroup';
4export declare type UniformsSyncCallback = (...args: any[]) => void;
5interface UBOElement {
6 data: IUniformData;
7 offset: number;
8 dataLen: number;
9 dirty: number;
10}
11/**
12 * logic originally from here: https://github.com/sketchpunk/FunWithWebGL2/blob/master/lesson_022/Shaders.js
13 * rewrote it, but this was a great starting point to get a solid understanding of whats going on :)
14 * @ignore
15 * @param uniformData
16 */
17export declare function createUBOElements(uniformData: IUniformData[]): {
18 uboElements: UBOElement[];
19 size: number;
20};
21export declare function getUBOData(uniforms: Dict<any>, uniformData: Dict<any>): any[];
22export declare function generateUniformBufferSync(group: UniformGroup, uniformData: Dict<any>): {
23 size: number;
24 syncFunc: UniformsSyncCallback;
25};
26export {};