From 36d16bc0b6b2211396d7ed7e6647a144808a8fd2 Mon Sep 17 00:00:00 2001 From: greggman Date: Wed, 11 Sep 2024 00:55:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20greggman?= =?UTF-8?q?/webgpu-utils@d10d1575752d1d0b38988ac82b9bdb8acdf0ce11=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 + dist/1.x/buffer-views.d.ts | 141 +++++++++++++++++++++++- dist/1.x/data-definitions.d.ts | 27 ++++- dist/1.x/webgpu-utils.js | 137 ++++++++++++++++++++++- dist/1.x/webgpu-utils.js.map | 2 +- dist/1.x/webgpu-utils.min.js.map | 2 +- dist/1.x/webgpu-utils.module.js | 137 ++++++++++++++++++++++- dist/1.x/webgpu-utils.module.js.map | 2 +- dist/1.x/webgpu-utils.module.min.js.map | 2 +- docs/functions/makeStructuredView.html | 29 +++++ docs/index.html | 1 + docs/types/ShaderDataDefinitions.html | 43 ++++++-- docs/types/StructuredView.html | 2 +- index.html | 3 +- package-lock.json | 4 +- package.json | 2 +- src/buffer-views.ts | 141 +++++++++++++++++++++++- src/data-definitions.ts | 27 ++++- 18 files changed, 673 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index afe66e7..94328a0 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ mat4.perspective( device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer); ``` +See [makeStructuredView](https://greggman.github.io/webgpu-utils/docs/functions/makeStructuredView.html) for details. + ### Load an image URL as a texture (with mips) ```js diff --git a/dist/1.x/buffer-views.d.ts b/dist/1.x/buffer-views.d.ts index fdd745f..d958163 100644 --- a/dist/1.x/buffer-views.d.ts +++ b/dist/1.x/buffer-views.d.ts @@ -139,15 +139,15 @@ export type StructuredView = ArrayBufferViews & { * sat: f32, * lum: f32, * }; - * struct MyUniforms { + * struct MyStorage { * colors: array, * brightness: f32, * kernel: array, * }; - * @group(0) @binding(0) var myUniforms: MyUniforms; + * @group(0) @binding(0) var myStorage: MyStorage; * `; * const defs = makeShaderDataDefinitions(code); - * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms); + * const myUniformValues = makeStructuredView(defs.storages.myStorage); * * myUniformValues.set({ * colors: [ @@ -170,11 +170,146 @@ export type StructuredView = ArrayBufferViews & { }; /** * Given a VariableDefinition, create matching TypedArray views + * * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions} * @param arrayBuffer Optional ArrayBuffer for the views * @param offset Optional offset into the ArrayBuffer for the views * @returns TypedArray views for the various named fields of the structure as well * as a `set` function to make them easy to set, and the arrayBuffer + * + * ```js + * const code = ` + * struct HSL { + * hue: f32, + * sat: f32, + * lum: f32, + * }; + * struct MyStorage { + * colors: array, + * brightness: f32, + * kernel: array, + * }; + * @group(0) @binding(0) var myStorage: MyStorage; + * `; + * const defs = makeShaderDataDefinitions(code); + * const myUniformValues = makeStructuredView(defs.storages.myStorage); + * + * myUniformValues.set({ + * colors: [ + * , + * , + * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color + * ], + * brightness: 0.8, + * kernel: [ + * 1, 0, -1, + * 2, 0, -2, + * 1, 0, -1, + * ], + * }); + * ``` + * + * data definition can come from ` + * + * What this function does: + * + * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer) + * + * 2. It makes `TypedArray` views of to match the definition. + * + * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper + * for `setStructView` that passes in the views. + * + * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL + * + * ```wgsl + * struct Light { + * lightWorldPosition: vec3f, + * shininess: f32, + * lightDirection: vec3f, + * innerLimit: f32, + * outerLimit: f32, + * }; + * struct Uniforms { + * normalMatrix: mat3x3f, + * worldViewProjection: mat4x4f, + * world: mat4x4f, + * color: vec4f, + * viewWorldPosition: vec3f, + * lights: array, + * }; + * @group(0) @binding(0) var myUniforms: Uniforms; + * ``` + * + * `makeStructuredView(defs.uniforms.myUniforms)` would return this + * + * ```js + * const arrayBuffer = new ArrayBuffer(368) + * const views = { + * normalMatrix: new Float32Array(arrayBuffer, 0, 12), + * worldViewProjection: new Float32Array(arrayBuffer, 48, 16), + * world: new Float32Array(arrayBuffer, 112, 16), + * color: new Float32Array(arrayBuffer, 176, 4), + * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3), + * lights: [ + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3), + * shininess: new Float32Array(arrayBuffer, 220, 1), + * lightDirection: new Float32Array(arrayBuffer, 224, 3), + * innerLimit: new Float32Array(arrayBuffer, 236, 1), + * outerLimit: new Float32Array(arrayBuffer, 240, 1), + * }, + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3), + * shininess: new Float32Array(arrayBuffer, 268, 1), + * lightDirection: new Float32Array(arrayBuffer, 272, 3), + * innerLimit: new Float32Array(arrayBuffer, 284, 1), + * outerLimit: new Float32Array(arrayBuffer, 288, 1), + * }, + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3), + * shininess: new Float32Array(arrayBuffer, 316, 1), + * lightDirection: new Float32Array(arrayBuffer, 320, 3), + * innerLimit: new Float32Array(arrayBuffer, 332, 1), + * outerLimit: new Float32Array(arrayBuffer, 336, 1), + * }, + * ], + * mode: new Uint32Array(UniformsValues, 352, 1), + * }; + * result = { + * arrayBuffer, + * views, + * set(data: any) { + * setStructuredView(data, views.views); + * }, + * } + * ``` + * + * From this, you can see you can set the value in the array buffer for any field/member/property + * directly. Example + * + * ```js + * result.views.lights[2].lightDirection.set([7, 8, 9]); + * result.views.lights[2].innerLimit[0] = 4; + * ``` + * + * `set` just takes a JS object and matches property names to the view names. + * + * ```js + * result.set({ + * color: [1, 1, 0, 1], + * viewWorldPosition: [12, 34, 56], + * mode: 8, + * }); + * ``` + * + * Is equivalent to + * + * ```js + * result.views.color.set([1, 1, 0, 1]); + * result.views.worldViewPosition.set([12, 34, 56]); + * result.views.mode[0] = 8; + * ``` */ export declare function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset?: number): StructuredView; /** diff --git a/dist/1.x/data-definitions.d.ts b/dist/1.x/data-definitions.d.ts index cf50d13..87b571e 100644 --- a/dist/1.x/data-definitions.d.ts +++ b/dist/1.x/data-definitions.d.ts @@ -57,17 +57,40 @@ export type EntryPoints = { [x: string]: EntryPoint; }; /** - * Warning: The properties of this type will probably be changed - * in a future version. Please consider this an opaque type. + * The data definitions and other reflection data from some WGSL shader source. */ export type ShaderDataDefinitions = { + /** + * definitions for uniform bindings by name + */ uniforms: VariableDefinitions; + /** + * definitions for storage bindings by name + */ storages: VariableDefinitions; + /** + * definitions for sampler bindings by name + */ samplers: VariableDefinitions; + /** + * definitions for texture bindings by name + */ textures: VariableDefinitions; + /** + * definitions for storage texture bindings by name + */ storageTextures: VariableDefinitions; + /** + * definitions for external texture bindings by name + */ externalTextures: VariableDefinitions; + /** + * definitions for structures by name + */ structs: StructDefinitions; + /** + * Entry points by name. + */ entryPoints: EntryPoints; }; /** diff --git a/dist/1.x/webgpu-utils.js b/dist/1.x/webgpu-utils.js index 569e7c0..f744b6d 100644 --- a/dist/1.x/webgpu-utils.js +++ b/dist/1.x/webgpu-utils.js @@ -1,4 +1,4 @@ -/* webgpu-utils@1.9.2, license MIT */ +/* webgpu-utils@1.9.3, license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -389,11 +389,146 @@ } /** * Given a VariableDefinition, create matching TypedArray views + * * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions} * @param arrayBuffer Optional ArrayBuffer for the views * @param offset Optional offset into the ArrayBuffer for the views * @returns TypedArray views for the various named fields of the structure as well * as a `set` function to make them easy to set, and the arrayBuffer + * + * ```js + * const code = ` + * struct HSL { + * hue: f32, + * sat: f32, + * lum: f32, + * }; + * struct MyStorage { + * colors: array, + * brightness: f32, + * kernel: array, + * }; + * @group(0) @binding(0) var myStorage: MyStorage; + * `; + * const defs = makeShaderDataDefinitions(code); + * const myUniformValues = makeStructuredView(defs.storages.myStorage); + * + * myUniformValues.set({ + * colors: [ + * , + * , + * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color + * ], + * brightness: 0.8, + * kernel: [ + * 1, 0, -1, + * 2, 0, -2, + * 1, 0, -1, + * ], + * }); + * ``` + * + * data definition can come from ` + * + * What this function does: + * + * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer) + * + * 2. It makes `TypedArray` views of to match the definition. + * + * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper + * for `setStructView` that passes in the views. + * + * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL + * + * ```wgsl + * struct Light { + * lightWorldPosition: vec3f, + * shininess: f32, + * lightDirection: vec3f, + * innerLimit: f32, + * outerLimit: f32, + * }; + * struct Uniforms { + * normalMatrix: mat3x3f, + * worldViewProjection: mat4x4f, + * world: mat4x4f, + * color: vec4f, + * viewWorldPosition: vec3f, + * lights: array, + * }; + * @group(0) @binding(0) var myUniforms: Uniforms; + * ``` + * + * `makeStructuredView(defs.uniforms.myUniforms)` would return this + * + * ```js + * const arrayBuffer = new ArrayBuffer(368) + * const views = { + * normalMatrix: new Float32Array(arrayBuffer, 0, 12), + * worldViewProjection: new Float32Array(arrayBuffer, 48, 16), + * world: new Float32Array(arrayBuffer, 112, 16), + * color: new Float32Array(arrayBuffer, 176, 4), + * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3), + * lights: [ + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3), + * shininess: new Float32Array(arrayBuffer, 220, 1), + * lightDirection: new Float32Array(arrayBuffer, 224, 3), + * innerLimit: new Float32Array(arrayBuffer, 236, 1), + * outerLimit: new Float32Array(arrayBuffer, 240, 1), + * }, + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3), + * shininess: new Float32Array(arrayBuffer, 268, 1), + * lightDirection: new Float32Array(arrayBuffer, 272, 3), + * innerLimit: new Float32Array(arrayBuffer, 284, 1), + * outerLimit: new Float32Array(arrayBuffer, 288, 1), + * }, + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3), + * shininess: new Float32Array(arrayBuffer, 316, 1), + * lightDirection: new Float32Array(arrayBuffer, 320, 3), + * innerLimit: new Float32Array(arrayBuffer, 332, 1), + * outerLimit: new Float32Array(arrayBuffer, 336, 1), + * }, + * ], + * mode: new Uint32Array(UniformsValues, 352, 1), + * }; + * result = { + * arrayBuffer, + * views, + * set(data: any) { + * setStructuredView(data, views.views); + * }, + * } + * ``` + * + * From this, you can see you can set the value in the array buffer for any field/member/property + * directly. Example + * + * ```js + * result.views.lights[2].lightDirection.set([7, 8, 9]); + * result.views.lights[2].innerLimit[0] = 4; + * ``` + * + * `set` just takes a JS object and matches property names to the view names. + * + * ```js + * result.set({ + * color: [1, 1, 0, 1], + * viewWorldPosition: [12, 34, 56], + * mode: 8, + * }); + * ``` + * + * Is equivalent to + * + * ```js + * result.views.color.set([1, 1, 0, 1]); + * result.views.worldViewPosition.set([12, 34, 56]); + * result.views.mode[0] = 8; + * ``` */ function makeStructuredView(varDef, arrayBuffer, offset = 0) { const asVarDef = varDef; diff --git a/dist/1.x/webgpu-utils.js.map b/dist/1.x/webgpu-utils.js.map index 07d0140..9986c65 100644 --- a/dist/1.x/webgpu-utils.js.map +++ b/dist/1.x/webgpu-utils.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * Warning: The properties of this type will probably be changed\n * in a future version. Please consider this an opaque type.\n */\nexport type ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n samplers: VariableDefinitions,\n textures: VariableDefinitions,\n storageTextures: VariableDefinitions,\n externalTextures: VariableDefinitions,\n structs: StructDefinitions,\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\n}\n\n"],"names":[],"mappings":";;;;;;;IAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,CAAC;IAE/G,SAAU,MAAM,CAAmB,GAA0B,EAAA;IACjE,IAAA,OAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAsB,CAAC;IAChD,CAAC;IAEe,SAAA,KAAK,CAAI,KAAa,EAAE,EAAoB,EAAA;QACxD,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD;;UCkBa,uBAAuB,CAAA;IAChC,IAAA,WAAW,CAAc;IACzB,IAAA,UAAU,CAAS;IAEnB,IAAA,WAAA,CAAY,WAAmB,EAAA;YAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,WAAW,CA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SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9C,QAAA,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YAE9C,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YACvC,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;;IAGxB,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IACxB,KAAA;IAED,IAAA,OAAO,OAAO,CAAC;IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 *\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 *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 * data definition can come from `\n *\n * What this function does:\n *\n * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer)\n *\n * 2. It makes `TypedArray` views of to match the definition.\n *\n * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper\n * for `setStructView` that passes in the views.\n *\n * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL\n *\n * ```wgsl\n * struct Light {\n * lightWorldPosition: vec3f,\n * shininess: f32,\n * lightDirection: vec3f,\n * innerLimit: f32,\n * outerLimit: f32,\n * };\n * struct Uniforms {\n * normalMatrix: mat3x3f,\n * worldViewProjection: mat4x4f,\n * world: mat4x4f,\n * color: vec4f,\n * viewWorldPosition: vec3f,\n * lights: array,\n * };\n * @group(0) @binding(0) var myUniforms: Uniforms;\n * ```\n *\n * `makeStructuredView(defs.uniforms.myUniforms)` would return this\n *\n * ```js\n * const arrayBuffer = new ArrayBuffer(368)\n * const views = {\n * normalMatrix: new Float32Array(arrayBuffer, 0, 12),\n * worldViewProjection: new Float32Array(arrayBuffer, 48, 16),\n * world: new Float32Array(arrayBuffer, 112, 16),\n * color: new Float32Array(arrayBuffer, 176, 4),\n * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3),\n * lights: [\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3),\n * shininess: new Float32Array(arrayBuffer, 220, 1),\n * lightDirection: new Float32Array(arrayBuffer, 224, 3),\n * innerLimit: new Float32Array(arrayBuffer, 236, 1),\n * outerLimit: new Float32Array(arrayBuffer, 240, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3),\n * shininess: new Float32Array(arrayBuffer, 268, 1),\n * lightDirection: new Float32Array(arrayBuffer, 272, 3),\n * innerLimit: new Float32Array(arrayBuffer, 284, 1),\n * outerLimit: new Float32Array(arrayBuffer, 288, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3),\n * shininess: new Float32Array(arrayBuffer, 316, 1),\n * lightDirection: new Float32Array(arrayBuffer, 320, 3),\n * innerLimit: new Float32Array(arrayBuffer, 332, 1),\n * outerLimit: new Float32Array(arrayBuffer, 336, 1),\n * },\n * ],\n * mode: new Uint32Array(UniformsValues, 352, 1),\n * };\n * result = {\n * arrayBuffer,\n * views,\n * set(data: any) {\n * setStructuredView(data, views.views);\n * },\n * }\n * ```\n *\n * From this, you can see you can set the value in the array buffer for any field/member/property\n * directly. Example\n *\n * ```js\n * result.views.lights[2].lightDirection.set([7, 8, 9]);\n * result.views.lights[2].innerLimit[0] = 4;\n * ```\n *\n * `set` just takes a JS object and matches property names to the view names.\n *\n * ```js\n * result.set({\n * color: [1, 1, 0, 1],\n * viewWorldPosition: [12, 34, 56],\n * mode: 8,\n * });\n * ```\n *\n * Is equivalent to\n *\n * ```js\n * result.views.color.set([1, 1, 0, 1]);\n * result.views.worldViewPosition.set([12, 34, 56]);\n * result.views.mode[0] = 8;\n * ```\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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * The data definitions and other reflection data from some WGSL shader source.\n */\nexport type ShaderDataDefinitions = {\n /**\n * definitions for uniform bindings by name\n */\n uniforms: VariableDefinitions,\n /**\n * definitions for storage bindings by name\n */\n storages: VariableDefinitions,\n /**\n * definitions for sampler bindings by name\n */\n samplers: VariableDefinitions,\n /**\n * definitions for texture bindings by name\n */\n textures: VariableDefinitions,\n /**\n * definitions for storage texture bindings by name\n */\n storageTextures: VariableDefinitions,\n /**\n * definitions for external texture bindings by name\n */\n externalTextures: VariableDefinitions,\n /**\n * definitions for structures by name\n */\n structs: StructDefinitions,\n /**\n * Entry points by name.\n */\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\n}\n\n"],"names":[],"mappings":";;;;;;;IAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,CAAC;IAE/G,SAAU,MAAM,CAAmB,GAA0B,EAAA;IACjE,IAAA,OAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAsB,CAAC;IAChD,CAAC;IAEe,SAAA,KAAK,CAAI,KAAa,EAAE,EAAoB,EAAA;QACxD,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD;;UCkBa,uBAAuB,CAAA;IAChC,IAAA,WAAW,CAAc;IACzB,IAAA,UAAU,CAAS;IAEnB,IAAA,WAAA,CAAY,WAAmB,EAAA;YAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;IAChD,QAAA,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;SACvB;IACD,IAAA,KAAK,CAAC,SAAiB,EAAA;YACnB,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;SACrE;IACD,IAAA,GAAG,CAAC,QAAgB,EAAA;IAChB,QAAA,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC;SAC/B;QACD,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AQ,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YAE9C,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YACvC,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;;IAGxB,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IACxB,KAAA;IAED,IAAA,OAAO,OAAO,CAAC;IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]} \ No newline at end of file diff --git a/dist/1.x/webgpu-utils.min.js.map b/dist/1.x/webgpu-utils.min.js.map index 7a4b26b..8bd89d4 100644 --- a/dist/1.x/webgpu-utils.min.js.map +++ b/dist/1.x/webgpu-utils.min.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * Warning: The properties of this type will probably be changed\n * in a future version. Please consider this an opaque type.\n */\nexport type ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n samplers: VariableDefinitions,\n textures: VariableDefinitions,\n storageTextures: VariableDefinitions,\n externalTextures: VariableDefinitions,\n structs: StructDefinitions,\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\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","kWGSLTypeInfo","kWGSLTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","makeIntrinsicTypedArrayView","typeDef","baseOffset","isArray","undefined","sizeInBytes","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","fields","elementType","makeTypedArrayViews","arrayBuffer","offset","asArrayDef","asStructDef","asIntrinsicDef","getSizeOfTypeDef","makeViews","getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef","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","getAlignmentOfTypeDef","values","reduce","max","Math","unalignedSize","lastField","pop","ParseContext","constructor","this","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","search","callback","searchBlock","block","_BlockStart","instance","node","_BlockEnd","Statement","super","Function","args","returnType","body","startLine","endLine","calls","StaticAssert","expression","While","condition","Continuing","For","init","increment","_a","_b","_c","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Requires","extensions","Diagnostic","severity","rule","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","postfix","constant","ConstExpr","initializer","property","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","ArrayIndex","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","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","break","case","continue","default","diagnostic","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","requires","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","simpleTokens","literalTokens","regexTokens","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","simpleToken","_addToken","matchType","isAlpha","_isAlpha","isUnderscore","_isAlphaNumeric","nextChar","matchedType","_findType","nextLexeme","foundLessThan","ti","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_currentLine","_context","_deferArrayCountEval","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","arrayDecl","arrayType","countNode","e","scanner","_error","message","_peek","_check","l","_consume","tk","t","_previous","_type_alias","directive","_diagnostic","_requires_directive","_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","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","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","arrayIndex","_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","inUse","ArrayInfo","TemplateInfo","VariableInfo","group","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","resources","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","_FunctionResources","WgslReflect","code","uniforms","textures","samplers","overrides","entry","functions","_types","_functions","update","_isStorageTexture","ast","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_findResources","_getInputs","_getOutputs","_addCalls","u","_markStructsInUse","m","_getAlias","call","findResource","_findResource","_markStructsFromAST","isEntry","self","varStack","callFn","r","getBindGroups","groups","_makeRoom","_getStructOutputs","output","_getOutputInfo","typeInfo","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","E","_textureTypes","_samplerTypes","defaultValue","k","getStageResources","defs","stageFlags","entryPoint","entryPointName","ep","entryPoints","filter","getEntryPointForStage","byBinding","getNamedVariables","reflect","variables","fromEntries","typeDefinition","addType","addVariableType","makeStructDefinition","structInfo","getTextureSampleType","getViewDimension","getStorageTextureAccess","getSamplerType","endsWith","getBindGroupLayoutEntry","resource","visibility","minBindingSize","externalTexture","multisampled","texture","sampleType","viewDimension","storageTexture","addEntryPoints","funcInfos","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","textureBindingViewDimension","perDeviceInfo","pipelineByFormatAndView","moduleByViewType","uniformBuffer","uniformValues","guessTextureBindingViewDimensionForTexture","module","textureSnippet","sampleSnippet","getMipmapGenerationWGSL","createShaderModule","label","createSampler","minFilter","magFilter","createBuffer","usage","GPUBufferUsage","UNIFORM","COPY_DST","assign","createRenderPipeline","layout","targets","pipeline","baseMipLevel","mipLevelCount","baseArrayLayer","queue","writeBuffer","bindGroup","createBindGroup","getBindGroupLayout","createView","renderPassDescriptor","colorAttachments","arrayLayerCount","loadOp","storeOp","encoder","createCommandEncoder","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","getNumComponents","arrayName","getArray","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","totalNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","subarray","setVertexAndIndexBuffers","passEncoder","buffersAndAttributes","firstVertexBufferIndex","buffers","setVertexBuffer","indexBuffer","setIndexBuffer","indexFormat","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","tempTexture","layer","dstTexture","copyOrigin","createTexture","GPUTextureUsage","COPY_SRC","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","copyTextureToTexture","destroy","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","mips","TEXTURE_BINDING","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","allButIndices","x","z","len","subtract","cross","colors","numVerts","color","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","radius","divisions","stacks","innerRadius","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","thickness","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","inSize","xOffset","yOffset","indicesP","newVertices","channel","srcBuffer","dstBuffer","existingArray","createAugmentedTypedArrayFromExisting","p0","p1","p2","n0","n1","byteOffset","alignment","numBytes","bufferNdx","attribs","attrib0","data0","VERTEX","mappedAtCreation","getMappedRange","unmap","indicesEntry","find","INDEX","drawIndexed","varDef","asVarDef","desc","GPUShaderStage","FRAGMENT","COMPUTE","bindGroupLayoutDescriptorsByGroupByBinding","bindingsToBindGroupEntry","descriptors","sort","storages","storageTextures","externalTextures"],"mappings":"mPAAO,MAAMA,EAAsB,CAACC,EAAWC,MAAwBD,EAAIC,EAAW,GAAKA,EAAY,GAAKA,ECoD/F,MAAAC,EAAgBC,GAC3BA,GAA6B,iBAAfA,EAAIC,QAAuBD,EAAIE,kBAAkBC,aAAyC,iBAAnBH,EAAII,WClCrFC,EAAmB,CACvBC,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,MAAO,CAAEZ,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMK,cACjEI,MAAO,CAAEb,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMC,YACjES,MAAO,CAAEd,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMG,aACjEQ,MAAO,CAAEf,Y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vB,GAAqB,qBAAhBA,EAAEa,KAAKoF,QAWpFkkB,SAVa8F,GAAkBC,EAASA,EAAQ/F,UAWhD1hB,UACA29B,WACAC,kBACAnc,WACAD,WACA4F,YAd6B,IAC1B4B,GAAevB,EAAQ7F,MAAMZ,OAAQoc,eAAeX,WACpDzT,GAAevB,EAAQ7F,MAAMX,SAAUmc,eAAeC,aACtDrU,GAAevB,EAAQ7F,MAAMV,QAASkc,eAAeE,UAahE,uBFxEM,SAA6BL,EAA+CzgC,EAA2BC,EAAS,GAClH,MAAMygC,EAAWD,EAEX1/B,EAAQhB,OADqBR,IAAnBmhC,EAASld,MAAsBid,EAA6BC,EAAStV,eAC1CprB,EAAaC,GACxD,MAAO,IACAc,EACH,GAAAQ,CAAIJ,GACAD,EAAkBC,EAAMJ,EAAMA,MACjC,EAET,sKAyFM,SAA8B0/B,EAA4Bt/B,EAAWnB,EAA0BC,EAAS,GAC1GuC,EAAei+B,EAAOrV,eAAgBjqB,EAAMnB,EAAaC,EAC7D,6FFjZ+C/E,EAAiB+E,EAAgB9E,GAC9E,OAAOD,EAAIi5B,SAASl0B,EAAQA,EAAS9E,EACvC","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 *\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 *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 * data definition can come from `\n *\n * What this function does:\n *\n * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer)\n *\n * 2. It makes `TypedArray` views of to match the definition.\n *\n * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper\n * for `setStructView` that passes in the views.\n *\n * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL\n *\n * ```wgsl\n * struct Light {\n * lightWorldPosition: vec3f,\n * shininess: f32,\n * lightDirection: vec3f,\n * innerLimit: f32,\n * outerLimit: f32,\n * };\n * struct Uniforms {\n * normalMatrix: mat3x3f,\n * worldViewProjection: mat4x4f,\n * world: mat4x4f,\n * color: vec4f,\n * viewWorldPosition: vec3f,\n * lights: array,\n * };\n * @group(0) @binding(0) var myUniforms: Uniforms;\n * ```\n *\n * `makeStructuredView(defs.uniforms.myUniforms)` would return this\n *\n * ```js\n * const arrayBuffer = new ArrayBuffer(368)\n * const views = {\n * normalMatrix: new Float32Array(arrayBuffer, 0, 12),\n * worldViewProjection: new Float32Array(arrayBuffer, 48, 16),\n * world: new Float32Array(arrayBuffer, 112, 16),\n * color: new Float32Array(arrayBuffer, 176, 4),\n * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3),\n * lights: [\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3),\n * shininess: new Float32Array(arrayBuffer, 220, 1),\n * lightDirection: new Float32Array(arrayBuffer, 224, 3),\n * innerLimit: new Float32Array(arrayBuffer, 236, 1),\n * outerLimit: new Float32Array(arrayBuffer, 240, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3),\n * shininess: new Float32Array(arrayBuffer, 268, 1),\n * lightDirection: new Float32Array(arrayBuffer, 272, 3),\n * innerLimit: new Float32Array(arrayBuffer, 284, 1),\n * outerLimit: new Float32Array(arrayBuffer, 288, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3),\n * shininess: new Float32Array(arrayBuffer, 316, 1),\n * lightDirection: new Float32Array(arrayBuffer, 320, 3),\n * innerLimit: new Float32Array(arrayBuffer, 332, 1),\n * outerLimit: new Float32Array(arrayBuffer, 336, 1),\n * },\n * ],\n * mode: new Uint32Array(UniformsValues, 352, 1),\n * };\n * result = {\n * arrayBuffer,\n * views,\n * set(data: any) {\n * setStructuredView(data, views.views);\n * },\n * }\n * ```\n *\n * From this, you can see you can set the value in the array buffer for any field/member/property\n * directly. Example\n *\n * ```js\n * result.views.lights[2].lightDirection.set([7, 8, 9]);\n * result.views.lights[2].innerLimit[0] = 4;\n * ```\n *\n * `set` just takes a JS object and matches property names to the view names.\n *\n * ```js\n * result.set({\n * color: [1, 1, 0, 1],\n * viewWorldPosition: [12, 34, 56],\n * mode: 8,\n * });\n * ```\n *\n * Is equivalent to\n *\n * ```js\n * result.views.color.set([1, 1, 0, 1]);\n * result.views.worldViewPosition.set([12, 34, 56]);\n * result.views.mode[0] = 8;\n * ```\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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * The data definitions and other reflection data from some WGSL shader source.\n */\nexport type ShaderDataDefinitions = {\n /**\n * definitions for uniform bindings by name\n */\n uniforms: VariableDefinitions,\n /**\n * definitions for storage bindings by name\n */\n storages: VariableDefinitions,\n /**\n * definitions for sampler bindings by name\n */\n samplers: VariableDefinitions,\n /**\n * definitions for texture bindings by name\n */\n textures: VariableDefinitions,\n /**\n * definitions for storage texture bindings by name\n */\n storageTextures: VariableDefinitions,\n /**\n * definitions for external texture bindings by name\n */\n externalTextures: VariableDefinitions,\n /**\n * definitions for structures by name\n */\n structs: StructDefinitions,\n /**\n * Entry points by name.\n */\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\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","kWGSLTypeInfo","kWGSLTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","makeIntrinsicTypedArrayView","typeDef","baseOffset","isArray","undefined","sizeInBytes","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","fields","elementType","makeTypedArrayViews","arrayBuffer","offset","asArrayDef","asStructDef","asIntrinsicDef","getSizeOfTypeDef","makeViews","getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef","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","getAlignmentOfTypeDef","values","reduce","max","Math","unalignedSize","lastField","pop","ParseContext","constructor","this","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","search","callback","searchBlock","block","_BlockStart","instance","node","_BlockEnd","Statement","super","Function","args","returnType","body","startLine","endLine","calls","StaticAssert","expression","While","condition","Continuing","For","init","increment","_a","_b","_c","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Requires","extensions","Diagnostic","severity","rule","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","postfix","constant","ConstExpr","initializer","property","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","ArrayIndex","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","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","break","case","continue","default","diagnostic","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","requires","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","simpleTokens","literalTokens","regexTokens","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","simpleToken","_addToken","matchType","isAlpha","_isAlpha","isUnderscore","_isAlphaNumeric","nextChar","matchedType","_findType","nextLexeme","foundLessThan","ti","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_currentLine","_context","_deferArrayCountEval","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","arrayDecl","arrayType","countNode","e","scanner","_error","message","_peek","_check","l","_consume","tk","t","_previous","_type_alias","directive","_diagnostic","_requires_directive","_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","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","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","arrayIndex","_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","inUse","ArrayInfo","TemplateInfo","VariableInfo","group","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","resources","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","_FunctionResources","WgslReflect","code","uniforms","textures","samplers","overrides","entry","functions","_types","_functions","update","_isStorageTexture","ast","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_findResources","_getInputs","_getOutputs","_addCalls","u","_markStructsInUse","m","_getAlias","call","findResource","_findResource","_markStructsFromAST","isEntry","self","varStack","callFn","r","getBindGroups","groups","_makeRoom","_getStructOutputs","output","_getOutputInfo","typeInfo","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","E","_textureTypes","_samplerTypes","defaultValue","k","getStageResources","defs","stageFlags","entryPoint","entryPointName","ep","entryPoints","filter","getEntryPointForStage","byBinding","getNamedVariables","reflect","variables","fromEntries","typeDefinition","addType","addVariableType","makeStructDefinition","structInfo","getTextureSampleType","getViewDimension","getStorageTextureAccess","getSamplerType","endsWith","getBindGroupLayoutEntry","resource","visibility","minBindingSize","externalTexture","multisampled","texture","sampleType","viewDimension","storageTexture","addEntryPoints","funcInfos","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","textureBindingViewDimension","perDeviceInfo","pipelineByFormatAndView","moduleByViewType","uniformBuffer","uniformValues","guessTextureBindingViewDimensionForTexture","module","textureSnippet","sampleSnippet","getMipmapGenerationWGSL","createShaderModule","label","createSampler","minFilter","magFilter","createBuffer","usage","GPUBufferUsage","UNIFORM","COPY_DST","assign","createRenderPipeline","layout","targets","pipeline","baseMipLevel","mipLevelCount","baseArrayLayer","queue","writeBuffer","bindGroup","createBindGroup","getBindGroupLayout","createView","renderPassDescriptor","colorAttachments","arrayLayerCount","loadOp","storeOp","encoder","createCommandEncoder","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","getNumComponents","arrayName","getArray","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","totalNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","subarray","setVertexAndIndexBuffers","passEncoder","buffersAndAttributes","firstVertexBufferIndex","buffers","setVertexBuffer","indexBuffer","setIndexBuffer","indexFormat","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","tempTexture","layer","dstTexture","copyOrigin","createTexture","GPUTextureUsage","COPY_SRC","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","copyTextureToTexture","destroy","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","mips","TEXTURE_BINDING","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","allButIndices","x","z","len","subtract","cross","colors","numVerts","color","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","radius","divisions","stacks","innerRadius","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","thickness","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","inSize","xOffset","yOffset","indicesP","newVertices","channel","srcBuffer","dstBuffer","existingArray","createAugmentedTypedArrayFromExisting","p0","p1","p2","n0","n1","byteOffset","alignment","numBytes","bufferNdx","attribs","attrib0","data0","VERTEX","mappedAtCreation","getMappedRange","unmap","indicesEntry","find","INDEX","drawIndexed","varDef","asVarDef","desc","GPUShaderStage","FRAGMENT","COMPUTE","bindGroupLayoutDescriptorsByGroupByBinding","bindingsToBindGroupEntry","descriptors","sort","storages","storageTextures","externalTextures"],"mappings":"mPAAO,MAAMA,EAAsB,CAACC,EAAWC,MAAwBD,EAAIC,EAAW,GAAKA,EAAY,GAAKA,ECoD/F,MAAAC,EAAgBC,GAC3BA,GAA6B,iBAAfA,EAAIC,QAAuBD,EAAIE,kBAAkBC,aAAyC,iBAAnBH,EAAII,WClCrFC,EAAmB,CACvBC,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,MAAO,CAAEZ,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMK,cACjEI,MAAO,CAAEb,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMC,YACjES,MAAO,CAAEd,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMG,aACjEQ,MAAO,CAAEf,YAAa,EAAGC,MAAQ,EAAGC,KAAO,EAAGC,KAAM,MAAOC,KAAMO,aACjEK,MAAO,CAAEhB,YAAa,EAAGC,MAAO,GAAIC,KAAM,GAAIC,KAAM,MAA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Ad6B,IAC1B4B,GAAevB,EAAQ7F,MAAMZ,OAAQoc,eAAeX,WACpDzT,GAAevB,EAAQ7F,MAAMX,SAAUmc,eAAeC,aACtDrU,GAAevB,EAAQ7F,MAAMV,QAASkc,eAAeE,UAahE,uBFwCM,SAA6BL,EAA+CzgC,EAA2BC,EAAS,GAClH,MAAMygC,EAAWD,EAEX1/B,EAAQhB,OADqBR,IAAnBmhC,EAASld,MAAsBid,EAA6BC,EAAStV,eAC1CprB,EAAaC,GACxD,MAAO,IACAc,EACH,GAAAQ,CAAIJ,GACAD,EAAkBC,EAAMJ,EAAMA,MACjC,EAET,sKAyFM,SAA8B0/B,EAA4Bt/B,EAAWnB,EAA0BC,EAAS,GAC1GuC,EAAei+B,EAAOrV,eAAgBjqB,EAAMnB,EAAaC,EAC7D,6FFxhB+C/E,EAAiB+E,EAAgB9E,GAC9E,OAAOD,EAAIi5B,SAASl0B,EAAQA,EAAS9E,EACvC","x_google_ignoreList":[4]} \ No newline at end of file diff --git a/dist/1.x/webgpu-utils.module.js b/dist/1.x/webgpu-utils.module.js index c17c0d7..d4f351f 100644 --- a/dist/1.x/webgpu-utils.module.js +++ b/dist/1.x/webgpu-utils.module.js @@ -1,4 +1,4 @@ -/* webgpu-utils@1.9.2, license MIT */ +/* webgpu-utils@1.9.3, license MIT */ const roundUpToMultipleOf = (v, multiple) => (((v + multiple - 1) / multiple) | 0) * multiple; function keysOf(obj) { return Object.keys(obj); @@ -383,11 +383,146 @@ function setStructuredView(data, views) { } /** * Given a VariableDefinition, create matching TypedArray views + * * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions} * @param arrayBuffer Optional ArrayBuffer for the views * @param offset Optional offset into the ArrayBuffer for the views * @returns TypedArray views for the various named fields of the structure as well * as a `set` function to make them easy to set, and the arrayBuffer + * + * ```js + * const code = ` + * struct HSL { + * hue: f32, + * sat: f32, + * lum: f32, + * }; + * struct MyStorage { + * colors: array, + * brightness: f32, + * kernel: array, + * }; + * @group(0) @binding(0) var myStorage: MyStorage; + * `; + * const defs = makeShaderDataDefinitions(code); + * const myUniformValues = makeStructuredView(defs.storages.myStorage); + * + * myUniformValues.set({ + * colors: [ + * , + * , + * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color + * ], + * brightness: 0.8, + * kernel: [ + * 1, 0, -1, + * 2, 0, -2, + * 1, 0, -1, + * ], + * }); + * ``` + * + * data definition can come from ` + * + * What this function does: + * + * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer) + * + * 2. It makes `TypedArray` views of to match the definition. + * + * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper + * for `setStructView` that passes in the views. + * + * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL + * + * ```wgsl + * struct Light { + * lightWorldPosition: vec3f, + * shininess: f32, + * lightDirection: vec3f, + * innerLimit: f32, + * outerLimit: f32, + * }; + * struct Uniforms { + * normalMatrix: mat3x3f, + * worldViewProjection: mat4x4f, + * world: mat4x4f, + * color: vec4f, + * viewWorldPosition: vec3f, + * lights: array, + * }; + * @group(0) @binding(0) var myUniforms: Uniforms; + * ``` + * + * `makeStructuredView(defs.uniforms.myUniforms)` would return this + * + * ```js + * const arrayBuffer = new ArrayBuffer(368) + * const views = { + * normalMatrix: new Float32Array(arrayBuffer, 0, 12), + * worldViewProjection: new Float32Array(arrayBuffer, 48, 16), + * world: new Float32Array(arrayBuffer, 112, 16), + * color: new Float32Array(arrayBuffer, 176, 4), + * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3), + * lights: [ + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3), + * shininess: new Float32Array(arrayBuffer, 220, 1), + * lightDirection: new Float32Array(arrayBuffer, 224, 3), + * innerLimit: new Float32Array(arrayBuffer, 236, 1), + * outerLimit: new Float32Array(arrayBuffer, 240, 1), + * }, + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3), + * shininess: new Float32Array(arrayBuffer, 268, 1), + * lightDirection: new Float32Array(arrayBuffer, 272, 3), + * innerLimit: new Float32Array(arrayBuffer, 284, 1), + * outerLimit: new Float32Array(arrayBuffer, 288, 1), + * }, + * { + * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3), + * shininess: new Float32Array(arrayBuffer, 316, 1), + * lightDirection: new Float32Array(arrayBuffer, 320, 3), + * innerLimit: new Float32Array(arrayBuffer, 332, 1), + * outerLimit: new Float32Array(arrayBuffer, 336, 1), + * }, + * ], + * mode: new Uint32Array(UniformsValues, 352, 1), + * }; + * result = { + * arrayBuffer, + * views, + * set(data: any) { + * setStructuredView(data, views.views); + * }, + * } + * ``` + * + * From this, you can see you can set the value in the array buffer for any field/member/property + * directly. Example + * + * ```js + * result.views.lights[2].lightDirection.set([7, 8, 9]); + * result.views.lights[2].innerLimit[0] = 4; + * ``` + * + * `set` just takes a JS object and matches property names to the view names. + * + * ```js + * result.set({ + * color: [1, 1, 0, 1], + * viewWorldPosition: [12, 34, 56], + * mode: 8, + * }); + * ``` + * + * Is equivalent to + * + * ```js + * result.views.color.set([1, 1, 0, 1]); + * result.views.worldViewPosition.set([12, 34, 56]); + * result.views.mode[0] = 8; + * ``` */ function makeStructuredView(varDef, arrayBuffer, offset = 0) { const asVarDef = varDef; diff --git a/dist/1.x/webgpu-utils.module.js.map b/dist/1.x/webgpu-utils.module.js.map index 1a4a418..8acfb07 100644 --- a/dist/1.x/webgpu-utils.module.js.map +++ b/dist/1.x/webgpu-utils.module.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.module.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * Warning: The properties of this type will probably be changed\n * in a future version. Please consider this an opaque type.\n */\nexport type ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n samplers: VariableDefinitions,\n textures: VariableDefinitions,\n storageTextures: VariableDefinitions,\n externalTextures: VariableDefinitions,\n structs: StructDefinitions,\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\n}\n\n"],"names":[],"mappings":";AAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,CAAC;AAE/G,SAAU,MAAM,CAAmB,GAA0B,EAAA;AACjE,IAAA,OAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAsB,CAAC;AAChD,CAAC;AAEe,SAAA,KAAK,CAAI,KAAa,EAAE,EAAoB,EAAA;IACxD,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD;;MCkBa,uBAAuB,CAAA;AAChC,IAAA,WAAW,CAAc;AACzB,IAAA,UAAU,CAAS;AAEnB,IAAA,WAAA,CAAY,WAAmB,EAAA;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;KACvB;AACD,IAAA,K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AG,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACvC,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;;AAGxB,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;AACxB,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACjB;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.module.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 *\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 *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 * data definition can come from `\n *\n * What this function does:\n *\n * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer)\n *\n * 2. It makes `TypedArray` views of to match the definition.\n *\n * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper\n * for `setStructView` that passes in the views.\n *\n * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL\n *\n * ```wgsl\n * struct Light {\n * lightWorldPosition: vec3f,\n * shininess: f32,\n * lightDirection: vec3f,\n * innerLimit: f32,\n * outerLimit: f32,\n * };\n * struct Uniforms {\n * normalMatrix: mat3x3f,\n * worldViewProjection: mat4x4f,\n * world: mat4x4f,\n * color: vec4f,\n * viewWorldPosition: vec3f,\n * lights: array,\n * };\n * @group(0) @binding(0) var myUniforms: Uniforms;\n * ```\n *\n * `makeStructuredView(defs.uniforms.myUniforms)` would return this\n *\n * ```js\n * const arrayBuffer = new ArrayBuffer(368)\n * const views = {\n * normalMatrix: new Float32Array(arrayBuffer, 0, 12),\n * worldViewProjection: new Float32Array(arrayBuffer, 48, 16),\n * world: new Float32Array(arrayBuffer, 112, 16),\n * color: new Float32Array(arrayBuffer, 176, 4),\n * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3),\n * lights: [\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3),\n * shininess: new Float32Array(arrayBuffer, 220, 1),\n * lightDirection: new Float32Array(arrayBuffer, 224, 3),\n * innerLimit: new Float32Array(arrayBuffer, 236, 1),\n * outerLimit: new Float32Array(arrayBuffer, 240, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3),\n * shininess: new Float32Array(arrayBuffer, 268, 1),\n * lightDirection: new Float32Array(arrayBuffer, 272, 3),\n * innerLimit: new Float32Array(arrayBuffer, 284, 1),\n * outerLimit: new Float32Array(arrayBuffer, 288, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3),\n * shininess: new Float32Array(arrayBuffer, 316, 1),\n * lightDirection: new Float32Array(arrayBuffer, 320, 3),\n * innerLimit: new Float32Array(arrayBuffer, 332, 1),\n * outerLimit: new Float32Array(arrayBuffer, 336, 1),\n * },\n * ],\n * mode: new Uint32Array(UniformsValues, 352, 1),\n * };\n * result = {\n * arrayBuffer,\n * views,\n * set(data: any) {\n * setStructuredView(data, views.views);\n * },\n * }\n * ```\n *\n * From this, you can see you can set the value in the array buffer for any field/member/property\n * directly. Example\n *\n * ```js\n * result.views.lights[2].lightDirection.set([7, 8, 9]);\n * result.views.lights[2].innerLimit[0] = 4;\n * ```\n *\n * `set` just takes a JS object and matches property names to the view names.\n *\n * ```js\n * result.set({\n * color: [1, 1, 0, 1],\n * viewWorldPosition: [12, 34, 56],\n * mode: 8,\n * });\n * ```\n *\n * Is equivalent to\n *\n * ```js\n * result.views.color.set([1, 1, 0, 1]);\n * result.views.worldViewPosition.set([12, 34, 56]);\n * result.views.mode[0] = 8;\n * ```\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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * The data definitions and other reflection data from some WGSL shader source.\n */\nexport type ShaderDataDefinitions = {\n /**\n * definitions for uniform bindings by name\n */\n uniforms: VariableDefinitions,\n /**\n * definitions for storage bindings by name\n */\n storages: VariableDefinitions,\n /**\n * definitions for sampler bindings by name\n */\n samplers: VariableDefinitions,\n /**\n * definitions for texture bindings by name\n */\n textures: VariableDefinitions,\n /**\n * definitions for storage texture bindings by name\n */\n storageTextures: VariableDefinitions,\n /**\n * definitions for external texture bindings by name\n */\n externalTextures: VariableDefinitions,\n /**\n * definitions for structures by name\n */\n structs: StructDefinitions,\n /**\n * Entry points by name.\n */\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6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,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;AACxB,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACjB;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]} \ No newline at end of file diff --git a/dist/1.x/webgpu-utils.module.min.js.map b/dist/1.x/webgpu-utils.module.min.js.map index 3fc6d3a..cbd7473 100644 --- a/dist/1.x/webgpu-utils.module.min.js.map +++ b/dist/1.x/webgpu-utils.module.min.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.module.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * Warning: The properties of this type will probably be changed\n * in a future version. Please consider this an opaque type.\n */\nexport type ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n samplers: VariableDefinitions,\n textures: VariableDefinitions,\n storageTextures: VariableDefinitions,\n externalTextures: VariableDefinitions,\n structs: StructDefinitions,\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\n}\n\n"],"names":["roundUpToMultipleOf","v","multiple","TypedArrayViewGenerator","arrayBuffer","byteOffset","constructor","sizeInBytes","this","ArrayBuffer","align","alignment","pad","numBytes","getView","Ctor","numElements","view","byteLength","subarray","arr","offset","length","isTypedArray","buffer","b","i32","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","mat2x3h","mat3x3f","mat3x3h","mat4x3f","mat4x3h","mat2x4f","mat2x4h","mat3x4f","mat3x4h","mat4x4f","mat4x4h","bool","kWGSLTypeInfo","kWGSLTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","makeIntrinsicTypedArrayView","typeDef","baseOffset","isArray","undefined","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","fields","elementType","makeTypedArrayViews","asArrayDef","asStructDef","asIntrinsicDef","getSizeOfTypeDef","makeViews","getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef","effectiveNumElements","fn","i","Array","fill","map","_","views","name","entries","setStructuredView","data","dataLen","stride","set","asArray","forEach","newValue","ndx","asViews","key","makeStructuredView","varDef","asVarDef","group","typeDefinition","s_views","WeakMap","viewsByCtor","get","Map","getViewsByCtor","setIntrinsicFromArrayLikeOfNumber","index","setTypedValues","isArrayLikeOfNumber","fieldDef","setStructuredValues","getAlignmentOfTypeDef","values","reduce","max","Math","unalignedSize","lastField","pop","getSizeAndAlignmentOfUnsizedArrayElement","ParseContext","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","search","callback","searchBlock","block","_BlockStart","instance","node","_BlockEnd","Statement","super","Function","args","returnType","body","startLine","endLine","calls","StaticAssert","expression","While","condition","Continuing","For","init","increment","_a","_b","_c","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Requires","extensions","Diagnostic","severity","rule","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","postfix","constant","ConstExpr","initializer","property","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","ArrayIndex","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","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","break","case","continue","default","diagnostic","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","requires","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","simpleTokens","literalTokens","regexTokens","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","simpleToken","_addToken","matchType","isAlpha","_isAlpha","isUnderscore","_isAlphaNumeric","nextChar","matchedType","_findType","nextLexeme","foundLessThan","ti","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_currentLine","_context","_deferArrayCountEval","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","arrayDecl","arrayType","countNode","e","scanner","_error","message","_peek","_check","l","_consume","tk","t","_previous","_type_alias","directive","_diagnostic","_requires_directive","_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","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","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","arrayIndex","_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","inUse","ArrayInfo","TemplateInfo","VariableInfo","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","resources","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","_FunctionResources","WgslReflect","code","uniforms","textures","samplers","overrides","entry","functions","_types","_functions","update","_isStorageTexture","ast","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_findResources","_getInputs","_getOutputs","_addCalls","u","_markStructsInUse","m","_getAlias","call","findResource","_findResource","_markStructsFromAST","isEntry","self","varStack","callFn","r","getBindGroups","groups","_makeRoom","_getStructOutputs","output","_getOutputInfo","typeInfo","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","E","_textureTypes","_samplerTypes","defaultValue","k","getStageResources","defs","stageFlags","entryPoint","entryPointName","ep","entryPoints","filter","getEntryPointForStage","byBinding","makeBindGroupLayoutDescriptors","desc","GPUShaderStage","VERTEX","FRAGMENT","COMPUTE","bindGroupLayoutDescriptorsByGroupByBinding","resource","bindingsToBindGroupEntry","visibility","descriptors","sort","getNamedVariables","reflect","variables","fromEntries","addType","addVariableType","makeStructDefinition","structInfo","getTextureSampleType","getViewDimension","getStorageTextureAccess","getSamplerType","endsWith","getBindGroupLayoutEntry","minBindingSize","externalTexture","multisampled","texture","sampleType","viewDimension","storageTexture","addEntryPoints","funcInfos","makeShaderDataDefinitions","storages","storageTextures","externalTextures","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","textureBindingViewDimension","perDeviceInfo","pipelineByFormatAndView","moduleByViewType","uniformBuffer","uniformValues","guessTextureBindingViewDimensionForTexture","module","textureSnippet","sampleSnippet","getMipmapGenerationWGSL","createShaderModule","label","createSampler","minFilter","magFilter","createBuffer","usage","GPUBufferUsage","UNIFORM","COPY_DST","assign","createRenderPipeline","layout","targets","pipeline","baseMipLevel","mipLevelCount","baseArrayLayer","queue","writeBuffer","bindGroup","createBindGroup","getBindGroupLayout","createView","renderPassDescriptor","colorAttachments","arrayLayerCount","loadOp","storeOp","encoder","createCommandEncoder","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","getNumComponents","arrayName","getArray","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","totalNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","createBuffersAndAttributesFromArrays","buffers","bufferNdx","attribs","attrib0","data0","mappedAtCreation","getMappedRange","unmap","buffersAndAttributes","indicesEntry","find","indices","indexBuffer","INDEX","indexFormat","setVertexAndIndexBuffers","passEncoder","firstVertexBufferIndex","setVertexBuffer","setIndexBuffer","drawArrays","drawIndexed","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","tempTexture","layer","dstTexture","copyOrigin","createTexture","GPUTextureUsage","COPY_SRC","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","copyTextureToTexture","destroy","copySourceToTexture","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","mips","TEXTURE_BINDING","RENDER_ATTACHMENT","createTextureFromSource","async","loadImageBitmap","url","res","fetch","blob","opt","colorSpaceConversion","createImageBitmap","createTextureFromImages","urls","Promise","all","createTextureFromImage","TypedArrayWrapper","cursor","reset","createAugmentedTypedArray","CUBE_FACE_INDICES","createTruncatedConeVertices","bottomRadius","topRadius","radialSubdivisions","verticalSubdivisions","topCap","bottomCap","extra","numVertices","positions","normals","texcoords","vertsAroundEdge","slant","cosSlant","sinSlant","yy","ringRadius","y","ii","position","normal","texcoord","expandRLEData","rleData","padding","runLength","element","jj","allButIndices","x","z","len","subtract","cross","colors","numVerts","color","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","radius","divisions","stacks","innerRadius","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","thickness","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","inSize","xOffset","yOffset","indicesP","newVertices","channel","srcBuffer","dstBuffer","existingArray","createAugmentedTypedArrayFromExisting","p0","p1","p2","n0","n1"],"mappings":"AAAO,MAAMA,EAAsB,CAACC,EAAWC,MAAwBD,EAAIC,EAAW,GAAKA,EAAY,GAAKA,QC0B/FC,EACTC,YACAC,WAEA,WAAAC,CAAYC,GACRC,KAAKJ,YAAc,IAAIK,YAAYF,GACnCC,KAAKH,WAAa,CACrB,CACD,KAAAK,CAAMC,GACFH,KAAKH,WAAaL,EAAoBQ,KAAKH,WAAYM,EAC1D,CACD,GAAAC,CAAIC,GACAL,KAAKH,YAAcQ,CACtB,CACD,OAAAC,CAA8BC,EAA6BC,GACvD,MAAMC,EAAO,IAAIF,EAAKP,KAAKJ,YAAaI,KAAKH,WAAYW,GAEzD,OADAR,KAAKH,YAAcY,EAAKC,WACjBD,CACV,WAGWE,EAA+BC,EAAiBC,EAAgBC,GAC9E,OAAOF,EAAID,SAASE,EAAQA,EAASC,EACvC,CAGO,MAAMC,EAAgBH,GAC3BA,GAA6B,iBAAfA,EAAIE,QAAuBF,EAAII,kBAAkBf,aAAyC,iBAAnBW,EAAIF,WClCrFO,EAAmB,CACvBC,IAAK,CAAEV,YAAa,EAAGN,MAAO,EAAGiB,KAAM,EAAGC,KAAM,MAAOC,KAAMC,YAC7DC,IAAK,CAAEf,YAAa,EAAGN,MAAO,EAAGiB,KAAM,EAAGC,KAAM,MAAOC,KAAMG,aAC7DC,IAAK,CAAEjB,YAAa,EAAGN,MAAO,EAAGiB,KAAM,EAAGC,KAAM,MAAOC,KAAMK,cAC7DC,IAAK,CAAEnB,YAAa,EAAGN,MAAO,EAAGiB,KAAM,EAAGC,KAAM,MAAOC,KAAMO,aAE7DC,MAAO,CAAErB,YAAa,EAAGN,MAAQ,EAAGiB,KAAO,EAAGC,KAAM,MAAOC,KAAMK,cACjEI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AGA,EAAK,GAErCuF,EAAK/M,GAAUsI,GAASsE,EAAIC,IAC5BG,EAAKhN,GAAUsI,GAASsE,EAAIE,IAC5BvY,EAAIgU,GAAMwE,EAAIC,GAGpBjG,EAAQ/5B,IAAIunB,EAAGiT,GACfT,EAAQ/5B,IAAIunB,EAAGiT,EAAK,GACpBT,EAAQ/5B,IAAIunB,EAAGiT,EAAK,EACrB,CAED,OAAOT,CACT","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.module.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/wgsl-types.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 | Uint8ClampedArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\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 keysOf,\n} from './utils.js';\nimport {\n TypedArrayConstructor,\n} from './typed-arrays.js';\n\nexport type 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 createTypeDefs = >(defs: T): { readonly [K in keyof T]: TypeDef } => defs;\n\nconst b = createTypeDefs({\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\nexport const kWGSLTypeInfo = createTypeDefs({\n ...b,\n\n 'atomic': b.i32,\n 'atomic': b.u32,\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 WGSLType = keyof typeof kWGSLTypeInfo;\nexport const kWGSLTypes: readonly WGSLType[] = keysOf(kWGSLTypeInfo);\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, range } from './utils.js';\nimport {\n WGSLType,\n kWGSLTypes,\n kWGSLTypeInfo,\n} from './wgsl-types.js';\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. For example\n * to expand all types would be `setIntrinsicsToView([], true)`. To expand\n * all except `f32` would be `setIntrinsicsToView(['f32'], true)`.\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 WGSLType[] = [], 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 kWGSLTypes) {\n const info = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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 } = kWGSLTypeInfo[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) && kWGSLTypeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {size} = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / size\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * 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 MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 *\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 *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyStorage {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myStorage: MyStorage;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.storages.myStorage);\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 * data definition can come from `\n *\n * What this function does:\n *\n * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer)\n *\n * 2. It makes `TypedArray` views of to match the definition.\n *\n * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper\n * for `setStructView` that passes in the views.\n *\n * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL\n *\n * ```wgsl\n * struct Light {\n * lightWorldPosition: vec3f,\n * shininess: f32,\n * lightDirection: vec3f,\n * innerLimit: f32,\n * outerLimit: f32,\n * };\n * struct Uniforms {\n * normalMatrix: mat3x3f,\n * worldViewProjection: mat4x4f,\n * world: mat4x4f,\n * color: vec4f,\n * viewWorldPosition: vec3f,\n * lights: array,\n * };\n * @group(0) @binding(0) var myUniforms: Uniforms;\n * ```\n *\n * `makeStructuredView(defs.uniforms.myUniforms)` would return this\n *\n * ```js\n * const arrayBuffer = new ArrayBuffer(368)\n * const views = {\n * normalMatrix: new Float32Array(arrayBuffer, 0, 12),\n * worldViewProjection: new Float32Array(arrayBuffer, 48, 16),\n * world: new Float32Array(arrayBuffer, 112, 16),\n * color: new Float32Array(arrayBuffer, 176, 4),\n * viewWorldPosition: new Float32Array(arrayBuffer, 192, 3),\n * lights: [\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 208, 3),\n * shininess: new Float32Array(arrayBuffer, 220, 1),\n * lightDirection: new Float32Array(arrayBuffer, 224, 3),\n * innerLimit: new Float32Array(arrayBuffer, 236, 1),\n * outerLimit: new Float32Array(arrayBuffer, 240, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 256, 3),\n * shininess: new Float32Array(arrayBuffer, 268, 1),\n * lightDirection: new Float32Array(arrayBuffer, 272, 3),\n * innerLimit: new Float32Array(arrayBuffer, 284, 1),\n * outerLimit: new Float32Array(arrayBuffer, 288, 1),\n * },\n * {\n * lightWorldPosition: new Float32Array(arrayBuffer, 304, 3),\n * shininess: new Float32Array(arrayBuffer, 316, 1),\n * lightDirection: new Float32Array(arrayBuffer, 320, 3),\n * innerLimit: new Float32Array(arrayBuffer, 332, 1),\n * outerLimit: new Float32Array(arrayBuffer, 336, 1),\n * },\n * ],\n * mode: new Uint32Array(UniformsValues, 352, 1),\n * };\n * result = {\n * arrayBuffer,\n * views,\n * set(data: any) {\n * setStructuredView(data, views.views);\n * },\n * }\n * ```\n *\n * From this, you can see you can set the value in the array buffer for any field/member/property\n * directly. Example\n *\n * ```js\n * result.views.lights[2].lightDirection.set([7, 8, 9]);\n * result.views.lights[2].innerLimit[0] = 4;\n * ```\n *\n * `set` just takes a JS object and matches property names to the view names.\n *\n * ```js\n * result.set({\n * color: [1, 1, 0, 1],\n * viewWorldPosition: [12, 34, 56],\n * mode: 8,\n * });\n * ```\n *\n * Is equivalent to\n *\n * ```js\n * result.views.color.set([1, 1, 0, 1]);\n * result.views.worldViewPosition.set([12, 34, 56]);\n * result.views.mode[0] = 8;\n * ```\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 = kWGSLTypeInfo[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 varDef 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\nfunction getAlignmentOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return getAlignmentOfTypeDef(elementType);\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n return Object.values(fields).reduce((max, {type}) => Math.max(max, getAlignmentOfTypeDef(type)), 0);\n }\n\n const { type } = typeDef as IntrinsicDefinition;\n const { align } = kWGSLTypeInfo[type];\n return align;\n}\n\ntype ElementInfo = {\n unalignedSize: number,\n align: number,\n size: number,\n};\n\nfunction getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef: TypeDefinition): ElementInfo {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n const unalignedSize = elementType.size;\n const align = getAlignmentOfTypeDef(elementType);\n return {\n unalignedSize,\n align,\n size: roundUpToMultipleOf(unalignedSize, align),\n };\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n const lastField = Object.values(fields).pop()!;\n if (lastField.type.size === 0) {\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type);\n }\n }\n\n return {\n size: 0,\n unalignedSize: 0,\n align: 1,\n };\n}\n\n/**\n * Returns the size, align, and unalignedSize of \"the\" unsized array element. Unsized arrays are only\n * allowed at the outer most level or the last member of a top level struct.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement(\n * defs.storages.f);\n * // size = 16 (since you need to allocate 16 bytes per element)\n * // align = 16 (since vec3f needs to be aligned to 16 bytes)\n * // unalignedSize = 12 (since only 12 bytes are used for a vec3f)\n * ```\n *\n * Generally you only need size. Example:\n *\n * ```js\n * const code = `\n * struct Foo {\n * a: u32,\n * b: array,\n * };\n * @group(0) @binding(0) var f: Foo;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f);\n * const numElements = 10;\n * const views = makeStructuredViews(\n * defs.storages.f,\n * new ArrayBuffer(defs.storages.f.size + size * numElements));\n * ```\n *\n * @param varDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition.\n * If there is no unsized array, size = 0.\n */\nexport function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): {size: number, align: number} {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef);\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 search(callback) { }\n searchBlock(block, callback) {\n if (block) {\n callback(_BlockStart.instance);\n for (const node of block) {\n if (node instanceof Array) {\n this.searchBlock(node, callback);\n }\n else {\n node.search(callback);\n }\n }\n callback(_BlockEnd.instance);\n }\n }\n}\n// For internal use only\nclass _BlockStart extends Node {\n}\n_BlockStart.instance = new _BlockStart();\n// For internal use only\nclass _BlockEnd extends Node {\n}\n_BlockEnd.instance = new _BlockEnd();\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, startLine, endLine) {\n super();\n this.calls = new Set();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n this.startLine = startLine;\n this.endLine = endLine;\n }\n get astNodeType() {\n return \"function\";\n }\n search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.expression.search(callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a, _b, _c;\n (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback);\n (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback);\n (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback);\n this.searchBlock(this.body, callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n var _a;\n callback(this);\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 search(callback) {\n this.variable.search(callback);\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 }\n //return AssignOperator[key];\n return 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 search(callback) {\n this.variable.search(callback);\n this.value.search(callback);\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\n this.searchBlock(this.elseif, callback);\n this.searchBlock(this.else, callback);\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 search(callback) {\n var _a;\n (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback);\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 Requires\n * @extends Statement\n * @category AST\n */\nclass Requires extends Statement {\n constructor(extensions) {\n super();\n this.extensions = extensions;\n }\n get astNodeType() {\n return \"requires\";\n }\n}\n/**\n * @class Diagnostic\n * @extends Statement\n * @category AST\n */\nclass Diagnostic extends Statement {\n constructor(severity, rule) {\n super();\n this.severity = severity;\n this.rule = rule;\n }\n get astNodeType() {\n return \"diagnostic\";\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, startLine, endLine) {\n super(name);\n this.members = members;\n this.startLine = startLine;\n this.endLine = endLine;\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 search(callback) {\n callback(this);\n for (const node of this.args) {\n node.search(callback);\n }\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 search(callback) {\n for (const node of this.args) {\n node.search(callback);\n }\n callback(this);\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 search(callback) {\n callback(this);\n if (this.postfix) {\n this.postfix.search(callback);\n }\n }\n evaluate(context) {\n const constant = context.constants.get(this.name);\n if (!constant) {\n throw new Error(\"Cannot evaluate node\");\n }\n return constant.evaluate(context);\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 search(callback) {\n this.initializer.search(callback);\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 search(callback) {\n this.value.search(callback);\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 search(callback) {\n this.searchBlock(this.args, callback);\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 search(callback) {\n this.searchBlock(this.contents, callback);\n }\n}\n/**\n * @class ArrayIndex\n * @extends Expression\n * @category AST\n */\nclass ArrayIndex extends Expression {\n constructor(index) {\n super();\n this.index = index;\n }\n search(callback) {\n this.index.search(callback);\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 search(callback) {\n this.right.search(callback);\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 search(callback) {\n this.left.search(callback);\n this.right.search(callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.searchBlock(this.body, callback);\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 search(callback) {\n this.condition.search(callback);\n this.searchBlock(this.body, callback);\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 diagnostic: new TokenType(\"diagnostic\", TokenClass.keyword, \"diagnostic\"),\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 requires: new TokenType(\"requires\", TokenClass.keyword, \"requires\"),\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.simpleTokens = {\n \"@\": _a.tokens.attr,\n \"{\": _a.tokens.brace_left,\n \"}\": _a.tokens.brace_right,\n \":\": _a.tokens.colon,\n \",\": _a.tokens.comma,\n \"(\": _a.tokens.paren_left,\n \")\": _a.tokens.paren_right,\n \";\": _a.tokens.semicolon,\n};\nTokenTypes.literalTokens = {\n \"&\": _a.tokens.and,\n \"&&\": _a.tokens.and_and,\n \"->\": _a.tokens.arrow,\n \"[[\": _a.tokens.attr_left,\n \"]]\": _a.tokens.attr_right,\n \"/\": _a.tokens.forward_slash,\n \"!\": _a.tokens.bang,\n \"[\": _a.tokens.bracket_left,\n \"]\": _a.tokens.bracket_right,\n \"=\": _a.tokens.equal,\n \"==\": _a.tokens.equal_equal,\n \"!=\": _a.tokens.not_equal,\n \">\": _a.tokens.greater_than,\n \">=\": _a.tokens.greater_than_equal,\n \">>\": _a.tokens.shift_right,\n \"<\": _a.tokens.less_than,\n \"<=\": _a.tokens.less_than_equal,\n \"<<\": _a.tokens.shift_left,\n \"%\": _a.tokens.modulo,\n \"-\": _a.tokens.minus,\n \"--\": _a.tokens.minus_minus,\n \".\": _a.tokens.period,\n \"+\": _a.tokens.plus,\n \"++\": _a.tokens.plus_plus,\n \"|\": _a.tokens.or,\n \"||\": _a.tokens.or_or,\n \"*\": _a.tokens.star,\n \"~\": _a.tokens.tilde,\n \"_\": _a.tokens.underscore,\n \"^\": _a.tokens.xor,\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.regexTokens = {\n decimal_float_literal: _a.tokens.decimal_float_literal,\n hex_float_literal: _a.tokens.hex_float_literal,\n int_literal: _a.tokens.int_literal,\n uint_literal: _a.tokens.uint_literal,\n ident: _a.tokens.ident,\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, _a.keywords.diagnostic];\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 }\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 }\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 }\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 // Shortcut single character tokens\n const simpleToken = TokenTypes.simpleTokens[lexeme];\n if (simpleToken) {\n this._addToken(simpleToken);\n return true;\n }\n // Shortcut keywords and identifiers\n let matchType = TokenTypes.none;\n const isAlpha = this._isAlpha(lexeme);\n const isUnderscore = lexeme === \"_\";\n if (this._isAlphaNumeric(lexeme)) {\n let nextChar = this._peekAhead();\n while (this._isAlphaNumeric(nextChar)) {\n lexeme += this._advance();\n nextChar = this._peekAhead();\n }\n }\n if (isAlpha) {\n const matchedType = TokenTypes.keywords[lexeme];\n if (matchedType) {\n this._addToken(matchedType);\n return true;\n }\n }\n if (isAlpha || isUnderscore) {\n this._addToken(TokenTypes.tokens.ident);\n return true;\n }\n // Scan for the next valid token type\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 }\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 }\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 }\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.regexTokens) {\n const type = TokenTypes.regexTokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n const type = TokenTypes.literalTokens[lexeme];\n if (type) {\n return type;\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n const match = rule.exec(lexeme);\n return match && match.index == 0 && match[0] == lexeme;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isAlpha(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\");\n }\n _isAlphaNumeric(c) {\n return (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\") || c == \"_\" || (c >= \"0\" && c <= \"9\");\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 }\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._currentLine = 0;\n this._context = new ParseContext();\n this._deferArrayCountEval = [];\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n this._deferArrayCountEval.length = 0;\n const statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement) {\n break;\n }\n statements.push(statement);\n }\n // Since constants can be declared after they are used, and\n // constants can be used to size arrays, defer calculating the\n // size until after the shader has finished parsing.\n if (this._deferArrayCountEval.length > 0) {\n for (const arrayDecl of this._deferArrayCountEval) {\n const arrayType = arrayDecl[\"arrayType\"];\n const countNode = arrayDecl[\"countNode\"];\n if (countNode instanceof VariableExpr) {\n const variable = countNode;\n const name = variable.name;\n const constant = this._context.constants.get(name);\n if (constant) {\n try {\n const count = constant.evaluate(this._context);\n arrayType.count = count;\n }\n catch (e) {\n }\n }\n }\n }\n this._deferArrayCountEval.length = 0;\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 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 }\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd()) {\n return false;\n }\n const tk = this._peek();\n if (types instanceof Array) {\n const t = tk.type;\n const index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n var _a, _b;\n this._currentLine = (_b = (_a = this._peek()) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : -1;\n if (!this._isAtEnd()) {\n this._current++;\n }\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.diagnostic)) {\n const directive = this._diagnostic();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return directive;\n }\n if (this._match(TokenTypes.keywords.requires)) {\n const requires = this._requires_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return requires;\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n const startLine = this._currentLine;\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 }\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 }\n const body = this._compound_statement();\n const endLine = this._currentLine;\n return new Function(name, args, _return, body, startLine, endLine);\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 }\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.tokens.attr)) {\n this._attribute();\n }\n if (this._check(TokenTypes.keywords.if)) {\n return this._if_statement();\n }\n if (this._check(TokenTypes.keywords.switch)) {\n return this._switch_statement();\n }\n if (this._check(TokenTypes.keywords.loop)) {\n return this._loop_statement();\n }\n if (this._check(TokenTypes.keywords.for)) {\n return this._for_statement();\n }\n if (this._check(TokenTypes.keywords.while)) {\n return this._while_statement();\n }\n if (this._check(TokenTypes.keywords.continuing)) {\n return this._continuing_statement();\n }\n if (this._check(TokenTypes.keywords.static_assert)) {\n return this._static_assert_statement();\n }\n if (this._check(TokenTypes.tokens.brace_left)) {\n return this._compound_statement();\n }\n let result = null;\n if (this._check(TokenTypes.keywords.return)) {\n result = this._return_statement();\n }\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ])) {\n result = this._variable_statement();\n }\n else if (this._match(TokenTypes.keywords.discard)) {\n result = new Discard();\n }\n else if (this._match(TokenTypes.keywords.break)) {\n result = new Break();\n }\n else if (this._match(TokenTypes.keywords.continue)) {\n result = new Continue();\n }\n else {\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n }\n if (result != null) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n }\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert)) {\n return null;\n }\n const 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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._short_circuit_or_expression();\n }\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 }\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 }\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 }\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 }\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore) {\n _var = this._unary_expression();\n }\n if (!isUnderscore && _var == null) {\n return null;\n }\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 }\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 }\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 // const_literal (comma const_literal)* comma?\n const selectors = [\n this._shift_expression(), //?.evaluate(this._context).toString() ?? \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push(this._shift_expression());\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 }\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0) {\n return statement;\n }\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 }\n const condition = this._optional_paren_expression();\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else)) {\n if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\n _else = this._compound_statement();\n }\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 if (this._check(TokenTypes.tokens.attr)) {\n this._attribute();\n }\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 }\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 }\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 arrayIndex = new ArrayIndex(expr);\n const p = this._postfix_expression();\n if (p) {\n arrayIndex.postfix = p;\n }\n return arrayIndex;\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 }\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 }\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right)) {\n break;\n }\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 }\n const startLine = this._currentLine;\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 }\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 endLine = this._currentLine;\n const structNode = new Struct(name, members, startLine, endLine);\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\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 }\n return new Override(name.toString(), type, null);\n }\n _diagnostic() {\n // diagnostic(severity_control_name, diagnostic_rule_name)\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('\");\n const severity = this._consume(TokenTypes.tokens.ident, \"Expected severity control name.\");\n this._consume(TokenTypes.tokens.comma, \"Expected ','\");\n const rule = this._consume(TokenTypes.tokens.ident, \"Expected diagnostic rule name.\");\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n return new Diagnostic(severity.toString(), rule.toString());\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 _requires_directive() {\n // requires extension [, extension]* semicolon\n const extensions = [this._consume(TokenTypes.tokens.ident, \"identity expected.\").toString()];\n while (this._match(TokenTypes.tokens.comma)) {\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n extensions.push(name.toString());\n }\n return new Requires(extensions);\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 }\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 }\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 }\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 let countNode = null;\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 countNode = this._shift_expression();\n // If we can't evaluate the node, defer evaluating it until after the shader has\n // finished being parsed, because const statements can be declared **after** they\n // are used.\n try {\n count = countNode.evaluate(this._context).toString();\n countNode = null;\n }\n catch (e) {\n count = \"1\";\n }\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n const arrayType = new ArrayType(array.toString(), attrs, format, countInt);\n if (countNode) {\n this._deferArrayCountEval.push({ arrayType, countNode });\n }\n return arrayType;\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 }\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type)) {\n return new SamplerType(this._previous().toString(), null, null);\n }\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 }\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 this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\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.resources = [];\n this.startLine = -1;\n this.endLine = -1;\n this.inUse = false;\n this.calls = new Set();\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 _FunctionResources {\n constructor(node) {\n this.resources = null;\n this.inUse = false;\n this.info = null;\n this.node = node;\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 /// All functions in the shader, including entry functions.\n this.functions = [];\n this._types = new Map();\n this._functions = 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 Function) {\n this._functions.set(node.name, new _FunctionResources(node));\n }\n }\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 }\n }\n for (const node of ast) {\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 const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.startLine = node.startLine;\n fn.endLine = node.endLine;\n this.functions.push(fn);\n this._functions.get(node.name).info = fn;\n if (stage) {\n this._functions.get(node.name).inUse = true;\n fn.inUse = true;\n fn.resources = this._findResources(node, !!stage);\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 for (const fn of this._functions.values()) {\n if (fn.info) {\n fn.info.inUse = fn.inUse;\n this._addCalls(fn.node, fn.info.calls);\n }\n }\n for (const u of this.uniforms) {\n this._markStructsInUse(u.type);\n }\n for (const s of this.storage) {\n this._markStructsInUse(s.type);\n }\n }\n _markStructsInUse(type) {\n if (type.isStruct) {\n type.inUse = true;\n for (const m of type.members) {\n this._markStructsInUse(m.type);\n }\n }\n else if (type.isArray) {\n this._markStructsInUse(type.format);\n }\n else if (type.isTemplate) {\n this._markStructsInUse(type.format);\n }\n else {\n const alias = this._getAlias(type.name);\n if (alias) {\n this._markStructsInUse(alias);\n }\n }\n }\n _addCalls(fn, calls) {\n var _a;\n for (const call of fn.calls) {\n const info = (_a = this._functions.get(call.name)) === null || _a === void 0 ? void 0 : _a.info;\n if (info) {\n calls.add(info);\n }\n }\n }\n /// Find a resource by its group and binding.\n findResource(group, binding) {\n for (const u of this.uniforms) {\n if (u.group == group && u.binding == binding) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.group == group && t.binding == binding) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.group == group && s.binding == binding) {\n return s;\n }\n }\n return null;\n }\n _findResource(name) {\n for (const u of this.uniforms) {\n if (u.name == name) {\n return u;\n }\n }\n for (const s of this.storage) {\n if (s.name == name) {\n return s;\n }\n }\n for (const t of this.textures) {\n if (t.name == name) {\n return t;\n }\n }\n for (const s of this.samplers) {\n if (s.name == name) {\n return s;\n }\n }\n return null;\n }\n _markStructsFromAST(type) {\n const info = this._getTypeInfo(type, null);\n this._markStructsInUse(info);\n }\n _findResources(fn, isEntry) {\n const resources = [];\n const self = this;\n const varStack = [];\n fn.search((node) => {\n if (node instanceof _BlockStart) {\n varStack.push({});\n }\n else if (node instanceof _BlockEnd) {\n varStack.pop();\n }\n else if (node instanceof Var) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof CreateExpr) {\n const c = node;\n if (isEntry && c.type !== null) {\n this._markStructsFromAST(c.type);\n }\n }\n else if (node instanceof Let) {\n const v = node;\n if (isEntry && v.type !== null) {\n this._markStructsFromAST(v.type);\n }\n if (varStack.length > 0) {\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof VariableExpr) {\n const v = node;\n // Check to see if the variable is a local variable before checking to see if it's\n // a resource.\n if (varStack.length > 0) {\n const varInfo = varStack[varStack.length - 1][v.name];\n if (varInfo) {\n return;\n }\n }\n const varInfo = self._findResource(v.name);\n if (varInfo) {\n resources.push(varInfo);\n }\n }\n else if (node instanceof CallExpr) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n else if (node instanceof Call) {\n const c = node;\n const callFn = self._functions.get(c.name);\n if (callFn) {\n if (isEntry) {\n callFn.inUse = true;\n }\n fn.calls.add(callFn.node);\n if (callFn.resources === null) {\n callFn.resources = self._findResources(callFn.node, isEntry);\n }\n resources.push(...callFn.resources);\n }\n }\n });\n return [...new Map(resources.map(r => [r.name, r])).values()];\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length) {\n groups.length = group + 1;\n }\n if (groups[group] === undefined) {\n groups[group] = [];\n }\n if (binding >= groups[group].length) {\n groups[group].length = binding + 1;\n }\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 }\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 }\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 }\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 }\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 }\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 }\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 info.startLine = s.startLine;\n info.endLine = s.endLine;\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 }\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 }\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 }\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 }\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 }\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name) {\n return a;\n }\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null) {\n return defaultValue;\n }\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, ArrayIndex, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Diagnostic, 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, Requires, 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, _BlockEnd, _BlockStart };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n FunctionInfo,\n ResourceType,\n} from 'wgsl_reflect';\nimport {\n WGSLType,\n} from './wgsl-types.js';\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 { WGSLType };\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: WGSLType;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\nexport type TextureDefinition = TypeDefinition & {\n type: string,\n};\n\nexport type SamplerDefinition = TypeDefinition & {\n type: string,\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\nexport type Resource = {\n name: string;\n group: number;\n entry: GPUBindGroupLayoutEntry;\n};\n\nexport type EntryPoint = {\n stage: GPUShaderStageFlags;\n resources: Resource[];\n}\n\nexport type EntryPoints = {\n [x: string]: EntryPoint;\n}\n\n/**\n * The data definitions and other reflection data from some WGSL shader source.\n */\nexport type ShaderDataDefinitions = {\n /**\n * definitions for uniform bindings by name\n */\n uniforms: VariableDefinitions,\n /**\n * definitions for storage bindings by name\n */\n storages: VariableDefinitions,\n /**\n * definitions for sampler bindings by name\n */\n samplers: VariableDefinitions,\n /**\n * definitions for texture bindings by name\n */\n textures: VariableDefinitions,\n /**\n * definitions for storage texture bindings by name\n */\n storageTextures: VariableDefinitions,\n /**\n * definitions for external texture bindings by name\n */\n externalTextures: VariableDefinitions,\n /**\n * definitions for structures by name\n */\n structs: StructDefinitions,\n /**\n * Entry points by name.\n */\n entryPoints: EntryPoints,\n};\n\n/**\n * This should be compatible with GPUProgramableStage\n */\nexport type ProgrammableStage = {\n entryPoint?: string,\n}\n\n/**\n * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor\n */\nexport type PipelineDescriptor = {\n vertex?: ProgrammableStage,\n fragment?: ProgrammableStage,\n compute?: ProgrammableStage,\n};\n\nfunction getEntryPointForStage(defs: ShaderDataDefinitions, stage: ProgrammableStage, stageFlags: GPUShaderStageFlags) {\n const {entryPoint: entryPointName} = stage;\n if (entryPointName) {\n const ep = defs.entryPoints[entryPointName];\n return (ep && ep.stage === stageFlags) ? ep : undefined;\n }\n\n return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0];\n}\n\nfunction getStageResources(defs: ShaderDataDefinitions, stage: ProgrammableStage | undefined, stageFlags: GPUShaderStageFlags) {\n if (!stage) {\n return [];\n }\n const entryPoint = getEntryPointForStage(defs, stage, stageFlags);\n return entryPoint?.resources || [];\n}\n\nconst byBinding = (a: GPUBindGroupLayoutEntry, b: GPUBindGroupLayoutEntry) => Math.sign(a.binding - b.binding);\n\n/**\n * Gets GPUBindGroupLayoutDescriptors for the given pipeline.\n *\n * Important: Assumes you pipeline is valid (it doesn't check for errors).\n *\n * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float\n * sampler can not be derived since it is unknown at compile time pipeline creation time\n * which texture you'll use.\n *\n * MAINTENANCE_TODO: Add example\n *\n * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as\n * returned from @link {makeShaderDataDefinitions}. If an array more than 1\n * definition it's assumed the vertex shader is in the first and the fragment\n * shader in the second.\n * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed\n * to `createRenderPipeline` or `createComputePipeline`.\n * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to\n * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group\n * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding.\n */\nexport function makeBindGroupLayoutDescriptors(\n defs: ShaderDataDefinitions | ShaderDataDefinitions[],\n desc: PipelineDescriptor,\n): GPUBindGroupLayoutDescriptor[] {\n defs = Array.isArray(defs) ? defs : [defs];\n const resources = [\n ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX),\n ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT),\n ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE),\n ];\n const bindGroupLayoutDescriptorsByGroupByBinding: Map[] = [];\n for (const resource of resources) {\n const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map();\n bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry;\n // Should we error here if the 2 don't match?\n const entry = bindingsToBindGroupEntry.get(resource.entry.binding);\n bindingsToBindGroupEntry.set(resource.entry.binding, {\n ...resource.entry,\n visibility: resource.entry.visibility | (entry?.visibility || 0),\n });\n }\n const descriptors = bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n for (let i = 0; i < descriptors.length; ++i) {\n if (!descriptors[i]) {\n descriptors[i] = { entries: [] };\n }\n }\n return descriptors;\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addVariableType(reflect, v, 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\nfunction getTextureSampleType(type: TypeInfo) {\n if (type.name.includes('depth')) {\n return 'depth';\n }\n // unfiltered-float\n switch ((type as TemplateInfo).format?.name) {\n case 'f32': return 'float';\n case 'i32': return 'sint';\n case 'u32': return 'uint';\n default:\n throw new Error('unknown texture sample type');\n }\n}\n\nfunction getViewDimension(type: TypeInfo): GPUTextureViewDimension {\n if (type.name.includes('2d_array')) {\n return '2d-array';\n }\n if (type.name.includes('cube_array')) {\n return 'cube-array';\n }\n if (type.name.includes('3d')) {\n return '3d';\n }\n if (type.name.includes('1d')) {\n return '1d';\n }\n if (type.name.includes('cube')) {\n return 'cube';\n }\n return '2d';\n}\n\nfunction getStorageTextureAccess(type: TypeInfo): GPUStorageTextureAccess {\n switch ((type as TemplateInfo).access) {\n case 'read': return 'read-only';\n case 'write': return 'write-only';\n case 'read_write': return 'read-write';\n default:\n throw new Error('unknonw storage texture access');\n }\n}\n\nfunction getSamplerType(type: TypeInfo) {\n // \"non-filtering\" can only be specified manually.\n return type.name.endsWith('_comparison')\n ? 'comparison'\n : 'filtering';\n}\n\nfunction getBindGroupLayoutEntry(resource: VariableInfo, visibility: GPUShaderStageFlags): GPUBindGroupLayoutEntry {\n const { binding, access, type } = resource;\n switch (resource.resourceType) {\n case ResourceType.Uniform:\n return {\n binding,\n visibility,\n buffer: {\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\n ...(resource.size && { minBindingSize: resource.size }),\n },\n };\n case ResourceType.Texture: {\n if (type.name === 'texture_external') {\n return {\n binding,\n visibility,\n externalTexture: {},\n };\n }\n const multisampled = type.name.includes('multisampled');\n return {\n binding,\n visibility,\n texture: {\n sampleType: getTextureSampleType(type),\n viewDimension: getViewDimension(type),\n multisampled,\n },\n };\n }\n case ResourceType.Sampler:\n return {\n binding,\n visibility,\n sampler: {\n type: getSamplerType(type),\n },\n };\n case ResourceType.StorageTexture:\n return {\n binding,\n visibility,\n storageTexture: {\n access: getStorageTextureAccess(type),\n format: ((type as TemplateInfo).format!.name as GPUTextureFormat),\n viewDimension: getViewDimension(type),\n },\n };\n default:\n throw new Error('unknown resource type');\n }\n}\n\nfunction addEntryPoints(funcInfos: FunctionInfo[], stage: GPUShaderStageFlags): EntryPoints {\n const entryPoints: EntryPoints = {};\n for (const info of funcInfos) {\n entryPoints[info.name] = {\n stage,\n resources: info.resources.map(resource => {\n const {name, group} = resource;\n return {\n name,\n group,\n entry: getBindGroupLayoutEntry(resource, stage),\n };\n }),\n };\n }\n return entryPoints;\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.filter(v => v.resourceType === ResourceType.Storage));\n const storageTextures = getNamedVariables(reflect, reflect.storage.filter(v => v.resourceType === ResourceType.StorageTexture));\n const textures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name !== 'texture_external'));\n const externalTextures = getNamedVariables(reflect, reflect.textures.filter(v => v.type.name === 'texture_external'));\n const samplers = getNamedVariables(reflect, reflect.samplers);\n\n const entryPoints: EntryPoints = {\n ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX),\n ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT),\n ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE),\n };\n\n return {\n externalTextures,\n samplers,\n structs,\n storages,\n storageTextures,\n textures,\n uniforms,\n entryPoints,\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\nfunction addVariableType(reflect: WgslReflect, v: VariableInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition |\n TextureDefinition |\n SamplerDefinition {\n switch (v.resourceType) {\n case ResourceType.Uniform:\n case ResourceType.Storage:\n case ResourceType.StorageTexture:\n return addType(reflect, v.type, offset);\n default:\n return {\n size: 0,\n type: v.type.name,\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: type as WGSLType,\n };\n }\n}\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction guessTextureBindingViewDimensionForTexture(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): number {\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\nfunction getMipmapGenerationWGSL(textureBindingViewDimension: GPUTextureViewDimension) {\n let textureSnippet;\n let sampleSnippet;\n switch (textureBindingViewDimension) {\n case '2d':\n textureSnippet = 'texture_2d';\n sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)';\n break;\n case '2d-array':\n textureSnippet = 'texture_2d_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)`;\n break;\n case 'cube':\n textureSnippet = 'texture_cube';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`;\n break;\n case 'cube-array':\n textureSnippet = 'texture_cube_array';\n sampleSnippet = `\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`;\n break;\n default:\n throw new Error(`unsupported view: ${textureBindingViewDimension}`);\n }\n return `\n const faceMat = array(\n mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x\n mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x\n mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y\n mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y\n mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z\n mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z\n\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 struct Uniforms {\n layer: u32,\n };\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: ${textureSnippet};\n @group(0) @binding(2) var uni: Uniforms;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n _ = uni.layer; // make sure this is used so all pipelines have the same bindings\n return ${sampleSnippet};\n }\n `;\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 RENDER_ATTACHMENT\n * and been created with mip levels\n *\n * @param device A GPUDevice\n * @param texture The texture to create mips for\n * @param textureBindingViewDimension This is only needed in compatibility mode\n * and it is only needed when the texture is going to be used as a cube map.\n */\nexport function generateMipmap(\n device: GPUDevice,\n texture: GPUTexture,\n textureBindingViewDimension?: GPUTextureViewDimension) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormatAndView: {},\n moduleByViewType: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n uniformBuffer,\n uniformValues,\n } = perDeviceInfo;\n const {\n pipelineByFormatAndView,\n moduleByViewType,\n } = perDeviceInfo;\n textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture);\n let module = moduleByViewType[textureBindingViewDimension];\n if (!module) {\n const code = getMipmapGenerationWGSL(textureBindingViewDimension);\n module = device.createShaderModule({\n label: `mip level generation for ${textureBindingViewDimension}`,\n code,\n });\n moduleByViewType[textureBindingViewDimension] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n magFilter: 'linear',\n });\n uniformBuffer = device.createBuffer({\n size: 16,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n uniformValues = new Uint32Array(1);\n Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues });\n }\n\n const id = `${texture.format}.${textureBindingViewDimension}`;\n\n if (!pipelineByFormatAndView[id]) {\n pipelineByFormatAndView[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${textureBindingViewDimension}`,\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 = pipelineByFormatAndView[id];\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n uniformValues[0] = baseArrayLayer;\n device.queue.writeBuffer(uniformBuffer, 0, uniformValues);\n\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: textureBindingViewDimension,\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n }),\n },\n { binding: 2, resource: { buffer: uniformBuffer }},\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n dimension: '2d',\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\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 const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n }\n }\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\nexport function 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\nexport function getNumComponents(array: ArrayUnion , arrayName: string): number {\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\nexport type 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 bufferLayouts: GPUVertexBufferLayout[],\n typedArrays: TypedArrayWithOffsetAndStride[],\n} {\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 = {}): BuffersAndAttributes {\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\n/**\n * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer`\n * for the buffers specified in `buffersAndAttributes`.\n *\n * This is extremely simple function. It is equivalent to\n *\n * ```js\n * buffersAndAttributes.buffers.forEach((buffer, i) => {\n * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n * });\n*\n * if (buffersAndAttributes.indexBuffer) {\n * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n * }\n * ```\n *\n * It exists solely for simple cases. If you have a complex case, call the passEncoder\n * yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n * @param firstVertexBufferIndex The first vertex buffer index. default = 0.\n */\nexport function setVertexAndIndexBuffers(\n passEncoder: GPURenderPassEncoder,\n buffersAndAttributes: BuffersAndAttributes,\n firstVertexBufferIndex = 0) {\n buffersAndAttributes.buffers.forEach((buffer, i) => {\n passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer);\n });\n\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!);\n }\n}\n\n/**\n * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed`\n *\n * This is an extremely simple function. See {@link setVertexAndIndexBuffers}.\n * If you need something more complex, call pass encoder functions yourself as appropriate.\n *\n * @param passEncoder a render pass encoder\n * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}\n */\nexport function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes) {\n setVertexAndIndexBuffers(passEncoder, buffersAndAttributes);\n if (buffersAndAttributes.indexBuffer) {\n passEncoder.drawIndexed(buffersAndAttributes.numElements);\n } else {\n passEncoder.draw(buffersAndAttributes.numElements);\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): 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 let tempTexture: GPUTexture | undefined;\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 // work around limit that you can't call copyExternalImageToTexture for 3d texture.\n // sse https://github.com/gpuweb/gpuweb/issues/4697 for if we can remove this\n let dstTexture = texture;\n let copyOrigin = origin;\n if (texture.dimension === '3d') {\n tempTexture = tempTexture ?? device.createTexture({\n format: texture.format,\n usage: texture.usage | GPUTextureUsage.COPY_SRC,\n size: [texture.width, texture.height, 1],\n });\n dstTexture = tempTexture;\n copyOrigin = [0, 0, 0];\n }\n\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture: dstTexture, premultipliedAlpha, colorSpace, origin: copyOrigin },\n getSizeFromSource(s, options),\n );\n\n if (tempTexture) {\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToTexture(\n { texture: tempTexture },\n { texture, origin },\n tempTexture,\n );\n device.queue.submit([encoder.finish()]);\n }\n }\n });\n\n if (tempTexture) {\n tempTexture.destroy();\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): number[] {\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 = {}): GPUTexture {\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 = {}): GPUTexture {\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 = {}): Promise {\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 = {}): Promise {\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 = {}): Promise {\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, getNumComponents, makeTypedArrayFromArrayUnion } 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(): number {\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// I couldn't figure out how to make this because TypedArrayWrapper wants a type\n// but this is explicity kind of type-less.\nfunction createAugmentedTypedArrayFromExisting(numComponents: number, numElements: number, existingArray: TypedArray) {\n const Ctor = existingArray.constructor as Float32ArrayConstructor;\n const array: Float32Array = new Ctor(numComponents * numElements) as unknown as Float32Array;\n return new TypedArrayWrapper(array, 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 params\n * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param params.xOffset the amount to offset the quad in X. Default = 0\n * @param params.yOffset the amount to offset the quad in Y. Default = 0\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices({\n size: inSize = 2, xOffset = 0, yOffset = 0\n } = {}): Arrays {\n const size = inSize * 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 params\n * @param params.width Width of the plane. Default = 1\n * @param params.depth Depth of the plane. Default = 1\n * @param params.subdivisionsWidth Number of steps across the plane. Default = 1\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius radius of the sphere. Default = 1\n * @param params.subdivisionsAxis number of steps around the sphere. Default = 24\n * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12\n * @param params.startLatitudeInRadians where to start the\n * top of the sphere. Default = 0\n * @param params.endLatitudeInRadians Where to end the\n * bottom of the sphere. Default = π\n * @param params.startLongitudeInRadians where to start\n * wrapping the sphere. Default = 0\n * @param params.endLongitudeInRadians where to end\n * wrapping the sphere. Default = 2π\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} = {}): Arrays {\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 params\n * @param params.size width, height and depth of the cube. Default = 1\n * @return The created vertices.\n */\nexport function createCubeVertices({size = 1} = {}): Arrays {\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. Default = 1\n * @param topRadius Top radius of truncated cone. Default = 0\n * @param height Height of truncated cone. Default = 1\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone. Default = 24\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone. Default = 1\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} = {}): Arrays {\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(): Arrays {\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 cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param params\n * @param params.radius Radius of cylinder. Default = 1\n * @param params.height Height of cylinder. Default = 1\n * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24\n * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1\n * @param params.topCap Create top cap. Default = true.\n * @param params.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} = {}): Arrays {\n return createTruncatedConeVertices({\n bottomRadius: radius,\n topRadius: radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap,\n });\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param params\n * @param params.radius radius of center of torus circle. Default = 1\n * @param params.thickness radius of torus ring. Default = 0.24\n * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24\n * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12\n * @param params.startAngle start angle in radians. Default = 0.\n * @param params.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} = {}): Arrays {\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 params\n * @param params.radius Radius of the ground plane. Default = 1\n * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24\n * @param params.stacks Number of radial divisions. Default = 1\n * @param params.innerRadius Default = 0\n * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1\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} = {}): Arrays {\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\nfunction allButIndices(name: string) {\n return name !== \"indices\";\n}\n\n/**\n * Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.\n */\nexport function deindex(arrays: Arrays): Arrays {\n const indicesP = arrays.indices;\n const newVertices: Arrays = {};\n const indices = makeTypedArrayFromArrayUnion(indicesP, 'indices');\n const numElements = indices.length;\n\n function expandToUnindexed(channel: string) {\n const srcBuffer = makeTypedArrayFromArrayUnion(arrays[channel], channel);\n const numComponents = getNumComponents(srcBuffer, channel);\n const dstBuffer = createAugmentedTypedArrayFromExisting(numComponents, numElements, srcBuffer);\n for (let ii = 0; ii < numElements; ++ii) {\n const ndx = indices[ii];\n const offset = ndx * numComponents;\n for (let jj = 0; jj < numComponents; ++jj) {\n dstBuffer.push(srcBuffer[offset + jj]);\n }\n }\n newVertices[channel] = dstBuffer.typedArray;\n }\n\n Object.keys(arrays).filter(allButIndices).forEach(expandToUnindexed);\n\n return newVertices;\n}\n\n// I don't want to pull in a whole math library\nconst normalize = ([x, y, z]: Float32Array) => {\n const len = x * x + y * y + z * z;\n return new Float32Array([x / len, y / len, z / len]);\n};\n\nconst subtract = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n for (let i = 0; i < a.length; ++i) {\n r[i] = a[i] - b[i];\n }\n return r;\n};\n\nconst cross = (a: Float32Array, b: Float32Array) => {\n const r = new Float32Array(a.length);\n\n r[0] = a[1] * b[2] - a[2] * b[1];\n r[1] = a[2] * b[0] - a[0] * b[2];\n r[2] = a[0] * b[1] - a[1] * b[0];\n\n return r;\n};\n\n/**\n * Generate triangle normals from positions.\n * Assumes every 3 values is a position and every 3 positions come from the same triangle\n */\nexport function generateTriangleNormals(positions: Float32Array): Float32Array {\n const normals = new Float32Array(positions.length);\n for (let ii = 0; ii < positions.length; ii += 9) {\n // pull out the 3 positions for this triangle\n const p0 = positions.subarray(ii , ii + 3);\n const p1 = positions.subarray(ii + 3, ii + 6);\n const p2 = positions.subarray(ii + 6, ii + 9);\n\n const n0 = normalize(subtract(p0, p1));\n const n1 = normalize(subtract(p0, p2));\n const n = cross(n0, n1);\n\n // copy them back in\n normals.set(n, ii);\n normals.set(n, ii + 3);\n normals.set(n, ii + 6);\n }\n\n return normals;\n}\n\n"],"names":["roundUpToMultipleOf","v","multiple","TypedArrayViewGenerator","arrayBuffer","byteOffset","constructor","sizeInBytes","this","ArrayBuffer","align","alignment","pad","numBytes","getView","Ctor","numElements","view","byteLength","subarray","arr","offset","length","isTypedArray","buffer","b","i32","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","mat2x3h","mat3x3f","mat3x3h","mat4x3f","mat4x3h","mat2x4f","mat2x4h","mat3x4f","mat3x4h","mat4x4f","mat4x4h","bool","kWGSLTypeInfo","kWGSLTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","makeIntrinsicTypedArrayView","typeDef","baseOffset","isArray","undefined","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","fields","elementType","makeTypedArrayViews","asArrayDef","asStructDef","asIntrinsicDef","getSizeOfTypeDef","makeViews","getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef","effectiveNumElements","fn","i","Array","fill","map","_","views","name","entries","setStructuredView","data","dataLen","stride","set","asArray","forEach","newValue","ndx","asViews","key","makeStructuredView","varDef","asVarDef","group","typeDefinition","s_views","WeakMap","viewsByCtor","get","Map","getViewsByCtor","setIntrinsicFromArrayLikeOfNumber","index","setTypedValues","isArrayLikeOfNumber","fieldDef","setStructuredValues","getAlignmentOfTypeDef","values","reduce","max","Math","unalignedSize","lastField","pop","getSizeAndAlignmentOfUnsizedArrayElement","ParseContext","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","search","callback","searchBlock","block","_BlockStart","instance","node","_BlockEnd","Statement","super","Function","args","returnType","body","startLine","endLine","calls","StaticAssert","expression","While","condition","Continuing","For","init","increment","_a","_b","_c","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Requires","extensions","Diagnostic","severity","rule","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","postfix","constant","ConstExpr","initializer","property","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","ArrayIndex","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","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","break","case","continue","default","diagnostic","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","requires","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","simpleTokens","literalTokens","regexTokens","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","simpleToken","_addToken","matchType","isAlpha","_isAlpha","isUnderscore","_isAlphaNumeric","nextChar","matchedType","_findType","nextLexeme","foundLessThan","ti","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_currentLine","_context","_deferArrayCountEval","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","arrayDecl","arrayType","countNode","e","scanner","_error","message","_peek","_check","l","_consume","tk","t","_previous","_type_alias","directive","_diagnostic","_requires_directive","_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","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","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","arrayIndex","_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","inUse","ArrayInfo","TemplateInfo","VariableInfo","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","resources","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","_FunctionResources","WgslReflect","code","uniforms","textures","samplers","overrides","entry","functions","_types","_functions","update","_isStorageTexture","ast","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_findResources","_getInputs","_getOutputs","_addCalls","u","_markStructsInUse","m","_getAlias","call","findResource","_findResource","_markStructsFromAST","isEntry","self","varStack","callFn","r","getBindGroups","groups","_makeRoom","_getStructOutputs","output","_getOutputInfo","typeInfo","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","E","_textureTypes","_samplerTypes","defaultValue","k","getStageResources","defs","stageFlags","entryPoint","entryPointName","ep","entryPoints","filter","getEntryPointForStage","byBinding","makeBindGroupLayoutDescriptors","desc","GPUShaderStage","VERTEX","FRAGMENT","COMPUTE","bindGroupLayoutDescriptorsByGroupByBinding","resource","bindingsToBindGroupEntry","visibility","descriptors","sort","getNamedVariables","reflect","variables","fromEntries","addType","addVariableType","makeStructDefinition","structInfo","getTextureSampleType","getViewDimension","getStorageTextureAccess","getSamplerType","endsWith","getBindGroupLayoutEntry","minBindingSize","externalTexture","multisampled","texture","sampleType","viewDimension","storageTexture","addEntryPoints","funcInfos","makeShaderDataDefinitions","storages","storageTextures","externalTextures","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","textureBindingViewDimension","perDeviceInfo","pipelineByFormatAndView","moduleByViewType","uniformBuffer","uniformValues","guessTextureBindingViewDimensionForTexture","module","textureSnippet","sampleSnippet","getMipmapGenerationWGSL","createShaderModule","label","createSampler","minFilter","magFilter","createBuffer","usage","GPUBufferUsage","UNIFORM","COPY_DST","assign","createRenderPipeline","layout","targets","pipeline","baseMipLevel","mipLevelCount","baseArrayLayer","queue","writeBuffer","bindGroup","createBindGroup","getBindGroupLayout","createView","renderPassDescriptor","colorAttachments","arrayLayerCount","loadOp","storeOp","encoder","createCommandEncoder","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","getNumComponents","arrayName","getArray","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","totalNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","createBuffersAndAttributesFromArrays","buffers","bufferNdx","attribs","attrib0","data0","mappedAtCreation","getMappedRange","unmap","buffersAndAttributes","indicesEntry","find","indices","indexBuffer","INDEX","indexFormat","setVertexAndIndexBuffers","passEncoder","firstVertexBufferIndex","setVertexBuffer","setIndexBuffer","drawArrays","drawIndexed","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","tempTexture","layer","dstTexture","copyOrigin","createTexture","GPUTextureUsage","COPY_SRC","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","copyTextureToTexture","destroy","copySourceToTexture","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","mips","TEXTURE_BINDING","RENDER_ATTACHMENT","createTextureFromSource","async","loadImageBitmap","url","res","fetch","blob","opt","colorSpaceConversion","createImageBitmap","createTextureFromImages","urls","Promise","all","createTextureFromImage","TypedArrayWrapper","cursor","reset","createAugmentedTypedArray","CUBE_FACE_INDICES","createTruncatedConeVertices","bottomRadius","topRadius","radialSubdivisions","verticalSubdivisions","topCap","bottomCap","extra","numVertices","positions","normals","texcoords","vertsAroundEdge","slant","cosSlant","sinSlant","yy","ringRadius","y","ii","position","normal","texcoord","expandRLEData","rleData","padding","runLength","element","jj","allButIndices","x","z","len","subtract","cross","colors","numVerts","color","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","radius","divisions","stacks","innerRadius","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","thickness","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","inSize","xOffset","yOffset","indicesP","newVertices","channel","srcBuffer","dstBuffer","existingArray","createAugmentedTypedArrayFromExisting","p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unB,EAAGiT,GACfT,EAAQ/5B,IAAIunB,EAAGiT,EAAK,GACpBT,EAAQ/5B,IAAIunB,EAAGiT,EAAK,EACrB,CAED,OAAOT,CACT","x_google_ignoreList":[4]} \ No newline at end of file diff --git a/docs/functions/makeStructuredView.html b/docs/functions/makeStructuredView.html index 9cde8ba..6397dd1 100644 --- a/docs/functions/makeStructuredView.html +++ b/docs/functions/makeStructuredView.html @@ -41,6 +41,35 @@
offset:

