pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
1 lines • 2.45 kB
Source Map (JSON)
{"version":3,"file":"types.mjs","sources":["../../../../../src/rendering/renderers/shared/shader/types.ts"],"sourcesContent":["// TODO add more types as required\n/** @internal */\nexport const UNIFORM_TYPES_VALUES = [\n 'f32',\n 'i32',\n 'vec2<f32>',\n 'vec3<f32>',\n 'vec4<f32>',\n 'mat2x2<f32>',\n 'mat3x3<f32>',\n 'mat4x4<f32>',\n 'mat3x2<f32>',\n 'mat4x2<f32>',\n 'mat2x3<f32>',\n 'mat4x3<f32>',\n 'mat2x4<f32>',\n 'mat3x4<f32>',\n 'vec2<i32>',\n 'vec3<i32>',\n 'vec4<i32>',\n] as const;\n\n/**\n * useful for checking if a type is supported - a map of supported types with a true value.\n * @internal\n */\nexport const UNIFORM_TYPES_MAP = UNIFORM_TYPES_VALUES.reduce((acc, type) =>\n{\n acc[type] = true;\n\n return acc;\n}, {} as Record<UNIFORM_TYPES, boolean>);\n\n/** @internal */\nexport type UNIFORM_TYPES_SINGLE = typeof UNIFORM_TYPES_VALUES[number];\n\ntype OPTIONAL_SPACE = ' ' | '';\n\n/** @internal */\nexport type UNIFORM_TYPES_ARRAY = `array<${UNIFORM_TYPES_SINGLE},${OPTIONAL_SPACE}${number}>`;\n\n/** @internal */\nexport type UNIFORM_TYPES = UNIFORM_TYPES_SINGLE | UNIFORM_TYPES_ARRAY;\n\n/**\n * This is the type of the uniform structures that are used in the UniformGroup.\n * @category rendering\n * @advanced\n */\nexport interface UniformData\n{\n /** the value of the uniform, this could be any object - a parser will figure out how to write it to the buffer */\n value: unknown;\n type: UNIFORM_TYPES;\n /** the size of the variable (eg 2 for vec2, 3 for vec3, 4 for vec4) */\n size?: number;\n name?: string;\n}\n\n/** @internal */\nexport interface UboElement\n{\n data: UniformData;\n offset: number;\n size: number;\n}\n\n/** @internal */\nexport interface UboLayout\n{\n uboElements: UboElement[];\n /** float32 size // TODO change to bytes */\n size: number;\n}\n\n/** @internal */\nexport type UniformsSyncCallback = (...args: any[]) => void;\n"],"names":[],"mappings":";AAEO,MAAM,oBAAuB,GAAA;AAAA,EAChC,KAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AACJ,EAAA;AAMO,MAAM,iBAAoB,GAAA,oBAAA,CAAqB,MAAO,CAAA,CAAC,KAAK,IACnE,KAAA;AACI,EAAA,GAAA,CAAI,IAAI,CAAI,GAAA,IAAA,CAAA;AAEZ,EAAO,OAAA,GAAA,CAAA;AACX,CAAA,EAAG,EAAoC;;;;"}