diff --git a/CHANGELIST.md b/CHANGELIST.md
index bd41771..eb4bec2 100644
--- a/CHANGELIST.md
+++ b/CHANGELIST.md
@@ -1,5 +1,25 @@
# Change List
+### 1.0.0
+
+* switch primitive functions to use named parameters.
+
+### 0.15.0
+
+* add `setIntrinsicsToView`
+
+### 0.14.3
+
+* Fixes for vec2 typos
+
+### 0.14.2
+
+* Handle bool issue fix
+
+### 0.14.0
+
+* Use latest wgsl_reflect
+
### 0.13.0
* Support making views of unsized arrays
diff --git a/README.md b/README.md
index b1e0eb4..d2fd5ce 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,9 @@
See [here](https://greggman.github.io/webgpu-utils/docs)
+* [ChangeList](https://github.com/greggman/webgpu-utils/CHANGELIST.md)
+* [Migration Notes](https://github.com/greggman/webgpu-utils/migration.md)
+
## Random useful things for WebGPU
As I do more WebGPU I find I need more and more helpers to make things
@@ -39,7 +42,7 @@ const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);
// create the correct sized buffer
const uniformBuffer = device.createBuffer({
- size: myUniformBuffer.arrayBuffer.byteLength,
+ size: myUniformValues.arrayBuffer.byteLength,
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
});
@@ -246,7 +249,7 @@ The reason it's this way is it's common to make large arrays of `f32`, `u32`,
`vec2f`, `vec3f`, `vec4f` etc. We wouldn't want every element of an array to
have its own typedarray view.
-You can configure this per type by calling `setIntrinsicsToView`.
+You can configure this per type by calling `setIntrinsicsToView`.
The configuration is global. Given th example above
```js
@@ -311,7 +314,7 @@ const uni1 = makeStructuredView(defs.uniforms.uni1, new ArrayBuffer(4 * 16));
* include from the net
```js
-import { createTextureFromImage } from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js'
+import { createTextureFromImage } from 'https://greggman.github.io/webgpu-utils/dist/1.x/webgpu-utils.module.js'
...
```
@@ -330,6 +333,14 @@ import { createTextureFromImage } from 'webgpu-utils';
...
```
+## Examples
+
+* [2d-array texture](examples/2d-array.html)
+* [cube](examples/cube.html)
+* [cube-map](examples/cube-map.html)
+* [instancing](examples/instancing.html)
+* [primitives](examples/primitives.html)
+
## Development
```
@@ -340,7 +351,7 @@ npm start
```
This will run rollup in watch mode, building from typescript into
-`dist/0.x/webgpu-utils.js`.
+`dist/1.x/webgpu-utils.js`.
```
npx servez
@@ -355,4 +366,3 @@ Super thanks to Brendan Duncan for [wgsl-reflect](https://github.com/brendan-dun
## License
[MIT](LICENSE.md)
-
diff --git a/dist/0.x/primitives.d.ts b/dist/0.x/primitives.d.ts
deleted file mode 100644
index 04bfaf6..0000000
--- a/dist/0.x/primitives.d.ts
+++ /dev/null
@@ -1,214 +0,0 @@
-import { TypedArray } from './typed-arrays.js';
-import { Arrays } from './attribute-utils.js';
-/**
- * A class to provide `push` on a typed array.
- *
- * example:
- *
- * ```js
- * const positions = new TypedArrayWrapper(new Float32Array(300), 3);
- * positions.push(1, 2, 3); // add a position
- * positions.push([4, 5, 6]); // add a position
- * positions.push(new Float32Array(6)); // add 2 positions
- * const data = positions.typedArray;
- * ```
- */
-export declare class TypedArrayWrapper {
- typedArray: T;
- cursor: number;
- numComponents: number;
- constructor(arr: T, numComponents: number);
- get numElements(): number;
- push(...data: (number | Iterable)[]): void;
- reset(index?: number): void;
-}
-/**
- * Creates XY quad vertices
- *
- * The default with no parameters will return a 2x2 quad with values from -1 to +1.
- * If you want a unit quad with that goes from 0 to 1 you'd call it with
- *
- * createXYQuadVertices(1, 0.5, 0.5);
- *
- * If you want a unit quad centered above 0,0 you'd call it with
- *
- * primitives.createXYQuadVertices(1, 0, 0.5);
- *
- * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1
- * @param xOffset the amount to offset the quad in X
- * @param yOffset the amount to offset the quad in Y
- * @return the created XY Quad vertices
- */
-export declare function createXYQuadVertices(size?: number, xOffset?: number, yOffset?: number): Arrays;
-/**
- * Creates XZ plane vertices.
- *
- * The created plane has position, normal, and texcoord data
- *
- * @param width Width of the plane. Default = 1
- * @param depth Depth of the plane. Default = 1
- * @param subdivisionsWidth Number of steps across the plane. Default = 1
- * @param subdivisionsDepth Number of steps down the plane. Default = 1
- * @return The created plane vertices.
- */
-export declare function createPlaneVertices(width?: number, depth?: number, subdivisionsWidth?: number, subdivisionsDepth?: number): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates sphere vertices.
- *
- * The created sphere has position, normal, and texcoord data
- *
- * @param radius radius of the sphere.
- * @param subdivisionsAxis number of steps around the sphere.
- * @param subdivisionsHeight number of vertically on the sphere.
- * @param startLatitudeInRadians where to start the
- * top of the sphere.
- * @param endLatitudeInRadians Where to end the
- * bottom of the sphere.
- * @param startLongitudeInRadians where to start
- * wrapping the sphere.
- * @param endLongitudeInRadians where to end
- * wrapping the sphere.
- * @return The created sphere vertices.
- */
-export declare function createSphereVertices(radius?: number, subdivisionsAxis?: number, subdivisionsHeight?: number, startLatitudeInRadians?: number, endLatitudeInRadians?: number, startLongitudeInRadians?: number, endLongitudeInRadians?: number): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates the vertices and indices for a cube.
- *
- * The cube is created around the origin. (-size / 2, size / 2).
- *
- * @param size width, height and depth of the cube.
- * @return The created vertices.
- */
-export declare function createCubeVertices(size?: number): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates vertices for a truncated cone, which is like a cylinder
- * except that it has different top and bottom radii. A truncated cone
- * can also be used to create cylinders and regular cones. The
- * truncated cone will be created centered about the origin, with the
- * y axis as its vertical axis. .
- *
- * @param bottomRadius Bottom radius of truncated cone.
- * @param topRadius Top radius of truncated cone.
- * @param height Height of truncated cone.
- * @param radialSubdivisions The number of subdivisions around the
- * truncated cone.
- * @param verticalSubdivisions The number of subdivisions down the
- * truncated cone.
- * @param topCap Create top cap. Default = true.
- * @param bottomCap Create bottom cap. Default = true.
- * @return The created cone vertices.
- */
-export declare function createTruncatedConeVertices(bottomRadius?: number, topRadius?: number, height?: number, radialSubdivisions?: number, verticalSubdivisions?: number, topCap?: boolean, bottomCap?: boolean): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates 3D 'F' vertices.
- * An 'F' is useful because you can easily tell which way it is oriented.
- * The created 'F' has position, normal, texcoord, and color arrays.
- *
- * @return The created vertices.
- */
-export declare function create3DFVertices(): {
- [k: string]: Uint8Array | Uint16Array | Float32Array;
-};
-/**
- * Creates crescent vertices.
- *
- * @param verticalRadius The vertical radius of the crescent.
- * @param outerRadius The outer radius of the crescent.
- * @param innerRadius The inner radius of the crescent.
- * @param thickness The thickness of the crescent.
- * @param subdivisionsDown number of steps around the crescent.
- * @param startOffset Where to start arc. Default 0.
- * @param endOffset Where to end arg. Default 1.
- * @return The created vertices.
- */
-export declare function createCrescentVertices(verticalRadius: 2, outerRadius: 1, innerRadius: 0, thickness: 1, subdivisionsDown: 12, startOffset: 0, endOffset: 1): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates cylinder vertices. The cylinder will be created around the origin
- * along the y-axis.
- *
- * @param radius Radius of cylinder.
- * @param height Height of cylinder.
- * @param radialSubdivisions The number of subdivisions around the cylinder.
- * @param verticalSubdivisions The number of subdivisions down the cylinder.
- * @param topCap Create top cap. Default = true.
- * @param bottomCap Create bottom cap. Default = true.
- * @return The created vertices.
- */
-export declare function createCylinderVertices(radius?: number, height?: number, radialSubdivisions?: number, verticalSubdivisions?: number, topCap?: boolean, bottomCap?: boolean): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates vertices for a torus
- *
- * @param radius radius of center of torus circle.
- * @param thickness radius of torus ring.
- * @param radialSubdivisions The number of subdivisions around the torus.
- * @param bodySubdivisions The number of subdivisions around the body torus.
- * @param startAngle start angle in radians. Default = 0.
- * @param endAngle end angle in radians. Default = Math.PI * 2.
- * @return The created vertices.
- */
-export declare function createTorusVertices(radius?: number, thickness?: number, radialSubdivisions?: number, bodySubdivisions?: number, startAngle?: number, endAngle?: number): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
-/**
- * Creates disc vertices. The disc will be in the xz plane, centered at
- * the origin. When creating, at least 3 divisions, or pie
- * pieces, need to be specified, otherwise the triangles making
- * up the disc will be degenerate. You can also specify the
- * number of radial pieces `stacks`. A value of 1 for
- * stacks will give you a simple disc of pie pieces. If you
- * want to create an annulus you can set `innerRadius` to a
- * value > 0. Finally, `stackPower` allows you to have the widths
- * increase or decrease as you move away from the center. This
- * is particularly useful when using the disc as a ground plane
- * with a fixed camera such that you don't need the resolution
- * of small triangles near the perimeter. For example, a value
- * of 2 will produce stacks whose outside radius increases with
- * the square of the stack index. A value of 1 will give uniform
- * stacks.
- *
- * @param radius Radius of the ground plane.
- * @param divisions Number of triangles in the ground plane (at least 3).
- * @param stacks Number of radial divisions (default=1).
- * @param innerRadius Default 0.
- * @param stackPower Power to raise stack size to for decreasing width.
- * @return The created vertices.
- */
-export declare function createDiscVertices(radius?: number, divisions?: number, stacks?: number, innerRadius?: number, stackPower?: number): {
- position: Float32Array;
- normal: Float32Array;
- texcoord: Float32Array;
- indices: Uint16Array;
-};
diff --git a/dist/0.x/webgpu-utils.js.map b/dist/0.x/webgpu-utils.js.map
deleted file mode 100644
index 6f7407a..0000000
--- a/dist/0.x/webgpu-utils.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"webgpu-utils.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created.\n *\n * To reset all types to the default call it with no arguments\n *\n * @param types array of types to make views for\n * @param flatten whether to flatten or expand the specified types.\n */\nexport function setIntrinsicsToView(types: readonly kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}\n","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type.\n * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray\n *\n * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not\n * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2.\n * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3.\n *\n * For attribute formats, guesses are made based on type and number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";;;;;;;IAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,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u-utils.min.js.map b/dist/0.x/webgpu-utils.min.js.map
deleted file mode 100644
index 6ed20a1..0000000
--- a/dist/0.x/webgpu-utils.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"webgpu-utils.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created.\n *\n * To reset all types to the default call it with no arguments\n *\n * @param types array of types to make views for\n * @param flatten whether to flatten or expand the specified types.\n */\nexport function setIntrinsicsToView(types: readonly kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}\n","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type.\n * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray\n *\n * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not\n * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2.\n * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3.\n *\n * For attribute formats, guesses are made based on type and number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":["roundUpToMultipleOf","v","multiple","isTypedArray","arr","length","buffer","ArrayBuffer","byteLength","b","i32","numElements","align","size","type","View","Int32Array","u32","Uint32Array","f32","Float32Array","f16","Uint16Array","vec2f","vec2i","vec2u","vec2h","vec3i","vec3u","vec3f","vec3h","vec4i","vec4u","vec4f","vec4h","mat2x2f","mat2x2h","mat3x2f","mat3x2h","mat4x2f","mat4x2h","mat2x3f","pad","mat2x3h","mat3x3f","mat3x3h","mat4x3f","mat4x3h","mat2x4f","mat2x4h","mat3x4f","mat3x4h","mat4x4f","mat4x4h","bool","typeInfo","kTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","getSizeOfTypeDef","typeDef","asArrayDef","elementType","asStructDef","fields","asIntrinsicDef","makeIntrinsicTypedArrayView","baseOffset","isArray","undefined","sizeInBytes","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","makeTypedArrayViews","arrayBuffer","offset","makeViews","elementSize","effectiveNumElements","fn","i","Array","fill","map","_","views","name","entries","setStructuredView","data","view","dataLen","stride","set","asArray","forEach","newValue","ndx","asViews","key","s_views","WeakMap","getView","Ctor","viewsByCtor","get","Map","getViewsByCtor","setIntrinsicFromArrayLikeOfNumber","index","setTypedValues","isArrayLikeOfNumber","fieldDef","ParseContext","constructor","this","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","Statement","super","Function","args","returnType","body","StaticAssert","expression","While","condition","Continuing","For","init","increment","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","_a","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","Math","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","max","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","ConstExpr","initializer","_b","property","postfix","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","rule","TokenTypes","none","reserved","eof","token","asm","bf16","do","enum","f64","handle","i8","i16","i64","mat","premerge","regardless","typedef","u8","u16","u64","unless","using","vec","void","keywords","array","keyword","atomic","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","ptr","sampler","sampler_comparison","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_external","vec2","vec3","vec4","bitcast","block","break","case","continue","default","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","switch","true","alias","uniform","var","override","workgroup","write","r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm_srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm_srgb","rgb10a2unorm","rg11b10float","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","static_assert","tokens","decimal_float_literal","hex_float_literal","int_literal","uint_literal","ident","and","and_and","arrow","attr","attr_left","attr_right","forward_slash","bang","bracket_left","bracket_right","brace_left","brace_right","colon","comma","equal","equal_equal","not_equal","greater_than","greater_than_equal","shift_right","less_than","less_than_equal","shift_left","modulo","minus","minus_minus","period","plus","plus_plus","or","or_or","paren_left","paren_right","semicolon","star","tilde","underscore","xor","plus_equal","minus_equal","times_equal","division_equal","modulo_equal","and_equal","or_equal","xor_equal","shift_right_equal","shift_left_equal","storage_class","access_mode","sampler_type","sampled_texture_type","multisampled_texture_type","storage_texture_type","depth_texture_type","texture_external_type","any_texture_type","texel_format","const_literal","literal_or_ident","element_count_expression","template_types","attribute_name","assignment_operators","increment_operators","Token","lexeme","line","isTemplateType","indexOf","isArrayType","isArrayOrTemplateType","WgslScanner","source","_tokens","_start","_current","_line","_source","scanTokens","_isAtEnd","scanToken","push","_advance","_isWhitespace","_peekAhead","commentLevel","matchType","matchedType","_findType","nextLexeme","foundLessThan","ti","_addToken","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_context","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","scanner","_error","message","error","_peek","_check","l","_consume","tk","t","_previous","_type_alias","_enable_directive","attrs","_attribute","_var","_global_variable_decl","_override","_override_variable_decl","_let","_global_let_decl","_const","_global_const_decl","_struct","_struct_decl","_fn","_function_decl","argAttrs","typeAttrs","_type_decl","_return","_compound_statement","_statement","_if_statement","_switch_statement","_loop_statement","_for_statement","_while_statement","_continuing_statement","_static_assert_statement","result","_return_statement","_variable_statement","_increment_decrement_statement","_func_call_statement","_assignment_statement","_optional_paren_expression","_for_init","_short_circuit_or_expression","_for_increment","_variable_decl","savedPos","_unary_expression","decrement","isUnderscore","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","_c","_d","selectors","_shift_expression","nextStatement","_match_elseif","_elseif_statement","expr","_short_circuit_and_expr","_inclusive_or_expression","_exclusive_or_expression","_and_expression","_equality_expression","_relational_expression","_additive_expression","_multiplicative_expression","_singular_expression","_primary_expression","p","_postfix_expression","_getStruct","parseFloat","_paren_expression","arg","memberAttrs","memberName","memberType","structNode","_const_expression","_override_decl","valueExpr","constValue","aliasType","aliasNode","typeName","_texture_sampler_types","pointer","decl","countInt","parseInt","TypeInfo","isTemplate","MemberInfo","StructInfo","ArrayInfo","TemplateInfo","VariableInfo","group","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","WgslReflect","code","uniforms","textures","samplers","overrides","entry","_types","update","_isStorageTexture","ast","node","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_getInputs","_getOutputs","getBindGroups","groups","_makeRoom","u","_getStructOutputs","output","_getOutputInfo","m","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","_getAlias","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","arrayType","E","_textureTypes","_samplerTypes","defaultValue","k","getNamedVariables","reflect","variables","fromEntries","typeDefinition","addType","makeStructDefinition","structInfo","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","texture","perDeviceInfo","pipelineByFormat","moduleByView","getViewDimensionForTexture","module","createShaderModule","label","createSampler","minFilter","createRenderPipeline","layout","entryPoint","targets","pipeline","encoder","createCommandEncoder","baseMipLevel","mipLevelCount","baseArrayLayer","bindGroup","createBindGroup","getBindGroupLayout","resource","createView","arrayLayerCount","renderPassDescriptor","colorAttachments","loadOp","storeOp","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","queue","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","filter","arrayName","totalNumComponents","getArray","getNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","subarray","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","viewDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","layer","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","createTexture","mips","usage","GPUTextureUsage","TEXTURE_BINDING","COPY_DST","RENDER_ATTACHMENT","async","loadImageBitmap","url","res","fetch","blob","opt","colorSpaceConversion","createImageBitmap","createTextureFromImages","urls","Promise","all","TypedArrayWrapper","cursor","reset","createAugmentedTypedArray","CUBE_FACE_INDICES","createTruncatedConeVertices","bottomRadius","topRadius","radialSubdivisions","verticalSubdivisions","topCap","bottomCap","extra","numVertices","positions","normals","texcoords","indices","vertsAroundEdge","slant","cosSlant","sinSlant","yy","ringRadius","y","ii","position","normal","texcoord","expandRLEData","rleData","padding","runLength","element","jj","colors","numVerts","color","verticalRadius","outerRadius","innerRadius","thickness","subdivisionsDown","startOffset","endOffset","offsetRange","lerp","vAdd","vMultiply","createArc","arcRadius","x","normalMult","normalAdd","uMult","uAdd","z","uBack","xBack","angle","radius","px","py","pz","createSurface","leftArcOffset","rightArcOffset","numVerticesDown","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","divisions","stacks","stackPower","firstIndex","radiusSpan","pointsPerStack","stack","stackRadius","theta","d","subdivisionsWidth","subdivisionsDepth","numVertsAcross","subdivisionsAxis","subdivisionsHeight","startLatitudeInRadians","endLatitudeInRadians","startLongitudeInRadians","endLongitudeInRadians","latRange","longRange","phi","sinTheta","cosTheta","sinPhi","ux","uy","uz","numVertsAround","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","xOffset","yOffset","byteOffset","alignment","numBytes","buffers","bufferNdx","attribs","attrib0","data0","createBuffer","GPUBufferUsage","VERTEX","mappedAtCreation","getMappedRange","unmap","buffersAndAttributes","indicesEntry","find","indexBuffer","INDEX","indexFormat","storages","varDef","asVarDef"],"mappings":"mPAAO,MAAMA,EAAsB,CAACC,EAAWC,MAAwBD,EAAIC,EAAW,GAAKA,EAAY,GAAKA,ECkD/F,MAAAC,EAAgBC,GAC3BA,GAA6B,iBAAfA,EAAIC,QAAuBD,EAAIE,kBAAkBC,aAAyC,iBAAnBH,EAAII,WC3BrFC,EAAuC,CAC3CC,IAAK,CAAEC,YAAa,EAAGC,MAAO,EAAGC,KAAM,EAAGC,KAAM,MAAOC,KAAMC,YAC7DC,IAAK,CAAEN,YAAa,EAAGC,MAAO,EAAGC,KAAM,EAAGC,KAAM,MAAOC,KAAMG,aAC7DC,IAAK,CAAER,YAAa,EAAGC,MAAO,EAAGC,KAAM,EAAGC,KAAM,MAAOC,KAAMK,cAC7DC,IAAK,CAAEV,YAAa,EAAGC,MAAO,EAAGC,KAAM,EAAGC,KAAM,MAAOC,KAAMO,aAE7DC,M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AUxE,OAAOyoB,YAAYF,EAAQ/jB,QAAQnC,KAAIwmB,GAC5C,CAACA,EAAWrmB,KAAMomB,GAAqBL,EAASM,EAAY,OAGjEhF,EAAWyE,GAAkBC,EAASA,EAAQ1E,UAGpD,MAAO,CACHrf,UACA43B,SAJa9T,GAAkBC,EAASA,EAAQxiB,SAKhD8d,WAER,uBF6RM,SAA6BwY,EAA+Cz6B,EAA2BC,EAAS,GAClH,MAAMy6B,EAAWD,EAEX95B,EAAQZ,OADqBN,IAAnBi7B,EAAS/Z,MAAsB8Z,EAA6BC,EAAS5T,eAC1C9mB,EAAaC,GACxD,MAAO,IACAU,EACH,GAAAQ,CAAIJ,GACAD,EAAkBC,EAAMJ,EAAMA,MACjC,EAET,oIAyFM,SAA8B85B,EAA4B15B,EAAWf,EAA0BC,EAAS,GAC1GmC,EAAeq4B,EAAO3T,eAAgB/lB,EAAMf,EAAaC,EAC7D,+DDze+CnF,EAAiBmF,EAAgBlF,GAC9E,OAAOD,EAAImzB,SAAShuB,EAAQA,EAASlF,EACvC","x_google_ignoreList":[3]}
\ No newline at end of file
diff --git a/dist/0.x/webgpu-utils.module.js.map b/dist/0.x/webgpu-utils.module.js.map
deleted file mode 100644
index 7340cf3..0000000
--- a/dist/0.x/webgpu-utils.module.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"webgpu-utils.module.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created.\n *\n * To reset all types to the default call it with no arguments\n *\n * @param types array of types to make views for\n * @param flatten whether to flatten or expand the specified types.\n */\nexport function setIntrinsicsToView(types: readonly kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}\n","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array