Returns StructuredView

TypedArray views for the various named fields of the structure as well as a set function to make them easy to set, and the arrayBuffer

+
const code = `
struct HSL {
hue: f32,
sat: f32,
lum: f32,
};
struct MyStorage {
colors: array<HSL, 4>,
brightness: f32,
kernel: array<f32, 9>,
};
@group(0) @binding(0) var<storage> myStorage: MyStorage;
`;
const defs = makeShaderDataDefinitions(code);
const myUniformValues = makeStructuredView(defs.storages.myStorage);

myUniformValues.set({
colors: [
,
,
{ hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color
],
brightness: 0.8,
kernel: [
1, 0, -1,
2, 0, -2,
1, 0, -1,
],
}); +
+

data definition can come from `

+

What this function does:

+
    +
  1. It creates an ArrayBuffer of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer)

    +
  2. +
  3. It makes TypedArray views of to match the definition.

    +
  4. +
  5. It returns an object with the the ArrayBuffer, the TypedArray views, and a set function which is just a wrapper +for setStructView that passes in the views.

    +
  6. +
+

For example: Given a data definition created by makeShaderDataDefinitions for this WGSL

+
struct Light {
lightWorldPosition: vec3f,
shininess: f32,
lightDirection: vec3f,
innerLimit: f32,
outerLimit: f32,
};
struct Uniforms {
normalMatrix: mat3x3f,
worldViewProjection: mat4x4f,
world: mat4x4f,
color: vec4f,
viewWorldPosition: vec3f,
lights: array<Light, 3>,
};
@group(0) @binding(0) var<uniform> myUniforms: Uniforms; +
+

makeStructuredView(defs.uniforms.myUniforms) would return this

+
const arrayBuffer = new ArrayBuffer(368)
const views = {
normalMatrix: new Float32Array(arrayBuffer, 0, 12),
worldViewProjection: new Float32Array(arrayBuffer, 48, 16),
world: new Float32Array(arrayBuffer, 112, 16),
color: new Float32Array(arrayBuffer, 176, 4),
viewWorldPosition: new Float32Array(arrayBuffer, 192, 3),
lights: [
{
lightWorldPosition: new Float32Array(arrayBuffer, 208, 3),
shininess: new Float32Array(arrayBuffer, 220, 1),
lightDirection: new Float32Array(arrayBuffer, 224, 3),
innerLimit: new Float32Array(arrayBuffer, 236, 1),
outerLimit: new Float32Array(arrayBuffer, 240, 1),
},
{
lightWorldPosition: new Float32Array(arrayBuffer, 256, 3),
shininess: new Float32Array(arrayBuffer, 268, 1),
lightDirection: new Float32Array(arrayBuffer, 272, 3),
innerLimit: new Float32Array(arrayBuffer, 284, 1),
outerLimit: new Float32Array(arrayBuffer, 288, 1),
},
{
lightWorldPosition: new Float32Array(arrayBuffer, 304, 3),
shininess: new Float32Array(arrayBuffer, 316, 1),
lightDirection: new Float32Array(arrayBuffer, 320, 3),
innerLimit: new Float32Array(arrayBuffer, 332, 1),
outerLimit: new Float32Array(arrayBuffer, 336, 1),
},
],
mode: new Uint32Array(UniformsValues, 352, 1),
};
result = {
arrayBuffer,
views,
set(data: any) {
setStructuredView(data, views.views);
},
} +
+

From this, you can see you can set the value in the array buffer for any field/member/property +directly. Example

+
result.views.lights[2].lightDirection.set([7, 8, 9]);
result.views.lights[2].innerLimit[0] = 4; +
+

set just takes a JS object and matches property names to the view names.

+
result.set({
color: [1, 1, 0, 1],
viewWorldPosition: [12, 34, 56],
mode: 8,
}); +
+

Is equivalent to

+
result.views.color.set([1, 1, 0, 1]);
result.views.worldViewPosition.set([12, 34, 56]);
result.views.mode[0] = 8; +
diff --git a/docs/index.html b/docs/index.html index 34fd32d..1eed096 100644 --- a/docs/index.html +++ b/docs/index.html @@ -23,6 +23,7 @@

webgpu-utils

Easily set Uniforms (based on your WGSL structs/types)

Example:

import {
makeShaderDataDefinitions,
makeStructuredView,
} from 'webgpu-utils';

const code = `
struct MyUniforms {
color: vec4f,
brightness: f32,
kernel: array<f32, 9>,
projectionMatrix: mat4x4f,
};
@group(0) @binding(0) var<uniform> myUniforms: MyUniforms;
`;

const defs = makeShaderDataDefinitions(code);
const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);

// create the correct sized buffer
const uniformBuffer = device.createBuffer({
size: myUniformValues.arrayBuffer.byteLength,
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
});

// Set some values via set
myUniformValues.set({
color: [1, 0, 1, 1],
brightness: 0.8,
kernel: [
1, 0, -1,
2, 0, -2,
1, 0, -1,
],
});

// Set a value by passing it to a math library
mat4.perspective(
degToRad(45),
canvas.clientWidth / canvas.clientHeight,
0.1,
20,
myUniformValues.views.projectionMatrix);

// Upload the data to the GPU
device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);
+

See makeStructuredView for details.

Load an image URL as a texture (with mips)

import { createTextureFromImage } from 'webgpu-utils';

const texture = await createTextureFromImage(device, 'https://someimage.url', {
mips: true,
flipY: true,
});

Load a canvas/video/ImageBitmap as a texture (with mips)

import { createTextureFromSource } from 'webgpu-utils';

const texture = createTextureFromSource(device, someCanvasVideoImageBitmap, {
mips: true,
flipY: true,
}); diff --git a/docs/types/ShaderDataDefinitions.html b/docs/types/ShaderDataDefinitions.html index 0de6725..70e73a3 100644 --- a/docs/types/ShaderDataDefinitions.html +++ b/docs/types/ShaderDataDefinitions.html @@ -16,28 +16,51 @@
  • ShaderDataDefinitions
  • Type alias ShaderDataDefinitions

    ShaderDataDefinitions: {
        entryPoints: EntryPoints;
        externalTextures: VariableDefinitions;
        samplers: VariableDefinitions;
        storageTextures: VariableDefinitions;
        storages: VariableDefinitions;
        structs: StructDefinitions;
        textures: VariableDefinitions;
        uniforms: VariableDefinitions;
    }
    -

    Warning: The properties of this type will probably be changed -in a future version. Please consider this an opaque type.

    +

    The data definitions and other reflection data from some WGSL shader source.

    Type declaration

    +
    uniforms: VariableDefinitions
    +

    definitions for uniform bindings by name

    +
    +
    +

    See makeStructuredView for details.

    Load an image URL as a texture (with mips)

    import { createTextureFromImage } from 'webgpu-utils';
     
    diff --git a/package-lock.json b/package-lock.json
    index 1d8d40e..bf47ece 100644
    --- a/package-lock.json
    +++ b/package-lock.json
    @@ -1,12 +1,12 @@
     {
       "name": "webgpu-utils",
    -  "version": "1.9.2",
    +  "version": "1.9.3",
       "lockfileVersion": 3,
       "requires": true,
       "packages": {
         "": {
           "name": "webgpu-utils",
    -      "version": "1.9.2",
    +      "version": "1.9.3",
           "license": "MIT",
           "devDependencies": {
             "@rollup/plugin-node-resolve": "^15.2.3",
    diff --git a/package.json b/package.json
    index 0d8e6f7..fc8583a 100644
    --- a/package.json
    +++ b/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "webgpu-utils",
    -  "version": "1.9.2",
    +  "version": "1.9.3",
       "description": "webgpu utilities",
       "main": "dist/1.x/webgpu-utils.module.js",
       "module": "dist/1.x/webgpu-utils.module.js",
    diff --git a/src/buffer-views.ts b/src/buffer-views.ts
    index 5abd519..e6a35aa 100644
    --- a/src/buffer-views.ts
    +++ b/src/buffer-views.ts
    @@ -307,15 +307,15 @@ export type StructuredView = ArrayBufferViews & {
          *   sat: f32,
          *   lum: f32,
          * };
    -     * struct MyUniforms {
    +     * struct MyStorage {
          *    colors: array,
          *    brightness: f32,
          *    kernel: array,
          * };
    -     * @group(0) @binding(0) var myUniforms: MyUniforms;
    +     * @group(0) @binding(0) var myStorage: MyStorage;
          * `;
          * const defs = makeShaderDataDefinitions(code);
    -     * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);
    +     * const myUniformValues = makeStructuredView(defs.storages.myStorage);
          *
          * myUniformValues.set({
          *   colors: [
    @@ -339,11 +339,146 @@ export type StructuredView = ArrayBufferViews & {
     
     /**
      * Given a VariableDefinition, create matching TypedArray views
    + *
      * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}
      * @param arrayBuffer Optional ArrayBuffer for the views
      * @param offset Optional offset into the ArrayBuffer for the views
      * @returns TypedArray views for the various named fields of the structure as well
      *    as a `set` function to make them easy to set, and the arrayBuffer
    + *
    + * ```js
    + * const code = `
    + * struct HSL {
    + *   hue: f32,
    + *   sat: f32,
    + *   lum: f32,
    + * };
    + * struct MyStorage {
    + *    colors: array,
    + *    brightness: f32,
    + *    kernel: array,
    + * };
    + * @group(0) @binding(0) var myStorage: MyStorage;
    + * `;
    + * const defs = makeShaderDataDefinitions(code);
    + * const myUniformValues = makeStructuredView(defs.storages.myStorage);
    + *
    + * myUniformValues.set({
    + *   colors: [
    + *     ,
    + *     ,
    + *     { hue: 0.5, sat: 1.0, lum: 0.5 },  // only set the 3rd color
    + *   ],
    + *   brightness: 0.8,
    + *   kernel: [
    + *      1, 0, -1,
    + *      2, 0, -2,
    + *      1, 0, -1,
    + *   ],
    + * });
    + * ```
    + *
    + * data definition can come from `
    + *
    + * What this function does:
    + *
    + * 1. It creates an `ArrayBuffer` of the size equal to the definition passed in (unless you pass in an existing ArrayBuffer)
    + *
    + * 2. It makes `TypedArray` views of to match the definition.
    + *
    + * 3. It returns an object with the the `ArrayBuffer`, the TypedArray views, and a `set` function which is just a wrapper
    + *    for `setStructView` that passes in the views.
    + *
    + * For example: Given a data definition created by makeShaderDataDefinitions for this WGSL
    + *
    + * ```wgsl
    + * struct Light {
    + *   lightWorldPosition: vec3f,
    + *   shininess: f32,
    + *   lightDirection: vec3f,
    + *   innerLimit: f32,
    + *   outerLimit: f32,
    + * };
    + * struct Uniforms {
    + *   normalMatrix: mat3x3f,
    + *   worldViewProjection: mat4x4f,
    + *   world: mat4x4f,
    + *   color: vec4f,
    + *   viewWorldPosition: vec3f,
    + *   lights: array,
    + * };
    + * @group(0) @binding(0) var myUniforms: Uniforms;
    + * ```
    + *
    + * `makeStructuredView(defs.uniforms.myUniforms)` would return this
    + *
    + * ```js
    + * const arrayBuffer = new ArrayBuffer(368)
    + * const views = {
    + *   normalMatrix: new Float32Array(arrayBuffer, 0, 12),
    + *   worldViewProjection: new Float32Array(arrayBuffer, 48, 16),
    + *   world: new Float32Array(arrayBuffer, 112, 16),
    + *   color: new Float32Array(arrayBuffer, 176, 4),
    + *   viewWorldPosition: new Float32Array(arrayBuffer, 192, 3),
    + *   lights: [
    + *     {
    + *       lightWorldPosition: new Float32Array(arrayBuffer, 208, 3),
    + *       shininess: new Float32Array(arrayBuffer, 220, 1),
    + *       lightDirection: new Float32Array(arrayBuffer, 224, 3),
    + *       innerLimit: new Float32Array(arrayBuffer, 236, 1),
    + *       outerLimit: new Float32Array(arrayBuffer, 240, 1),
    + *     },
    + *     {
    + *       lightWorldPosition: new Float32Array(arrayBuffer, 256, 3),
    + *       shininess: new Float32Array(arrayBuffer, 268, 1),
    + *       lightDirection: new Float32Array(arrayBuffer, 272, 3),
    + *       innerLimit: new Float32Array(arrayBuffer, 284, 1),
    + *       outerLimit: new Float32Array(arrayBuffer, 288, 1),
    + *     },
    + *     {
    + *       lightWorldPosition: new Float32Array(arrayBuffer, 304, 3),
    + *       shininess: new Float32Array(arrayBuffer, 316, 1),
    + *       lightDirection: new Float32Array(arrayBuffer, 320, 3),
    + *       innerLimit: new Float32Array(arrayBuffer, 332, 1),
    + *       outerLimit: new Float32Array(arrayBuffer, 336, 1),
    + *     },
    + *   ],
    + *   mode: new Uint32Array(UniformsValues, 352, 1),
    + * };
    + * result = {
    + *   arrayBuffer,
    + *   views,
    + *   set(data: any) {
    + *     setStructuredView(data, views.views);
    + *   },
    + * }
    + * ```
    + *
    + * From this, you can see you can set the value in the array buffer for any field/member/property
    + * directly. Example
    + *
    + * ```js
    + * result.views.lights[2].lightDirection.set([7, 8, 9]);
    + * result.views.lights[2].innerLimit[0] = 4;
    + * ```
    + *
    + * `set` just takes a JS object and matches property names to the view names.
    + *
    + * ```js
    + * result.set({
    + *   color: [1, 1, 0, 1],
    + *   viewWorldPosition: [12, 34, 56],
    + *   mode: 8,
    + * });
    + * ```
    + *
    + * Is equivalent to
    + *
    + * ```js
    + * result.views.color.set([1, 1, 0, 1]);
    + * result.views.worldViewPosition.set([12, 34, 56]);
    + * result.views.mode[0] = 8;
    + * ```
      */
     export function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {
         const asVarDef = varDef as VariableDefinition;
    diff --git a/src/data-definitions.ts b/src/data-definitions.ts
    index 0677f12..2ef4741 100644
    --- a/src/data-definitions.ts
    +++ b/src/data-definitions.ts
    @@ -90,17 +90,40 @@ export type EntryPoints = {
     }
     
     /**
    - * Warning: The properties of this type will probably be changed
    - * in a future version. Please consider this an opaque type.
    + * The data definitions and other reflection data from some WGSL shader source.
      */
     export type ShaderDataDefinitions = {
    +    /**
    +     * definitions for uniform bindings by name
    +     */
         uniforms: VariableDefinitions,
    +    /**
    +     * definitions for storage bindings by name
    +     */
         storages: VariableDefinitions,
    +    /**
    +     * definitions for sampler bindings by name
    +     */
         samplers: VariableDefinitions,
    +    /**
    +     * definitions for texture bindings by name
    +     */
         textures: VariableDefinitions,
    +    /**
    +     * definitions for storage texture bindings by name
    +     */
         storageTextures: VariableDefinitions,
    +    /**
    +     * definitions for external texture bindings by name
    +     */
         externalTextures: VariableDefinitions,
    +    /**
    +     * definitions for structures by name
    +     */
         structs: StructDefinitions,
    +    /**
    +     * Entry points by name.
    +     */
         entryPoints: EntryPoints,
     };