/** * Says in WGSL what an effect says in GLSL. * * The effects are written once, in GLSL. WebGPU reads WGSL, which has the * same functions under the same names and another way to write nearly * everything else. What is translated here is what effects are made of: * * float, int, bool, vec2 to vec4, mat2 to mat4, as types and as makers * variables, constants and functions; `for`, `if`, `return` * a ? b : c * mod( a, b ), atan( y, x ), inversesqrt, dFdx, dFdy * * What has no translation, and is therefore not used by the effects that * come with the library: * * `out` and `inout`, structs, arrays, the preprocessor * functions that take a vector and a number where WGSL wants two * vectors: `max( v, 0.0 )` is `max( v, vec2( 0.0 ) )` in both * writing to several parts of a vector at once: `p.xy = q` is * `p = vec3( q, p.z )` in both * * WGSL keeps many words to itself, `from` and `filter` among them, that * are good names in GLSL. So every variable gets a `_` behind its name, * which no word of WGSL has. Functions keep their names. */ /** * @param glsl Functions, constants and what is in them. * @return The same in WGSL. */ export declare function wgsl(glsl: string): string; /** * Gives names in a piece of code other names: what `#define` does in GLSL. * * @param code Code. * @param names Names and what to write for them. * @param not What must not follow a name, as * the source of a regular expression. * @return Code. */ export declare function rename(code: string, names: Record, not?: string): string;