diff --git a/.vscode/settings.json b/.vscode/settings.json index 3a9abc9..dd983b8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,5 @@ { "cSpell.words": [ - "multisampled", - "unfilterable", "unpadded" ] } \ No newline at end of file diff --git a/CHANGELIST.md b/CHANGELIST.md index 6b81375..bd41771 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -1,37 +1,5 @@ # Change List -### 1.3.0 - -* Add `makeBindGroupLayoutDescriptors` - -### 1.2.0 - -* Add `getSizeOfUnsizedArrayElement` - -### 1.1.0 - -* Make `generateMipmap` support compatibility mode - -### 1.0.0 - -* switch primitive functions to use named parameters. - -### 0.15.0 - -* add `setIntrinsicsToView` - -### 0.14.3 - -* Fixes for vec2 typos - -### 0.14.2 - -* Handle bool issue fix - -### 0.14.0 - -* Use latest wgsl_reflect - ### 0.13.0 * Support making views of unsized arrays diff --git a/README.md b/README.md index 74faca7..5f20e9b 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,6 @@ See [here](https://greggman.github.io/webgpu-utils/docs) -* [ChangeList](https://github.com/greggman/webgpu-utils/CHANGELIST.md) -* [Migration Notes](https://github.com/greggman/webgpu-utils/migration.md) - ## Random useful things for WebGPU As I do more WebGPU I find I need more and more helpers to make things @@ -42,7 +39,7 @@ const myUniformValues = makeStructuredView(defs.uniforms.myUniforms); // create the correct sized buffer const uniformBuffer = device.createBuffer({ - size: myUniformValues.arrayBuffer.byteLength, + size: myUniformBuffer.arrayBuffer.byteLength, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, }); @@ -203,68 +200,6 @@ passEncoder.setIndexBuffer(bi.indexBuffer, bi.indexFormat); passEncoder.drawIndexed(bi.numElements); ``` -### Create `GPUBindGroupLayoutDescriptors` from WGSL code - -```js -import { - makeShaderDataDefinitions, - makeBindGroupLayoutDescriptors, -} from 'webgpu-utils'; - -const code = ` -@group(0) @binding(0) var mat: mat4x4f; - -struct MyVSOutput { - @builtin(position) position: vec4f, - @location(1) texcoord: vec2f, -}; - -@vertex -fn myVSMain(v: MyVSInput) -> MyVSOutput { - var vsOut: MyVSOutput; - vsOut.position = mat * v.position; - vsOut.texcoord = v.texcoord; - return vsOut; -} - -@group(0) @binding(2) var diffuseSampler: sampler; -@group(0) @binding(3) var diffuseTexture: texture_2d; - -@fragment -fn myFSMain(v: MyVSOutput) -> @location(0) vec4f { - return textureSample(diffuseTexture, diffuseSampler, v.texcoord); -} -`; - -const module = device.createShaderModule({code}); -const defs = wgh.makeShaderDataDefinitions(code); - -const pipelineDesc = { - vertex: { - module, - entryPoint: 'myVSMain', - buffers: bufferLayouts, - }, - fragment: { - module, - entryPoint: 'myFSMain', - targets: [ - {format: presentationFormat}, - ], - }, -}; - -const descriptors = wgh.makeBindGroupLayoutDescriptors(defs, pipelineDesc); -const group0Layout = device.createBindGroupLayout(descriptors[0]); -const layout = device.createPipelineLayout({ - bindGroupLayouts: [group0Layout], -}); -const pipeline = device.createRenderPipeline({ - layout, - ...pipelineDesc, -}); -``` - ## Examples: * [Cube](examples/cube.html) @@ -275,7 +210,7 @@ const pipeline = device.createRenderPipeline({ ## Notes about structured data -### The first level of an array of intrinsic types is flattened by default. +### The first level of an array of intrinsic types is flattened. Example: @@ -311,28 +246,6 @@ The reason it's this way is it's common to make large arrays of `f32`, `u32`, `vec2f`, `vec3f`, `vec4f` etc. We wouldn't want every element of an array to have its own typedarray view. -You can configure this per type by calling `setIntrinsicsToView`. -The configuration is global. Given th example above - -```js -const code = ` -@group(0) @binding(0) var uni1: array; -@group(0) @binding(1) var uni2: array, 4>; -`; -const defs = makeShaderDataDefinitions(code); -setIntrinsicsToView(['vec3f']); -const uni1 = makeStructuredView(defs.uniforms.uni1); - -uni1.set([ - [1, 2, 3], // uni1[0] - [4, 5, 6], // uni1[1] - ... -]); -``` - -Or to put it another way, in the default case, `uni1.views is a Float32Array(16)`. -In the 2nd case it's an array of 4 `Float32Array` each 3 elements big - ### arrays of intrinsics can be set by arrays of arrays ```js @@ -363,50 +276,12 @@ Example: ```js const code = ` -@group(0) @binding(0) var buf1: array; // unsized array -`; -const defs = makeShaderDataDefinitions(code); -const buf1 = makeStructuredView(defs.storages.buf1, new ArrayBuffer(4 * 16)); - -// buf1.views will be a Float32Array representing 4 vec3fs -``` - -Note: If you have a complex array element type you can call -`getSizeOfUnsizedArrayElement` to get its size. Example: - -```js -const code = ` -struct Light { - intensity: f32, - direction: vec3f, -}; -@group(0) @binding(7) var lights: array; +@group(0) @binding(0) var uni1: array; // unsized array `; const defs = makeShaderDataDefinitions(code); -const {size} = getSizeOfUnsizedArrayElement(defs.storages.lights); -const numLights = 4; -const buf1 = makeStructuredView( - defs.storages.lights, new ArrayBuffer(numLights * size)); -``` +const uni1 = makeStructuredView(defs.uniforms.uni1, new ArrayBuffer(4 * 16)); -Similarly if you are using an unsized array as the last member of a struct -you might do this - -```js -const code = ` -struct Kernel { - amount: f32, - entries: array, -}; -@group(0) @binding(7) var conv: Kernel; -`; -const defs = makeShaderDataDefinitions(code); -const {size: elemSize} = getSizeOfUnsizedArrayElement(defs.storages.conv); -const numKernelEntries = 4; -const size = defs.storages.conv.size + numKernelEntries * elemSize; -const buf1 = makeStructuredView( - defs.storages.conv, new ArrayBuffer(size)); -) +// uni.views will be a Float32Array representing 4 vec3fs ``` ## Usage @@ -414,7 +289,7 @@ const buf1 = makeStructuredView( * include from the net ```js -import { createTextureFromImage } from 'https://greggman.github.io/webgpu-utils/dist/1.x/webgpu-utils.module.js' +import { createTextureFromImage } from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js' ... ``` @@ -433,25 +308,21 @@ import { createTextureFromImage } from 'webgpu-utils'; ... ``` -## Examples - -* [2d-array texture](examples/2d-array.html) -* [cube](examples/cube.html) -* [cube-map](examples/cube-map.html) -* [instancing](examples/instancing.html) -* [primitives](examples/primitives.html) - ## Development ``` git clone https://github.com/greggman/webgpu-utils.git cd webgpu-utils -npm ci +npm install npm start ``` This will run rollup in watch mode, building from typescript into -`dist/1.x/webgpu-utils.js` and start a server +`dist/0.x/webgpu-utils.js`. + +``` +npx servez +``` Now open [`http://localhost:8080/test/`](http://localhost:8080/test/) to run tests. @@ -462,3 +333,4 @@ Super thanks to Brendan Duncan for [wgsl-reflect](https://github.com/brendan-dun ## License [MIT](LICENSE.md) + diff --git a/build/tools/serve.js b/build/tools/serve.js deleted file mode 100644 index 377844a..0000000 --- a/build/tools/serve.js +++ /dev/null @@ -1,16 +0,0 @@ -import {spawn} from 'child_process'; - -spawn('npm', [ - 'run', - 'watch', -], { - shell: true, - stdio: 'inherit', -}); - -spawn('./node_modules/.bin/servez', [ -], { - shell: true, - stdio: 'inherit', -}); - diff --git a/dist/0.x/attribute-utils.d.ts b/dist/0.x/attribute-utils.d.ts index 9c913c0..4b3d050 100644 --- a/dist/0.x/attribute-utils.d.ts +++ b/dist/0.x/attribute-utils.d.ts @@ -20,14 +20,14 @@ export type ArrayUnion = number | number[] | TypedArray | FullArraySpec; * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec} * * If it's a native array then, if the name of the array is `indices` the data will be converted - * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type. - * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray + * to a `Uint32Array`, otherwise a `Float32Array. Use a TypedArray or a FullArraySpec to choose a different type. + * The FullArraySpec type is only used if it's not already a TypedArray * * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not - * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2. + * specified it will be guess. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2. * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3. * - * For attribute formats, guesses are made based on type and number of components. The guess is + * For attribute formats, guesses are made based on type at number of components. The guess is * based on this table where (d) is the default for that type if `normalize` is not specified * * | Type | .. | normalize | diff --git a/dist/0.x/buffer-views.d.ts b/dist/0.x/buffer-views.d.ts index 8aed415..facd3aa 100644 --- a/dist/0.x/buffer-views.d.ts +++ b/dist/0.x/buffer-views.d.ts @@ -1,56 +1,5 @@ import { StructDefinition, TypeDefinition, VariableDefinition } from './data-definitions.js'; -import { TypedArrayConstructor, TypedArray } from './typed-arrays.js'; -type TypeDef = { - numElements: number; - align: number; - size: number; - type: string; - View: TypedArrayConstructor; - flatten?: boolean; - pad?: readonly number[]; -}; -declare const typeInfo: { - readonly [K: string]: TypeDef; -}; -export type kType = Extract; -export declare const kTypes: readonly kType[]; -/** - * Set which intrinsic types to make views for. - * - * Example: - * - * Given a an array of intrinsics like this - * `array` - * - * The default is to create a single `Float32Array(4 * 200)` - * because creating 200 `Float32Array` views is not usually - * what you want. - * - * If you do want individual views then you'd call - * `setIntrinsicsToView(['vec3f`])` and now you get - * an array of 200 `Float32Array`s. - * - * Note: `setIntrinsicsToView` always sets ALL types. The list you - * pass it is the types you want views created for, all other types - * will be reset to do the default. In other words - * - * ```js - * setIntrinsicsToView(['vec3f`]) - * setIntrinsicsToView(['vec2f`]) - * ``` - * - * Only `vec2f` will have views created. `vec3f` has been reset to the default by - * the second call - * - * You can pass in `true` as the 2nd parameter to make it set which types - * to flatten and all others will be set to have views created. - * - * To reset all types to the default call it with no arguments - * - * @param types array of types to make views for - * @param flatten whether to flatten or expand the specified types. - */ -export declare function setIntrinsicsToView(types?: readonly kType[], flatten?: boolean): void; +import { TypedArray } from './typed-arrays.js'; export type TypedArrayOrViews = TypedArray | Views | Views[]; export interface Views { [x: string]: TypedArrayOrViews; @@ -204,4 +153,3 @@ export declare function setTypedValues(typeDef: TypeDefinition, data: any, array * @param offset An offset in the arrayBuffer to start at. */ export declare function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset?: number): void; -export {}; diff --git a/dist/0.x/utils.d.ts b/dist/0.x/utils.d.ts index 30b83b7..e0b65b2 100644 --- a/dist/0.x/utils.d.ts +++ b/dist/0.x/utils.d.ts @@ -1,5 +1 @@ export declare const roundUpToMultipleOf: (v: number, multiple: number) => number; -export declare function keysOf(obj: { - [k in T]: unknown; -}): readonly T[]; -export declare function range(count: number, fn: (i: number) => T): T[]; diff --git a/dist/0.x/webgpu-utils.js b/dist/0.x/webgpu-utils.js index f882a84..1c7cd1e 100644 --- a/dist/0.x/webgpu-utils.js +++ b/dist/0.x/webgpu-utils.js @@ -1,4 +1,4 @@ -/* webgpu-utils@0.15.0, license MIT */ +/* webgpu-utils@0.14.1, license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -6,12 +6,6 @@ })(this, (function (exports) { 'use strict'; const roundUpToMultipleOf = (v, multiple) => (((v + multiple - 1) / multiple) | 0) * multiple; - function keysOf(obj) { - return Object.keys(obj); - } - function range(count, fn) { - return new Array(count).fill(0).map((_, i) => fn(i)); - } class TypedArrayViewGenerator { arrayBuffer; @@ -74,16 +68,12 @@ mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array }, mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array }, mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array }, - // Note: At least as of WGSL V1 you can not create a bool for uniform or storage. - // You can only create one in an internal struct. But, this code generates - // views of structs and it needs to not fail if the struct has a bool - bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array }, }; const typeInfo = { ...b, - 'vec2': b.vec2i, - 'vec2': b.vec2u, - 'vec2': b.vec2f, + 'vec2': b.vec2f, + 'vec2': b.vec2i, + 'vec2': b.vec2u, 'vec2': b.vec2h, 'vec3': b.vec3i, 'vec3': b.vec3u, @@ -112,56 +102,6 @@ 'mat4x4': b.mat4x4f, 'mat4x4': b.mat4x4h, }; - const kTypes = keysOf(typeInfo); - /** - * Set which intrinsic types to make views for. - * - * Example: - * - * Given a an array of intrinsics like this - * `array` - * - * The default is to create a single `Float32Array(4 * 200)` - * because creating 200 `Float32Array` views is not usually - * what you want. - * - * If you do want individual views then you'd call - * `setIntrinsicsToView(['vec3f`])` and now you get - * an array of 200 `Float32Array`s. - * - * Note: `setIntrinsicsToView` always sets ALL types. The list you - * pass it is the types you want views created for, all other types - * will be reset to do the default. In other words - * - * ```js - * setIntrinsicsToView(['vec3f`]) - * setIntrinsicsToView(['vec2f`]) - * ``` - * - * Only `vec2f` will have views created. `vec3f` has been reset to the default by - * the second call - * - * You can pass in `true` as the 2nd parameter to make it set which types - * to flatten and all others will be set to have views created. - * - * To reset all types to the default call it with no arguments - * - * @param types array of types to make views for - * @param flatten whether to flatten or expand the specified types. - */ - function setIntrinsicsToView(types = [], flatten) { - // we need to track what we've viewed because for example `vec3f` references - // the same info as `vec3` so we'd set one and reset the other. - const visited = new Set(); - for (const type of kTypes) { - const info = typeInfo[type]; - if (!visited.has(info)) { - visited.add(info); - info.flatten = types.includes(type) ? flatten : !flatten; - } - } - } - setIntrinsicsToView(); // This needs to be fixed! 😱 function getSizeOfTypeDef(typeDef) { const asArrayDef = typeDef; @@ -193,6 +133,9 @@ } } } + function range(count, fn) { + return new Array(count).fill(0).map((_, i) => fn(i)); + } // If numElements is undefined this is NOT an array. If it is defined then it IS an array // Sizes for arrays are different than sizes for non-arrays. Example // a vec3f non array is Float32Array(3) @@ -272,7 +215,7 @@ // On the other hand, if we have `array` the maybe we do want // 10 `Float32Array(16)` views since you might want to do // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`; - if (isIntrinsic(elementType) && typeInfo[elementType.type].flatten) { + if (isIntrinsic(elementType)) { return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements); } else { @@ -5856,7 +5799,6 @@ exports.getSizeFromSource = getSizeFromSource; exports.interleaveVertexData = interleaveVertexData; exports.isTypedArray = isTypedArray; - exports.kTypes = kTypes; exports.loadImageBitmap = loadImageBitmap; exports.makeShaderDataDefinitions = makeShaderDataDefinitions; exports.makeStructuredView = makeStructuredView; @@ -5864,7 +5806,6 @@ exports.normalizeGPUExtent3D = normalizeGPUExtent3D; exports.numMipLevels = numMipLevels; exports.primitives = primitives; - exports.setIntrinsicsToView = setIntrinsicsToView; exports.setStructuredValues = setStructuredValues; exports.setStructuredView = setStructuredView; exports.setTypedValues = setTypedValues; diff --git a/dist/0.x/webgpu-utils.js.map b/dist/0.x/webgpu-utils.js.map index 6f7407a..6ba802d 100644 --- a/dist/0.x/webgpu-utils.js.map +++ b/dist/0.x/webgpu-utils.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created.\n *\n * To reset all types to the default call it with no arguments\n *\n * @param types array of types to make views for\n * @param flatten whether to flatten or expand the specified types.\n */\nexport function setIntrinsicsToView(types: readonly kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}\n","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type.\n * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray\n *\n * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not\n * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2.\n * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3.\n *\n * For attribute formats, guesses are made based on type and number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";;;;;;;IAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,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;;UCgBa,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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AG,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC;;oBAGhD,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBACtB,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,aAAA;IACF,SAAA;IAED,QAAA,UAAU,IAAI,SAAS,GAAG,CAAC,CAAC;IAC7B,KAAA;QAED,OAAO;YACL,QAAQ,EAAE,SAAS,CAAC,UAAU;YAC9B,MAAM,EAAE,OAAO,CAAC,UAAU;YAC1B,QAAQ,EAAE,SAAS,CAAC,UAAU;YAC9B,OAAO,EAAE,OAAO,CAAC,UAAU;SAC5B,CAAC;IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[3]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n pad?: number[];\n};\n\nconst b: Record = {\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\nconst typeInfo: Record = {\n ...b,\n\n 'vec2': b.vec2f,\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\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};\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\nfunction range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType)) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array. Use a TypedArray or a FullArraySpec to choose a different type.\n * The 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 guess. 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 at number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";;;;;;;IAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ;;UCwBvG,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,mB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0.x/webgpu-utils.min.js +++ b/dist/0.x/webgpu-utils.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).webgpuUtils={})}(this,(function(t){"use strict";const e=(t,e)=>((t+e-1)/e|0)*e;const r=t=>t&&"number"==typeof t.length&&t.buffer instanceof ArrayBuffer&&"number"==typeof t.byteLength,s={i32:{numElements:1,align:4,size:4,type:"i32",View:Int32Array},u32:{numElements:1,align:4,size:4,type:"u32",View:Uint32Array},f32:{numElements:1,align:4,size:4,type:"f32",View:Float32Array},f16:{numElements:1,align:2,size:2,type:"u16",View:Uint16Array},vec2f:{numElements:2,align:8,size:8,type:"f32",View:Float32Array},vec2i:{numElements:2,align:8,size:8,type:"i32",View:Int32Array},vec2u:{numElements:2,align:8,size:8,type:"u32",View:Uint32Array},vec2h:{numElements:2,align:4,size:4,type:"u16",View:Uint16Array},vec3i:{numElements:3,align:16,size:12,type:"i32",View:Int32Array},vec3u:{numElements:3,align:16,size:12,type:"u32",View:Uint32Array},vec3f:{numElements:3,align:16,size:12,type:"f32",View:Float32Array},vec3h:{numElements:3,align:8,size:6,type:"u16",View:Uint16Array},vec4i:{numElements:4,align:16,size:16,type:"i32",View:Int32Array},vec4u:{numElements:4,align:16,size:16,type:"u32",View:Uint32Array},vec4f:{numElements:4,align:16,size:16,type:"f32",View:Float32Array},vec4h:{numElements:4,align:8,size:8,type:"u16",View:Uint16Array},mat2x2f:{numElements:4,align:8,size:16,type:"f32",View:Float32Array},mat2x2h:{numElements:4,align:4,size:8,type:"u16",View:Uint16Array},mat3x2f:{numElements:6,align:8,size:24,type:"f32",View:Float32Array},mat3x2h:{numElements:6,align:4,size:12,type:"u16",View:Uint16Array},mat4x2f:{numElements:8,align:8,size:32,type:"f32",View:Float32Array},mat4x2h:{numElements:8,align:4,size:16,type:"u16",View:Uint16Array},mat2x3f:{numElements:8,align:16,size:32,pad:[3,1],type:"f32",View:Float32Array},mat2x3h:{numElements:8,align:8,size:16,pad:[3,1],type:"u16",View:Uint16Array},mat3x3f:{numElements:12,align:16,size:48,pad:[3,1],type:"f32",View:Float32Array},mat3x3h:{numElements:12,align:8,size:24,pad:[3,1],type:"u16",View:Uint16Array},mat4x3f:{numElements:16,align:16,size:64,pad:[3,1],type:"f32",View:Float32Array},mat4x3h:{numElements:16,align:8,size:32,pad:[3,1],type:"u16",View:Uint16Array},mat2x4f:{numElements:8,align:16,size:32,type:"f32",View:Float32Array},mat2x4h:{numElements:8,align:8,size:16,type:"u16",View:Uint16Array},mat3x4f:{numElements:12,align:16,size:48,pad:[3,1],type:"f32",View:Float32Array},mat3x4h:{numElements:12,align:8,size:24,pad:[3,1],type:"u16",View:Uint16Array},mat4x4f:{numElements:16,align:16,size:64,type:"f32",View:Float32Array},mat4x4h:{numElements:16,align:8,size:32,type:"u16",View:Uint16Array},bool:{numElements:0,align:1,size:0,type:"bool",View:Uint32Array}},n={...s,"vec2":s.vec2i,"vec2":s.vec2u,"vec2":s.vec2f,"vec2":s.vec2h,"vec3":s.vec3i,"vec3":s.vec3u,"vec3":s.vec3f,"vec3":s.vec3h,"vec4":s.vec4i,"vec4":s.vec4u,"vec4":s.vec4f,"vec4":s.vec4h,"mat2x2":s.mat2x2f,"mat2x2":s.mat2x2h,"mat3x2":s.mat3x2f,"mat3x2":s.mat3x2h,"mat4x2":s.mat4x2f,"mat4x2":s.mat4x2h,"mat2x3":s.mat2x3f,"mat2x3":s.mat2x3h,"mat3x3":s.mat3x3f,"mat3x3":s.mat3x3h,"mat4x3":s.mat4x3f,"mat4x3":s.mat4x3h,"mat2x4":s.mat2x4f,"mat2x4":s.mat2x4h,"mat3x4":s.mat3x4f,"mat3x4":s.mat3x4h,"mat4x4":s.mat4x4f,"mat4x4":s.mat4x4h},i=(o=n,Object.keys(o));var o;function a(t=[],e){const r=new Set;for(const s of i){const i=n[s];r.has(i)||(r.add(i),i.flatten=t.includes(s)?e:!e)}}function u(t){const r=t;if(r.elementType)return r.size;{const s=t,i=r.numElements||1;if(s.fields)return t.size*i;{const r=t,{align:s}=n[r.type];return i>1?e(t.size,s)*i:t.size}}}function c(t,r,s,i){const{size:o,type:a}=t;try{const{View:t,align:u}=n[a],c=void 0!==i,l=c?e(o,u):o,h=l/t.BYTES_PER_ELEMENT;return new t(r,s,h*(c?0===i?(r.byteLength-s)/l:i:1))}catch{throw new Error(`unknown type: ${a}`)}}function l(t){return!t.fields&&!t.elementType}function h(t,e,r){const s=r||0,i=e||new ArrayBuffer(u(t)),o=(t,e)=>{const r=t,s=r.elementType;if(s){if(l(s)&&n[s.type].flatten)return c(s,i,e,r.numElements);{const t=u(s),n=0===r.numElements?(i.byteLength-e)/t:r.numElements;return a=r=>o(s,e+t*r),new Array(n).fill(0).map(((t,e)=>a(e)))}}if("string"==typeof t)throw Error("unreachable");{const r=t.fields;if(r){const t={};for(const[s,{type:n,offset:i}]of Object.entries(r))t[s]=o(n,e+i);return t}return c(t,i,e)}var a};return{views:o(t,s),arrayBuffer:i}}function _(t,e){if(void 0!==t)if(r(e)){const s=e;if(1===s.length&&"number"==typeof t)s[0]=t;else if(Array.isArray(t[0])||r(t[0])){const e=t[0].length,r=3===e?4:e;for(let e=0;e{_(t,r[e])}))}else{const r=e;for(const[e,s]of Object.entries(t)){const t=r[e];t&&_(s,t)}}}a();const p=new WeakMap;function d(t,e){const r=function(t){let e=p.get(t);return e||(e=new Map,p.set(t,e)),e}(t);let s=r.get(e);return s||(s=new e(t),r.set(e,s)),s}function m(t,e,r,s){const i=d(r,n[t.type].View),o=s/i.BYTES_PER_ELEMENT;"number"==typeof e?i[o]=e:i.set(e,o)}function f(t,e,s,n=0){const i=t.elementType;if(i){if(l(i)){const t=i;if(function(t){return r(t)||Array.isArray(t)&&"number"==typeof t[0]}(e))return void m(t,e,s,n)}return void e.forEach(((t,e)=>{f(i,t,s,n+i.size*e)}))}const o=t.fields;if(o)for(const[t,r]of Object.entries(e)){const e=o[t];e&&f(e.type,r,s,n+e.offset)}else m(t,e,s,n)}class y{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class g{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(t){throw new Error("Cannot evaluate node")}evaluateString(t){return this.evaluate(t).toString()}}class w extends g{constructor(){super()}}class k extends w{constructor(t,e,r,s){super(),this.name=t,this.args=e,this.returnType=r,this.body=s}get astNodeType(){return"function"}}class x extends w{constructor(t){super(),this.expression=t}get astNodeType(){return"staticAssert"}}class b extends w{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"while"}}class v extends w{constructor(t){super(),this.body=t}get astNodeType(){return"continuing"}}class A extends w{constructor(t,e,r,s){super(),this.init=t,this.condition=e,this.increment=r,this.body=s}get astNodeType(){return"for"}}class E extends w{constructor(t,e,r,s,n){super(),this.name=t,this.type=e,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"var"}}class T extends w{constructor(t,e,r){super(),this.name=t,this.type=e,this.value=r}get astNodeType(){return"override"}}class S extends w{constructor(t,e,r,s,n){super(),this.name=t,this.type=e,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"let"}}class z extends w{constructor(t,e,r,s,n){super(),this.name=t,this.type=e,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"const"}evaluate(t){return this.value.evaluate(t)}}var M,I,V,N,F;!function(t){t.increment="++",t.decrement="--"}(M||(M={})),function(t){t.parse=function(e){const r=e;if("parse"==r)throw new Error("Invalid value for IncrementOperator");return t[r]}}(M||(M={}));class q extends w{constructor(t,e){super(),this.operator=t,this.variable=e}get astNodeType(){return"increment"}}!function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="}(I||(I={})),function(t){t.parse=function(e){const r=e;if("parse"==r)throw new Error("Invalid value for AssignOperator");return t[r]}}(I||(I={}));class U extends w{constructor(t,e,r){super(),this.operator=t,this.variable=e,this.value=r}get astNodeType(){return"assign"}}class O extends w{constructor(t,e){super(),this.name=t,this.args=e}get astNodeType(){return"call"}}class L extends w{constructor(t,e){super(),this.body=t,this.continuing=e}get astNodeType(){return"loop"}}class P extends w{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"body"}}class C extends w{constructor(t,e,r,s){super(),this.condition=t,this.body=e,this.elseif=r,this.else=s}get astNodeType(){return"if"}}class B extends w{constructor(t){super(),this.value=t}get astNodeType(){return"return"}}class $ extends w{constructor(t){super(),this.name=t}get astNodeType(){return"enable"}}class j extends w{constructor(t,e){super(),this.name=t,this.type=e}get astNodeType(){return"alias"}}class R extends w{constructor(){super()}get astNodeType(){return"discard"}}class D extends w{constructor(){super()}get astNodeType(){return"break"}}class G extends w{constructor(){super()}get astNodeType(){return"continue"}}class Y extends w{constructor(t){super(),this.name=t}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class W extends Y{constructor(t,e){super(t),this.members=e}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(t){for(let e=0;e":return this.left.evaluate(t)>this.right.evaluate(t)?1:0;case"<=":return this.left.evaluate(t)<=this.right.evaluate(t)?1:0;case">=":return this.left.evaluate(t)>=this.right.evaluate(t)?1:0;case"&&":return this.left.evaluate(t)&&this.right.evaluate(t)?1:0;case"||":return this.left.evaluate(t)||this.right.evaluate(t)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}}class ht extends g{constructor(){super()}}class _t extends ht{constructor(t,e){super(),this.selector=t,this.body=e}get astNodeType(){return"case"}}class pt extends ht{constructor(t){super(),this.body=t}get astNodeType(){return"default"}}class dt extends g{constructor(t,e,r){super(),this.name=t,this.type=e,this.attributes=r}get astNodeType(){return"argument"}}class mt extends g{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"elseif"}}class ft extends g{constructor(t,e,r){super(),this.name=t,this.type=e,this.attributes=r}get astNodeType(){return"member"}}class yt extends g{constructor(t,e){super(),this.name=t,this.value=e}get astNodeType(){return"attribute"}}!function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"}(N||(N={}));class gt{constructor(t,e,r){this.name=t,this.type=e,this.rule=r}toString(){return this.name}}class wt{}V=wt,wt.none=new gt("",N.reserved,""),wt.eof=new gt("EOF",N.token,""),wt.reserved={asm:new gt("asm",N.reserved,"asm"),bf16:new gt("bf16",N.reserved,"bf16"),do:new gt("do",N.reserved,"do"),enum:new gt("enum",N.reserved,"enum"),f16:new gt("f16",N.reserved,"f16"),f64:new gt("f64",N.reserved,"f64"),handle:new gt("handle",N.reserved,"handle"),i8:new gt("i8",N.reserved,"i8"),i16:new gt("i16",N.reserved,"i16"),i64:new gt("i64",N.reserved,"i64"),mat:new gt("mat",N.reserved,"mat"),premerge:new gt("premerge",N.reserved,"premerge"),regardless:new gt("regardless",N.reserved,"regardless"),typedef:new gt("typedef",N.reserved,"typedef"),u8:new gt("u8",N.reserved,"u8"),u16:new gt("u16",N.reserved,"u16"),u64:new gt("u64",N.reserved,"u64"),unless:new gt("unless",N.reserved,"unless"),using:new gt("using",N.reserved,"using"),vec:new gt("vec",N.reserved,"vec"),void:new gt("void",N.reserved,"void")},wt.keywords={array:new gt("array",N.keyword,"array"),atomic:new gt("atomic",N.keyword,"atomic"),bool:new gt("bool",N.keyword,"bool"),f32:new gt("f32",N.keyword,"f32"),i32:new gt("i32",N.keyword,"i32"),mat2x2:new gt("mat2x2",N.keyword,"mat2x2"),mat2x3:new gt("mat2x3",N.keyword,"mat2x3"),mat2x4:new gt("mat2x4",N.keyword,"mat2x4"),mat3x2:new gt("mat3x2",N.keyword,"mat3x2"),mat3x3:new gt("mat3x3",N.keyword,"mat3x3"),mat3x4:new gt("mat3x4",N.keyword,"mat3x4"),mat4x2:new gt("mat4x2",N.keyword,"mat4x2"),mat4x3:new gt("mat4x3",N.keyword,"mat4x3"),mat4x4:new gt("mat4x4",N.keyword,"mat4x4"),ptr:new gt("ptr",N.keyword,"ptr"),sampler:new gt("sampler",N.keyword,"sampler"),sampler_comparison:new gt("sampler_comparison",N.keyword,"sampler_comparison"),struct:new gt("struct",N.keyword,"struct"),texture_1d:new gt("texture_1d",N.keyword,"texture_1d"),texture_2d:new gt("texture_2d",N.keyword,"texture_2d"),texture_2d_array:new gt("texture_2d_array",N.keyword,"texture_2d_array"),texture_3d:new gt("texture_3d",N.keyword,"texture_3d"),texture_cube:new gt("texture_cube",N.keyword,"texture_cube"),texture_cube_array:new gt("texture_cube_array",N.keyword,"texture_cube_array"),texture_multisampled_2d:new gt("texture_multisampled_2d",N.keyword,"texture_multisampled_2d"),texture_storage_1d:new gt("texture_storage_1d",N.keyword,"texture_storage_1d"),texture_storage_2d:new gt("texture_storage_2d",N.keyword,"texture_storage_2d"),texture_storage_2d_array:new gt("texture_storage_2d_array",N.keyword,"texture_storage_2d_array"),texture_storage_3d:new gt("texture_storage_3d",N.keyword,"texture_storage_3d"),texture_depth_2d:new gt("texture_depth_2d",N.keyword,"texture_depth_2d"),texture_depth_2d_array:new gt("texture_depth_2d_array",N.keyword,"texture_depth_2d_array"),texture_depth_cube:new gt("texture_depth_cube",N.keyword,"texture_depth_cube"),texture_depth_cube_array:new gt("texture_depth_cube_array",N.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new gt("texture_depth_multisampled_2d",N.keyword,"texture_depth_multisampled_2d"),texture_external:new gt("texture_external",N.keyword,"texture_external"),u32:new gt("u32",N.keyword,"u32"),vec2:new gt("vec2",N.keyword,"vec2"),vec3:new gt("vec3",N.keyword,"vec3"),vec4:new gt("vec4",N.keyword,"vec4"),bitcast:new gt("bitcast",N.keyword,"bitcast"),block:new gt("block",N.keyword,"block"),break:new gt("break",N.keyword,"break"),case:new gt("case",N.keyword,"case"),continue:new gt("continue",N.keyword,"continue"),continuing:new gt("continuing",N.keyword,"continuing"),default:new gt("default",N.keyword,"default"),discard:new gt("discard",N.keyword,"discard"),else:new gt("else",N.keyword,"else"),enable:new gt("enable",N.keyword,"enable"),fallthrough:new gt("fallthrough",N.keyword,"fallthrough"),false:new gt("false",N.keyword,"false"),fn:new gt("fn",N.keyword,"fn"),for:new gt("for",N.keyword,"for"),function:new gt("function",N.keyword,"function"),if:new gt("if",N.keyword,"if"),let:new gt("let",N.keyword,"let"),const:new gt("const",N.keyword,"const"),loop:new gt("loop",N.keyword,"loop"),while:new gt("while",N.keyword,"while"),private:new gt("private",N.keyword,"private"),read:new gt("read",N.keyword,"read"),read_write:new gt("read_write",N.keyword,"read_write"),return:new gt("return",N.keyword,"return"),storage:new gt("storage",N.keyword,"storage"),switch:new gt("switch",N.keyword,"switch"),true:new gt("true",N.keyword,"true"),alias:new gt("alias",N.keyword,"alias"),type:new gt("type",N.keyword,"type"),uniform:new gt("uniform",N.keyword,"uniform"),var:new gt("var",N.keyword,"var"),override:new gt("override",N.keyword,"override"),workgroup:new gt("workgroup",N.keyword,"workgroup"),write:new gt("write",N.keyword,"write"),r8unorm:new gt("r8unorm",N.keyword,"r8unorm"),r8snorm:new gt("r8snorm",N.keyword,"r8snorm"),r8uint:new gt("r8uint",N.keyword,"r8uint"),r8sint:new gt("r8sint",N.keyword,"r8sint"),r16uint:new gt("r16uint",N.keyword,"r16uint"),r16sint:new gt("r16sint",N.keyword,"r16sint"),r16float:new gt("r16float",N.keyword,"r16float"),rg8unorm:new gt("rg8unorm",N.keyword,"rg8unorm"),rg8snorm:new gt("rg8snorm",N.keyword,"rg8snorm"),rg8uint:new gt("rg8uint",N.keyword,"rg8uint"),rg8sint:new gt("rg8sint",N.keyword,"rg8sint"),r32uint:new gt("r32uint",N.keyword,"r32uint"),r32sint:new gt("r32sint",N.keyword,"r32sint"),r32float:new gt("r32float",N.keyword,"r32float"),rg16uint:new gt("rg16uint",N.keyword,"rg16uint"),rg16sint:new gt("rg16sint",N.keyword,"rg16sint"),rg16float:new gt("rg16float",N.keyword,"rg16float"),rgba8unorm:new gt("rgba8unorm",N.keyword,"rgba8unorm"),rgba8unorm_srgb:new gt("rgba8unorm_srgb",N.keyword,"rgba8unorm_srgb"),rgba8snorm:new gt("rgba8snorm",N.keyword,"rgba8snorm"),rgba8uint:new gt("rgba8uint",N.keyword,"rgba8uint"),rgba8sint:new gt("rgba8sint",N.keyword,"rgba8sint"),bgra8unorm:new gt("bgra8unorm",N.keyword,"bgra8unorm"),bgra8unorm_srgb:new gt("bgra8unorm_srgb",N.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new gt("rgb10a2unorm",N.keyword,"rgb10a2unorm"),rg11b10float:new gt("rg11b10float",N.keyword,"rg11b10float"),rg32uint:new gt("rg32uint",N.keyword,"rg32uint"),rg32sint:new gt("rg32sint",N.keyword,"rg32sint"),rg32float:new gt("rg32float",N.keyword,"rg32float"),rgba16uint:new gt("rgba16uint",N.keyword,"rgba16uint"),rgba16sint:new gt("rgba16sint",N.keyword,"rgba16sint"),rgba16float:new gt("rgba16float",N.keyword,"rgba16float"),rgba32uint:new gt("rgba32uint",N.keyword,"rgba32uint"),rgba32sint:new gt("rgba32sint",N.keyword,"rgba32sint"),rgba32float:new gt("rgba32float",N.keyword,"rgba32float"),static_assert:new gt("static_assert",N.keyword,"static_assert")},wt.tokens={decimal_float_literal:new gt("decimal_float_literal",N.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new gt("hex_float_literal",N.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?))/),int_literal:new gt("int_literal",N.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new gt("uint_literal",N.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new gt("ident",N.token,/[a-zA-Z][0-9a-zA-Z_]*/),and:new gt("and",N.token,"&"),and_and:new gt("and_and",N.token,"&&"),arrow:new gt("arrow ",N.token,"->"),attr:new gt("attr",N.token,"@"),attr_left:new gt("attr_left",N.token,"[["),attr_right:new gt("attr_right",N.token,"]]"),forward_slash:new gt("forward_slash",N.token,"/"),bang:new gt("bang",N.token,"!"),bracket_left:new gt("bracket_left",N.token,"["),bracket_right:new gt("bracket_right",N.token,"]"),brace_left:new gt("brace_left",N.token,"{"),brace_right:new gt("brace_right",N.token,"}"),colon:new gt("colon",N.token,":"),comma:new gt("comma",N.token,","),equal:new gt("equal",N.token,"="),equal_equal:new gt("equal_equal",N.token,"=="),not_equal:new gt("not_equal",N.token,"!="),greater_than:new gt("greater_than",N.token,">"),greater_than_equal:new gt("greater_than_equal",N.token,">="),shift_right:new gt("shift_right",N.token,">>"),less_than:new gt("less_than",N.token,"<"),less_than_equal:new gt("less_than_equal",N.token,"<="),shift_left:new gt("shift_left",N.token,"<<"),modulo:new gt("modulo",N.token,"%"),minus:new gt("minus",N.token,"-"),minus_minus:new gt("minus_minus",N.token,"--"),period:new gt("period",N.token,"."),plus:new gt("plus",N.token,"+"),plus_plus:new gt("plus_plus",N.token,"++"),or:new gt("or",N.token,"|"),or_or:new gt("or_or",N.token,"||"),paren_left:new gt("paren_left",N.token,"("),paren_right:new gt("paren_right",N.token,")"),semicolon:new gt("semicolon",N.token,";"),star:new gt("star",N.token,"*"),tilde:new gt("tilde",N.token,"~"),underscore:new gt("underscore",N.token,"_"),xor:new gt("xor",N.token,"^"),plus_equal:new gt("plus_equal",N.token,"+="),minus_equal:new gt("minus_equal",N.token,"-="),times_equal:new gt("times_equal",N.token,"*="),division_equal:new gt("division_equal",N.token,"/="),modulo_equal:new gt("modulo_equal",N.token,"%="),and_equal:new gt("and_equal",N.token,"&="),or_equal:new gt("or_equal",N.token,"|="),xor_equal:new gt("xor_equal",N.token,"^="),shift_right_equal:new gt("shift_right_equal",N.token,">>="),shift_left_equal:new gt("shift_left_equal",N.token,"<<=")},wt.storage_class=[V.keywords.function,V.keywords.private,V.keywords.workgroup,V.keywords.uniform,V.keywords.storage],wt.access_mode=[V.keywords.read,V.keywords.write,V.keywords.read_write],wt.sampler_type=[V.keywords.sampler,V.keywords.sampler_comparison],wt.sampled_texture_type=[V.keywords.texture_1d,V.keywords.texture_2d,V.keywords.texture_2d_array,V.keywords.texture_3d,V.keywords.texture_cube,V.keywords.texture_cube_array],wt.multisampled_texture_type=[V.keywords.texture_multisampled_2d],wt.storage_texture_type=[V.keywords.texture_storage_1d,V.keywords.texture_storage_2d,V.keywords.texture_storage_2d_array,V.keywords.texture_storage_3d],wt.depth_texture_type=[V.keywords.texture_depth_2d,V.keywords.texture_depth_2d_array,V.keywords.texture_depth_cube,V.keywords.texture_depth_cube_array,V.keywords.texture_depth_multisampled_2d],wt.texture_external_type=[V.keywords.texture_external],wt.any_texture_type=[...V.sampled_texture_type,...V.multisampled_texture_type,...V.storage_texture_type,...V.depth_texture_type,...V.texture_external_type],wt.texel_format=[V.keywords.r8unorm,V.keywords.r8snorm,V.keywords.r8uint,V.keywords.r8sint,V.keywords.r16uint,V.keywords.r16sint,V.keywords.r16float,V.keywords.rg8unorm,V.keywords.rg8snorm,V.keywords.rg8uint,V.keywords.rg8sint,V.keywords.r32uint,V.keywords.r32sint,V.keywords.r32float,V.keywords.rg16uint,V.keywords.rg16sint,V.keywords.rg16float,V.keywords.rgba8unorm,V.keywords.rgba8unorm_srgb,V.keywords.rgba8snorm,V.keywords.rgba8uint,V.keywords.rgba8sint,V.keywords.bgra8unorm,V.keywords.bgra8unorm_srgb,V.keywords.rgb10a2unorm,V.keywords.rg11b10float,V.keywords.rg32uint,V.keywords.rg32sint,V.keywords.rg32float,V.keywords.rgba16uint,V.keywords.rgba16sint,V.keywords.rgba16float,V.keywords.rgba32uint,V.keywords.rgba32sint,V.keywords.rgba32float],wt.const_literal=[V.tokens.int_literal,V.tokens.uint_literal,V.tokens.decimal_float_literal,V.tokens.hex_float_literal,V.keywords.true,V.keywords.false],wt.literal_or_ident=[V.tokens.ident,V.tokens.int_literal,V.tokens.uint_literal,V.tokens.decimal_float_literal,V.tokens.hex_float_literal],wt.element_count_expression=[V.tokens.int_literal,V.tokens.uint_literal,V.tokens.ident],wt.template_types=[V.keywords.vec2,V.keywords.vec3,V.keywords.vec4,V.keywords.mat2x2,V.keywords.mat2x3,V.keywords.mat2x4,V.keywords.mat3x2,V.keywords.mat3x3,V.keywords.mat3x4,V.keywords.mat4x2,V.keywords.mat4x3,V.keywords.mat4x4,V.keywords.atomic,V.keywords.bitcast,...V.any_texture_type],wt.attribute_name=[V.tokens.ident,V.keywords.block],wt.assignment_operators=[V.tokens.equal,V.tokens.plus_equal,V.tokens.minus_equal,V.tokens.times_equal,V.tokens.division_equal,V.tokens.modulo_equal,V.tokens.and_equal,V.tokens.or_equal,V.tokens.xor_equal,V.tokens.shift_right_equal,V.tokens.shift_left_equal],wt.increment_operators=[V.tokens.plus_plus,V.tokens.minus_minus];class kt{constructor(t,e,r){this.type=t,this.lexeme=e,this.line=r}toString(){return this.lexeme}isTemplateType(){return-1!=wt.template_types.indexOf(this.type)}isArrayType(){return this.type==wt.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class xt{constructor(t){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=null!=t?t:""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new kt(wt.eof,"",this._line)),this._tokens}scanToken(){let t=this._advance();if("\n"==t)return this._line++,!0;if(this._isWhitespace(t))return!0;if("/"==t){if("/"==this._peekAhead()){for(;"\n"!=t;){if(this._isAtEnd())return!0;t=this._advance()}return this._line++,!0}if("*"==this._peekAhead()){this._advance();let e=1;for(;e>0;){if(this._isAtEnd())return!0;if(t=this._advance(),"\n"==t)this._line++;else if("*"==t){if("/"==this._peekAhead()&&(this._advance(),e--,0==e))return!0}else"/"==t&&"*"==this._peekAhead()&&(this._advance(),e++)}return!0}}let e=wt.none;for(;;){let r=this._findType(t);const s=this._peekAhead();if(">"==t&&(">"==s||"="==s)){let t=!1,e=this._tokens.length-1;for(let r=0;r<5&&e>=0;++r,--e)if(this._tokens[e].type===wt.tokens.less_than){e>0&&this._tokens[e-1].isArrayOrTemplateType()&&(t=!0);break}if(t)return this._addToken(r),!0}if(r===wt.none){let s=t,n=0;const i=2;for(let t=0;t=this._source.length}_isWhitespace(t){return" "==t||"\t"==t||"\r"==t}_advance(t=0){let e=this._source[this._current];return t=t||0,t++,this._current+=t,e}_peekAhead(t=0){return t=t||0,this._current+t>=this._source.length?"\0":this._source[this._current+t]}_addToken(t){const e=this._source.substring(this._start,this._current);this._tokens.push(new kt(t,e,this._line))}}class bt{constructor(){this._tokens=[],this._current=0,this._context=new y}parse(t){this._initialize(t);let e=[];for(;!this._isAtEnd();){const t=this._global_decl_or_directive();if(!t)break;e.push(t)}return e}_initialize(t){if(t)if("string"==typeof t){const e=new xt(t);this._tokens=e.scanTokens()}else this._tokens=t;else this._tokens=[];this._current=0}_error(t,e){return console.error(t,e),{token:t,message:e,toString:function(){return`${e}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==wt.eof}_match(t){if(t instanceof gt)return!!this._check(t)&&(this._advance(),!0);for(let e=0,r=t.length;e'.");const e=this._paren_expression();return new it(t,e)}const t=this._type_decl(),e=this._argument_expression_list();return new ot(t,e)}_argument_expression_list(){if(!this._match(wt.tokens.paren_left))return null;const t=[];do{if(this._check(wt.tokens.paren_right))break;const e=this._short_circuit_or_expression();t.push(e)}while(this._match(wt.tokens.comma));return this._consume(wt.tokens.paren_right,"Expected ')' for agument list"),t}_optional_paren_expression(){this._match(wt.tokens.paren_left);const t=this._short_circuit_or_expression();return this._match(wt.tokens.paren_right),new at([t])}_paren_expression(){this._consume(wt.tokens.paren_left,"Expected '('.");const t=this._short_circuit_or_expression();return this._consume(wt.tokens.paren_right,"Expected ')'."),new at([t])}_struct_decl(){if(!this._match(wt.keywords.struct))return null;const t=this._consume(wt.tokens.ident,"Expected name for struct.").toString();this._consume(wt.tokens.brace_left,"Expected '{' for struct body.");const e=[];for(;!this._check(wt.tokens.brace_right);){const t=this._attribute(),r=this._consume(wt.tokens.ident,"Expected variable name.").toString();this._consume(wt.tokens.colon,"Expected ':' for struct member type.");const s=this._attribute(),n=this._type_decl();null!=n&&(n.attributes=s),this._check(wt.tokens.brace_right)?this._match(wt.tokens.comma):this._consume(wt.tokens.comma,"Expected ',' for struct member."),e.push(new ft(r,n,t))}this._consume(wt.tokens.brace_right,"Expected '}' after struct body.");const r=new W(t,e);return this._context.structs.set(t,r),r}_global_variable_decl(){const t=this._variable_decl();return t&&this._match(wt.tokens.equal)&&(t.value=this._const_expression()),t}_override_variable_decl(){const t=this._override_decl();return t&&this._match(wt.tokens.equal)&&(t.value=this._const_expression()),t}_global_const_decl(){if(!this._match(wt.keywords.const))return null;const t=this._consume(wt.tokens.ident,"Expected variable name");let e=null;if(this._match(wt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}let r=null;if(this._match(wt.tokens.equal)){const t=this._short_circuit_or_expression();if(t instanceof tt)r=t;else if(t instanceof st&&t.initializer instanceof tt)r=t.initializer;else try{const e=t.evaluate(this._context);r=new nt(e)}catch(e){r=t}}const s=new z(t.toString(),e,"","",r);return this._context.constants.set(s.name,s),s}_global_let_decl(){if(!this._match(wt.keywords.let))return null;const t=this._consume(wt.tokens.ident,"Expected variable name");let e=null;if(this._match(wt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}let r=null;return this._match(wt.tokens.equal)&&(r=this._const_expression()),new S(t.toString(),e,"","",r)}_const_expression(){if(this._match(wt.const_literal))return new K(this._previous().toString());const t=this._type_decl();this._consume(wt.tokens.paren_left,"Expected '('.");let e=[];for(;!this._check(wt.tokens.paren_right)&&(e.push(this._const_expression()),this._check(wt.tokens.comma));)this._advance();return this._consume(wt.tokens.paren_right,"Expected ')'."),new tt(t,e)}_variable_decl(){if(!this._match(wt.keywords.var))return null;let t="",e="";this._match(wt.tokens.less_than)&&(t=this._consume(wt.storage_class,"Expected storage_class.").toString(),this._match(wt.tokens.comma)&&(e=this._consume(wt.access_mode,"Expected access_mode.").toString()),this._consume(wt.tokens.greater_than,"Expected '>'."));const r=this._consume(wt.tokens.ident,"Expected variable name");let s=null;if(this._match(wt.tokens.colon)){const t=this._attribute();s=this._type_decl(),null!=s&&(s.attributes=t)}return new E(r.toString(),s,t,e,null)}_override_decl(){if(!this._match(wt.keywords.override))return null;const t=this._consume(wt.tokens.ident,"Expected variable name");let e=null;if(this._match(wt.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}return new T(t.toString(),e,null)}_enable_directive(){const t=this._consume(wt.tokens.ident,"identity expected.");return new $(t.toString())}_type_alias(){const t=this._consume(wt.tokens.ident,"identity expected.");this._consume(wt.tokens.equal,"Expected '=' for type alias.");let e=this._type_decl();if(null===e)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(e.name)&&(e=this._context.aliases.get(e.name).type);const r=new j(t.toString(),e);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([wt.tokens.ident,...wt.texel_format,wt.keywords.bool,wt.keywords.f32,wt.keywords.i32,wt.keywords.u32])){const t=this._advance(),e=t.toString();return this._context.structs.has(e)?this._context.structs.get(e):this._context.aliases.has(e)?this._context.aliases.get(e).type:new Y(t.toString())}let t=this._texture_sampler_types();if(t)return t;if(this._check(wt.template_types)){let t=this._advance().toString(),e=null,r=null;return this._match(wt.tokens.less_than)&&(e=this._type_decl(),r=null,this._match(wt.tokens.comma)&&(r=this._consume(wt.access_mode,"Expected access_mode for pointer").toString()),this._consume(wt.tokens.greater_than,"Expected '>' for type.")),new H(t,e,r)}if(this._match(wt.keywords.ptr)){let t=this._previous().toString();this._consume(wt.tokens.less_than,"Expected '<' for pointer.");const e=this._consume(wt.storage_class,"Expected storage_class for pointer");this._consume(wt.tokens.comma,"Expected ',' for pointer.");const r=this._type_decl();let s=null;return this._match(wt.tokens.comma)&&(s=this._consume(wt.access_mode,"Expected access_mode for pointer").toString()),this._consume(wt.tokens.greater_than,"Expected '>' for pointer."),new X(t,e.toString(),r,s)}const e=this._attribute();if(this._match(wt.keywords.array)){let t=null,r=-1;const s=this._previous();if(this._match(wt.tokens.less_than)){t=this._type_decl(),this._context.aliases.has(t.name)&&(t=this._context.aliases.get(t.name).type);let e="";if(this._match(wt.tokens.comma)){e=this._shift_expression().evaluate(this._context).toString()}this._consume(wt.tokens.greater_than,"Expected '>' for array."),r=e?parseInt(e):0}return new Z(s.toString(),e,t,r)}return null}_texture_sampler_types(){if(this._match(wt.sampler_type))return new Q(this._previous().toString(),null,null);if(this._match(wt.depth_texture_type))return new Q(this._previous().toString(),null,null);if(this._match(wt.sampled_texture_type)||this._match(wt.multisampled_texture_type)){const t=this._previous();this._consume(wt.tokens.less_than,"Expected '<' for sampler type.");const e=this._type_decl();return this._consume(wt.tokens.greater_than,"Expected '>' for sampler type."),new Q(t.toString(),e,null)}if(this._match(wt.storage_texture_type)){const t=this._previous();this._consume(wt.tokens.less_than,"Expected '<' for sampler type.");const e=this._consume(wt.texel_format,"Invalid texel format.").toString();this._consume(wt.tokens.comma,"Expected ',' after texel format.");const r=this._consume(wt.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(wt.tokens.greater_than,"Expected '>' for sampler type."),new Q(t.toString(),e,r)}return null}_attribute(){let t=[];for(;this._match(wt.tokens.attr);){const e=this._consume(wt.attribute_name,"Expected attribute name"),r=new yt(e.toString(),null);if(this._match(wt.tokens.paren_left)){if(r.value=this._consume(wt.literal_or_ident,"Expected attribute value").toString(),this._check(wt.tokens.comma)){this._advance();do{const t=this._consume(wt.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(t)}while(this._match(wt.tokens.comma))}this._consume(wt.tokens.paren_right,"Expected ')'")}t.push(r)}for(;this._match(wt.tokens.attr_left);){if(!this._check(wt.tokens.attr_right))do{const e=this._consume(wt.attribute_name,"Expected attribute name"),r=new yt(e.toString(),null);if(this._match(wt.tokens.paren_left)){if(r.value=[this._consume(wt.literal_or_ident,"Expected attribute value").toString()],this._check(wt.tokens.comma)){this._advance();do{const t=this._consume(wt.literal_or_ident,"Expected attribute value").toString();r.value.push(t)}while(this._match(wt.tokens.comma))}this._consume(wt.tokens.paren_right,"Expected ')'")}t.push(r)}while(this._match(wt.tokens.comma));this._consume(wt.tokens.attr_right,"Expected ']]' after attribute declarations")}return 0==t.length?null:t}}class vt{constructor(t,e){this.name=t,this.attributes=e,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class At{constructor(t,e,r){this.name=t,this.type=e,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Et extends vt{constructor(t,e){super(t,e),this.members=[],this.align=0}get isStruct(){return!0}}class Tt extends vt{constructor(t,e){super(t,e),this.count=0,this.stride=0}get isArray(){return!0}}class St extends vt{constructor(t,e,r,s){super(t,r),this.format=e,this.access=s}get isTemplate(){return!0}}!function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"}(F||(F={}));class zt{constructor(t,e,r,s,n,i,o){this.name=t,this.type=e,this.group=r,this.binding=s,this.attributes=n,this.resourceType=i,this.access=o}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Mt{constructor(t,e){this.name=t,this.type=e}}class It{constructor(t,e){this.align=t,this.size=e}}class Vt{constructor(t,e,r,s){this.name=t,this.type=e,this.locationType=r,this.location=s,this.interpolation=null}}class Nt{constructor(t,e,r,s){this.name=t,this.type=e,this.locationType=r,this.location=s}}class Ft{constructor(t,e=null){this.stage=null,this.inputs=[],this.outputs=[],this.name=t,this.stage=e}}class qt{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class Ut{constructor(t,e,r,s){this.name=t,this.type=e,this.attributes=r,this.id=s}}class Ot{constructor(t){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new qt,this._types=new Map,t&&this.update(t)}_isStorageTexture(t){return"texture_storage_1d"==t.name||"texture_storage_2d"==t.name||"texture_storage_2d_array"==t.name||"texture_storage_3d"==t.name}update(t){const e=(new bt).parse(t);for(const t of e)if(t instanceof W){const e=this._getTypeInfo(t,null);e instanceof Et&&this.structs.push(e)}else if(t instanceof j)this.aliases.push(this._getAliasInfo(t));else if(t instanceof T){const e=t,r=this._getAttributeNum(e.attributes,"id",0),s=null!=e.type?this._getTypeInfo(e.type,e.attributes):null;this.overrides.push(new Ut(e.name,s,e.attributes,r))}else if(this._isUniformVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=new zt(e.name,n,r,s,e.attributes,F.Uniform,e.access);this.uniforms.push(i)}else if(this._isStorageVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=this._isStorageTexture(n),o=new zt(e.name,n,r,s,e.attributes,i?F.StorageTexture:F.Storage,e.access);this.storage.push(o)}else if(this._isTextureVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=this._isStorageTexture(n),o=new zt(e.name,n,r,s,e.attributes,i?F.StorageTexture:F.Texture,e.access);i?this.storage.push(o):this.textures.push(o)}else if(this._isSamplerVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=new zt(e.name,n,r,s,e.attributes,F.Sampler,e.access);this.samplers.push(i)}else if(t instanceof k){const e=this._getAttribute(t,"vertex"),r=this._getAttribute(t,"fragment"),s=this._getAttribute(t,"compute"),n=e||r||s;if(n){const e=new Ft(t.name,n.name);e.inputs=this._getInputs(t.args),e.outputs=this._getOutputs(t.returnType),this.entry[n.name].push(e)}}else;}getBindGroups(){const t=[];function e(e,r){e>=t.length&&(t.length=e+1),void 0===t[e]&&(t[e]=[]),r>=t[e].length&&(t[e].length=r+1)}for(const r of this.uniforms){e(r.group,r.binding);t[r.group][r.binding]=r}for(const r of this.storage){e(r.group,r.binding);t[r.group][r.binding]=r}for(const r of this.textures){e(r.group,r.binding);t[r.group][r.binding]=r}for(const r of this.samplers){e(r.group,r.binding);t[r.group][r.binding]=r}return t}_getOutputs(t,e=void 0){if(void 0===e&&(e=[]),t instanceof W)this._getStructOutputs(t,e);else{const r=this._getOutputInfo(t);null!==r&&e.push(r)}return e}_getStructOutputs(t,e){for(const r of t.members)if(r.type instanceof W)this._getStructOutputs(r.type,e);else{const t=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(null!==t){const s=this._getTypeInfo(r.type,r.type.attributes),n=this._parseInt(t.value),i=new Nt(r.name,s,t.name,n);e.push(i)}}}_getOutputInfo(t){const e=this._getAttribute(t,"location")||this._getAttribute(t,"builtin");if(null!==e){const r=this._getTypeInfo(t,t.attributes),s=this._parseInt(e.value);return new Nt("",r,e.name,s)}return null}_getInputs(t,e=void 0){void 0===e&&(e=[]);for(const r of t)if(r.type instanceof W)this._getStructInputs(r.type,e);else{const t=this._getInputInfo(r);null!==t&&e.push(t)}return e}_getStructInputs(t,e){for(const r of t.members)if(r.type instanceof W)this._getStructInputs(r.type,e);else{const t=this._getInputInfo(r);null!==t&&e.push(t)}}_getInputInfo(t){const e=this._getAttribute(t,"location")||this._getAttribute(t,"builtin");if(null!==e){const r=this._getAttribute(t,"interpolation"),s=this._getTypeInfo(t.type,t.attributes),n=this._parseInt(e.value),i=new Vt(t.name,s,e.name,n);return null!==r&&(i.interpolation=this._parseString(r.value)),i}return null}_parseString(t){return t instanceof Array&&(t=t[0]),t}_parseInt(t){t instanceof Array&&(t=t[0]);const e=parseInt(t);return isNaN(e)?t:e}_getAlias(t){for(const e of this.aliases)if(e.name==t)return e.type;return null}_getAliasInfo(t){return new Mt(t.name,this._getTypeInfo(t.type,null))}_getTypeInfo(t,e){if(this._types.has(t))return this._types.get(t);if(t instanceof Z){const r=t,s=this._getTypeInfo(r.format,r.attributes),n=new Tt(r.name,e);return n.format=s,n.count=r.count,this._types.set(t,n),this._updateTypeInfo(n),n}if(t instanceof W){const r=t,s=new Et(r.name,e);for(const t of r.members){const e=this._getTypeInfo(t.type,t.attributes);s.members.push(new At(t.name,e,t.attributes))}return this._types.set(t,s),this._updateTypeInfo(s),s}if(t instanceof Q){const r=t,s=r.format instanceof Y,n=r.format?s?this._getTypeInfo(r.format,null):new vt(r.format,null):null,i=new St(r.name,n,e,r.access);return this._types.set(t,i),this._updateTypeInfo(i),i}if(t instanceof H){const r=t,s=r.format?this._getTypeInfo(r.format,null):null,n=new St(r.name,s,e,r.access);return this._types.set(t,n),this._updateTypeInfo(n),n}const r=new vt(t.name,e);return this._types.set(t,r),this._updateTypeInfo(r),r}_updateTypeInfo(t){var e,r;const s=this._getTypeSize(t);if(t.size=null!==(e=null==s?void 0:s.size)&&void 0!==e?e:0,t instanceof Tt){const e=this._getTypeSize(t.format);t.stride=null!==(r=null==e?void 0:e.size)&&void 0!==r?r:0,this._updateTypeInfo(t.format)}t instanceof Et&&this._updateStructInfo(t)}_updateStructInfo(t){var e;let r=0,s=0,n=0,i=0;for(let o=0,a=t.members.length;o{const r=Bt(t,e.type,0);return[e.name,{typeDefinition:r,group:e.group,binding:e.binding,size:r.size}]})))}function Pt(t,e,r){return{fields:Object.fromEntries(e.members.map((e=>[e.name,{offset:e.offset,type:Bt(t,e.type,0)}]))),size:e.size,offset:r}}function Ct(t,e=""){if(!t)throw new Error(e)}function Bt(t,e,r){if(e.isArray){Ct(!e.isStruct,"struct array is invalid"),Ct(!e.isStruct,"template array is invalid");const s=e;return{size:s.size,elementType:Bt(t,s.format,r),numElements:s.count}}if(e.isStruct){Ct(!e.isTemplate,"template struct is invalid");return Pt(t,e,r)}{const t=e,r=e.isTemplate?`${t.name}<${t.format.name}>`:e.name;return{size:e.size,type:r}}}function $t(t){return Array.isArray(t)||r(t)?[...t,1,1].slice(0,3):function(t){return[t.width,t.height||1,t.depthOrArrayLayers||1]}(t)}function jt(t,e){const r=$t(t),s=Math.max(...r.slice(0,"3d"===e?3:2));return 1+Math.log2(s)|0}Ot._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}},Ot._textureTypes=wt.any_texture_type.map((t=>t.name)),Ot._samplerTypes=wt.sampler_type.map((t=>t.name));const Rt=new WeakMap;function Dt(t,e){let r=Rt.get(t);r||(r={pipelineByFormat:{},moduleByView:{}},Rt.set(t,r));let{sampler:s}=r;const{pipelineByFormat:n,moduleByView:i}=r,o=function(t){switch(t.dimension){case"1d":return"1d";case"3d":return"3d";default:return t.depthOrArrayLayers>1?"2d-array":"2d"}}(e);let a=i[o];a||(a=t.createShaderModule({label:`mip level generation for ${o}`,code:"\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n "}),i[o]=a),s||(s=t.createSampler({minFilter:"linear"}),r.sampler=s);const u=`${e.format}`;n[u]||(n[u]=t.createRenderPipeline({label:`mip level generator pipeline for ${o}`,layout:"auto",vertex:{module:a,entryPoint:"vs"},fragment:{module:a,entryPoint:"fs",targets:[{format:e.format}]}}));const c=n[u],l=t.createCommandEncoder({label:"mip gen encoder"});for(let r=1;r[[e,t],[r,t]])).flat());function Wt(t){return"indices"===t}function Ht(t,e){if(r(t))return t;let s=t;if(r(s.data))return s.data;(Array.isArray(t)||"number"==typeof t)&&(s={data:t});let n=s.type;return n||(n=Wt(e)?Uint32Array:Float32Array),new n(s.data)}const Xt=[{re:/coord|texture|uv/i,numComponents:2},{re:/color|colour/i,numComponents:4}];function Zt(t,e){const r=function(t){for(const{re:e,numComponents:r}of Xt)if(e.test(t))return r;return 3}(t);if(e%r>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${r} but ${e} values is not evenly divisible by ${r}. You should specify it.`);return r}const Qt=/(\w+)(?:x(\d))$/;function Jt(t){const e=Qt.exec(t),[r,s]=e?[e[1],parseInt(e[2])]:[t,1];return{Type:Yt.get(r),numComponents:s}}function Kt(t,e){return new(0,Object.getPrototypeOf(t).constructor)(e)}function te(t,e={}){const r=void 0===e.interleave||e.interleave,s=e.stepMode||"vertex",n=e.shaderLocation?Array.isArray(e.shaderLocation)?e.shaderLocation:[e.shaderLocation]:[0];let i=0;const o=[],a=[],u=[];return Object.keys(t).filter((t=>!Wt(t))).forEach((e=>{const c=t[e],l=Ht(c,e),h=function(t,e){return t.numComponents||Zt(e,function(t){return t.length?t:t.data}(t).length)}(c,e),_=h/4%1==0?4:h/3%1==0?3:4;for(let t=0;t1?`x${e}`:""}`,m=n.shift();0===n.length&&n.push(m+1),a.push({offset:r,format:d,shaderLocation:m}),u.push({data:l,offset:t,stride:h})}r||(o.push({stepMode:s,arrayStride:i,attributes:a.slice()}),i=0,a.length=0)})),a.length&&o.push({stepMode:s,arrayStride:i,attributes:a}),{bufferLayouts:o,typedArrays:u}}function ee(t,e){return r(t)?{data:t,offset:0,stride:e}:t}function re(t,e,r,s){const n=new Map;t.forEach(((t,i)=>{const{offset:o,format:a}=t,{numComponents:u}=Jt(a),{data:c,offset:l,stride:h}=ee(e[i],u),_=(t=>{const e=Object.getPrototypeOf(t).constructor,r=n.get(e);if(r)return r;const i=new e(s);return n.set(e,i),i})(c);for(let t=0;tMath.max(1,Math.floor(t/2**e))))}function ce(t,e,s,n){const i=function(t,e){if(r(t))return t;const{Type:s}=ae(e);return new s(t)}(s.data||s,e.format),o=ue(e,0),{bytesPerElement:a}=ae(e.format),u=n.origin||[0,0,0];t.queue.writeTexture({texture:e,origin:u},i,{bytesPerRow:a*o[0],rowsPerImage:o[1]},o)}function le(t,e,r,s={}){r.forEach(((r,n)=>{const i=[0,0,n+(s.baseArrayLayer||0)];if(se(r))ce(t,e,r,{origin:i});else{const n=r,{flipY:o,premultipliedAlpha:a,colorSpace:u}=s;t.queue.copyExternalImageToTexture({source:n,flipY:o},{texture:e,premultipliedAlpha:a,colorSpace:u,origin:i},he(n,s))}})),e.mipLevelCount>1&&Dt(t,e)}function he(t,e){if(t instanceof HTMLVideoElement)return[t.videoWidth,t.videoHeight,1];{const s=t,{width:n,height:i}=s;if(n>0&&i>0&&!se(t))return[n,i,1];const o=e.format||"rgba8unorm",{bytesPerElement:a,bytesPerChannel:u}=ae(o),c=r(t)||Array.isArray(t)?t:t.data;return function(t,e,r,s="2d"){if(r%1!=0)throw new Error("can't guess dimensions");if(t||e){if(e){if(!t&&(t=r/e)%1)throw new Error("can't guess dimensions")}else if((e=r/t)%1)throw new Error("can't guess dimensions")}else{const n=Math.sqrt(r/("cube"===s?6:1));n%1==0?(t=n,e=n):(t=r,e=1)}const n=r/t/e;if(n%1)throw new Error("can't guess dimensions");return[t,e,n]}(n,i,(r(c)?c.byteLength:c.length*u)/a)}}function _e(t,e,r={}){const s=he(e[0],r);s[2]=s[2]>1?s[2]:e.length;const n=t.createTexture({dimension:ne(r.dimension),format:r.format||"rgba8unorm",mipLevelCount:r.mipLevelCount?r.mipLevelCount:r.mips?jt(s):1,size:s,usage:(r.usage??0)|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return le(t,n,e,r),n}async function pe(t,e={}){const r=await fetch(t),s=await r.blob(),n={...e,...void 0!==e.colorSpaceConversion&&{colorSpaceConversion:"none"}};return await createImageBitmap(s,n)}async function de(t,e,r={}){return _e(t,await Promise.all(e.map((t=>pe(t)))),r)}class me{typedArray;cursor=0;numComponents;constructor(t,e){this.typedArray=t,this.numComponents=e}get numElements(){return this.typedArray.length/this.numComponents}push(...t){for(const e of t)if(Array.isArray(e)||r(e)){const e=t;this.typedArray.set(e,this.cursor),this.cursor+=e.length}else this.typedArray[this.cursor++]=e}reset(t=0){this.cursor=t}}function fe(t,e,r){return new me(new r(t*e),t)}const ye=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function ge(t=1,e=0,r=1,s=24,n=1,i=!0,o=!0){if(s<3)throw new Error("radialSubdivisions must be 3 or greater");if(n<1)throw new Error("verticalSubdivisions must be 1 or greater");const a=(i?2:0)+(o?2:0),u=(s+1)*(n+1+a),c=fe(3,u,Float32Array),l=fe(3,u,Float32Array),h=fe(2,u,Float32Array),_=fe(3,s*(n+a/2)*2,Uint16Array),p=s+1,d=Math.atan2(t-e,r),m=Math.cos(d),f=Math.sin(d),y=n+(o?2:0);for(let o=i?-2:0;o<=y;++o){let i,a=o/n,u=r*a;o<0?(u=0,a=1,i=t):o>n?(u=r,a=1,i=e):i=t+o/n*(e-t),-2!==o&&o!==n+2||(i=0,a=0),u-=r/2;for(let t=0;tn?l.push(0,1,0):0===i?l.push(0,0,0):l.push(e*m,f,r*m),h.push(t/s,1-a)}}for(let t=0;t[t,e.typedArray])))},createCrescentVertices:function(t,e,r,s,n,i,o){if(n<=0)throw new Error("subdivisionDown must be > 0");const a=o-i,u=2*(n+1)*4,c=fe(3,u,Float32Array),l=fe(3,u,Float32Array),h=fe(2,u,Float32Array);function _(t,e,r){return t+(e-t)*r}function p(t,e){return t.map(((t,r)=>t+e[r]))}function d(t,e){return t.map(((t,r)=>t*e[r]))}function m(e,r,o,u,m,f){for(let y=0;y<=n;y++){const g=r/1,w=y/n,k=2*(g-.5),x=(i+w*a)*Math.PI,b=Math.sin(x),v=Math.cos(x),A=_(t,e,b),E=k*s,T=v*t,S=b*A;c.push(E,T,S);const z=p(d([0,b,v],o),u);l.push(z),h.push(g*m+f,w)}}for(let t=0;t<2;t++){const s=2*(t/1-.5);m(e,t,[1,1,1],[0,0,0],1,0),m(e,t,[0,0,0],[s,0,0],0,0),m(r,t,[1,1,1],[0,0,0],1,0),m(r,t,[0,0,0],[s,0,0],0,1)}const f=fe(3,2*n*4,Uint16Array);function y(t,e){for(let r=0;r0&&s!==e){const t=l+(s+1),e=l+s,r=l+s-_,n=l+(s+1)-_;c.push(t,e,r),c.push(t,r,n)}}l+=e+1}return{position:o.typedArray,normal:a.typedArray,texcoord:u.typedArray,indices:c.typedArray}},createPlaneVertices:function(t=1,e=1,r=1,s=1){const n=(r+1)*(s+1),i=fe(3,n,Float32Array),o=fe(3,n,Float32Array),a=fe(2,n,Float32Array);for(let n=0;n<=s;n++)for(let u=0;u<=r;u++){const c=u/r,l=n/s;i.push(t*c-.5*t,0,e*l-.5*e),o.push(0,1,0),a.push(c,l)}const u=r+1,c=fe(3,r*s*2,Uint16Array);for(let t=0;t 0");const a=n-s,u=o-i,c=(e+1)*(r+1),l=fe(3,c,Float32Array),h=fe(3,c,Float32Array),_=fe(2,c,Float32Array);for(let n=0;n<=r;n++)for(let o=0;o<=e;o++){const c=o/e,p=n/r,d=u*c+i,m=a*p+s,f=Math.sin(d),y=Math.cos(d),g=Math.sin(m),w=y*g,k=Math.cos(m),x=f*g;l.push(t*w,t*k,t*x),h.push(w,k,x),_.push(1-c,p)}const p=e+1,d=fe(3,e*r*2,Uint16Array);for(let t=0;tWt(t)));if(l){const e=Ht(l[1],"indices"),r=t.createBuffer({size:e.byteLength,usage:GPUBufferUsage.INDEX|s,mappedAtCreation:!0});Kt(e,r.getMappedRange()).set(e),r.unmap(),c.indexBuffer=r,c.indexFormat=e instanceof Uint16Array?"uint16":"uint32",c.numElements=e.length}return c},t.createTextureFromImage=async function(t,e,r={}){return de(t,[e],r)},t.createTextureFromImages=de,t.createTextureFromSource=function(t,e,r={}){return _e(t,[e],r)},t.createTextureFromSources=_e,t.generateMipmap=Dt,t.getSizeForMipFromTexture=ue,t.getSizeFromSource=he,t.interleaveVertexData=re,t.isTypedArray=r,t.kTypes=i,t.loadImageBitmap=pe,t.makeShaderDataDefinitions=function(t){const e=new Ot(t),r=Object.fromEntries(e.structs.map((t=>[t.name,Pt(e,t,0)]))),s=Lt(e,e.uniforms);return{structs:r,storages:Lt(e,e.storage),uniforms:s}},t.makeStructuredView=function(t,e,r=0){const s=t,n=h(void 0===s.group?t:s.typeDefinition,e,r);return{...n,set(t){_(t,n.views)}}},t.makeTypedArrayViews=h,t.normalizeGPUExtent3D=$t,t.numMipLevels=jt,t.primitives=ke,t.setIntrinsicsToView=a,t.setStructuredValues=function(t,e,r,s=0){f(t.typeDefinition,e,r,s)},t.setStructuredView=_,t.setTypedValues=f,t.subarray=function(t,e,r){return t.subarray(e,e+r)}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).webgpuUtils={})}(this,(function(t){"use strict";const e=(t,e)=>((t+e-1)/e|0)*e;const r=t=>t&&"number"==typeof t.length&&t.buffer instanceof ArrayBuffer&&"number"==typeof t.byteLength,s={i32:{numElements:1,align:4,size:4,type:"i32",View:Int32Array},u32:{numElements:1,align:4,size:4,type:"u32",View:Uint32Array},f32:{numElements:1,align:4,size:4,type:"f32",View:Float32Array},f16:{numElements:1,align:2,size:2,type:"u16",View:Uint16Array},vec2f:{numElements:2,align:8,size:8,type:"f32",View:Float32Array},vec2i:{numElements:2,align:8,size:8,type:"i32",View:Int32Array},vec2u:{numElements:2,align:8,size:8,type:"u32",View:Uint32Array},vec2h:{numElements:2,align:4,size:4,type:"u16",View:Uint16Array},vec3i:{numElements:3,align:16,size:12,type:"i32",View:Int32Array},vec3u:{numElements:3,align:16,size:12,type:"u32",View:Uint32Array},vec3f:{numElements:3,align:16,size:12,type:"f32",View:Float32Array},vec3h:{numElements:3,align:8,size:6,type:"u16",View:Uint16Array},vec4i:{numElements:4,align:16,size:16,type:"i32",View:Int32Array},vec4u:{numElements:4,align:16,size:16,type:"u32",View:Uint32Array},vec4f:{numElements:4,align:16,size:16,type:"f32",View:Float32Array},vec4h:{numElements:4,align:8,size:8,type:"u16",View:Uint16Array},mat2x2f:{numElements:4,align:8,size:16,type:"f32",View:Float32Array},mat2x2h:{numElements:4,align:4,size:8,type:"u16",View:Uint16Array},mat3x2f:{numElements:6,align:8,size:24,type:"f32",View:Float32Array},mat3x2h:{numElements:6,align:4,size:12,type:"u16",View:Uint16Array},mat4x2f:{numElements:8,align:8,size:32,type:"f32",View:Float32Array},mat4x2h:{numElements:8,align:4,size:16,type:"u16",View:Uint16Array},mat2x3f:{numElements:8,align:16,size:32,pad:[3,1],type:"f32",View:Float32Array},mat2x3h:{numElements:8,align:8,size:16,pad:[3,1],type:"u16",View:Uint16Array},mat3x3f:{numElements:12,align:16,size:48,pad:[3,1],type:"f32",View:Float32Array},mat3x3h:{numElements:12,align:8,size:24,pad:[3,1],type:"u16",View:Uint16Array},mat4x3f:{numElements:16,align:16,size:64,pad:[3,1],type:"f32",View:Float32Array},mat4x3h:{numElements:16,align:8,size:32,pad:[3,1],type:"u16",View:Uint16Array},mat2x4f:{numElements:8,align:16,size:32,type:"f32",View:Float32Array},mat2x4h:{numElements:8,align:8,size:16,type:"u16",View:Uint16Array},mat3x4f:{numElements:12,align:16,size:48,pad:[3,1],type:"f32",View:Float32Array},mat3x4h:{numElements:12,align:8,size:24,pad:[3,1],type:"u16",View:Uint16Array},mat4x4f:{numElements:16,align:16,size:64,type:"f32",View:Float32Array},mat4x4h:{numElements:16,align:8,size:32,type:"u16",View:Uint16Array}},n={...s,"vec2":s.vec2f,"vec2":s.vec2i,"vec2":s.vec2u,"vec2":s.vec2h,"vec3":s.vec3i,"vec3":s.vec3u,"vec3":s.vec3f,"vec3":s.vec3h,"vec4":s.vec4i,"vec4":s.vec4u,"vec4":s.vec4f,"vec4":s.vec4h,"mat2x2":s.mat2x2f,"mat2x2":s.mat2x2h,"mat3x2":s.mat3x2f,"mat3x2":s.mat3x2h,"mat4x2":s.mat4x2f,"mat4x2":s.mat4x2h,"mat2x3":s.mat2x3f,"mat2x3":s.mat2x3h,"mat3x3":s.mat3x3f,"mat3x3":s.mat3x3h,"mat4x3":s.mat4x3f,"mat4x3":s.mat4x3h,"mat2x4":s.mat2x4f,"mat2x4":s.mat2x4h,"mat3x4":s.mat3x4f,"mat3x4":s.mat3x4h,"mat4x4":s.mat4x4f,"mat4x4":s.mat4x4h};function i(t){const r=t;if(r.elementType)return r.size;{const s=t,i=r.numElements||1;if(s.fields)return t.size*i;{const r=t,{align:s}=n[r.type];return i>1?e(t.size,s)*i:t.size}}}function a(t,r,s,i){const{size:a,type:o}=t;try{const{View:t,align:u}=n[o],c=void 0!==i,l=c?e(a,u):a,h=l/t.BYTES_PER_ELEMENT;return new t(r,s,h*(c?0===i?(r.byteLength-s)/l:i:1))}catch{throw new Error(`unknown type: ${o}`)}}function o(t){return!t.fields&&!t.elementType}function u(t,e,r){const s=r||0,n=e||new ArrayBuffer(i(t)),u=(t,e)=>{const r=t,s=r.elementType;if(s){if(o(s))return a(s,n,e,r.numElements);{const t=i(s),a=0===r.numElements?(n.byteLength-e)/t:r.numElements;return c=r=>u(s,e+t*r),new Array(a).fill(0).map(((t,e)=>c(e)))}}if("string"==typeof t)throw Error("unreachable");{const r=t.fields;if(r){const t={};for(const[s,{type:n,offset:i}]of Object.entries(r))t[s]=u(n,e+i);return t}return a(t,n,e)}var c};return{views:u(t,s),arrayBuffer:n}}function c(t,e){if(void 0!==t)if(r(e)){const s=e;if(1===s.length&&"number"==typeof t)s[0]=t;else if(Array.isArray(t[0])||r(t[0])){const e=t[0].length,r=3===e?4:e;for(let e=0;e{c(t,r[e])}))}else{const r=e;for(const[e,s]of Object.entries(t)){const t=r[e];t&&c(s,t)}}}const l=new WeakMap;function h(t,e){const r=function(t){let e=l.get(t);return e||(e=new Map,l.set(t,e)),e}(t);let s=r.get(e);return s||(s=new e(t),r.set(e,s)),s}function _(t,e,r,s){const i=h(r,n[t.type].View),a=s/i.BYTES_PER_ELEMENT;"number"==typeof e?i[a]=e:i.set(e,a)}function p(t,e,s,n=0){const i=t.elementType;if(i){if(o(i)){const t=i;if(function(t){return r(t)||Array.isArray(t)&&"number"==typeof t[0]}(e))return void _(t,e,s,n)}return void e.forEach(((t,e)=>{p(i,t,s,n+i.size*e)}))}const a=t.fields;if(a)for(const[t,r]of Object.entries(e)){const e=a[t];e&&p(e.type,r,s,n+e.offset)}else _(t,e,s,n)}class d{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class m{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(t){throw new Error("Cannot evaluate node")}evaluateString(t){return this.evaluate(t).toString()}}class f extends m{constructor(){super()}}class y extends f{constructor(t,e,r,s){super(),this.name=t,this.args=e,this.returnType=r,this.body=s}get astNodeType(){return"function"}}class g extends f{constructor(t){super(),this.expression=t}get astNodeType(){return"staticAssert"}}class w extends f{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"while"}}class k extends f{constructor(t){super(),this.body=t}get astNodeType(){return"continuing"}}class x extends f{constructor(t,e,r,s){super(),this.init=t,this.condition=e,this.increment=r,this.body=s}get astNodeType(){return"for"}}class b extends f{constructor(t,e,r,s,n){super(),this.name=t,this.type=e,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"var"}}class v extends f{constructor(t,e,r){super(),this.name=t,this.type=e,this.value=r}get astNodeType(){return"override"}}class A extends f{constructor(t,e,r,s,n){super(),this.name=t,this.type=e,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"let"}}class E extends f{constructor(t,e,r,s,n){super(),this.name=t,this.type=e,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"const"}evaluate(t){return this.value.evaluate(t)}}var T,S,z,M,I;!function(t){t.increment="++",t.decrement="--"}(T||(T={})),function(t){t.parse=function(e){const r=e;if("parse"==r)throw new Error("Invalid value for IncrementOperator");return t[r]}}(T||(T={}));class V extends f{constructor(t,e){super(),this.operator=t,this.variable=e}get astNodeType(){return"increment"}}!function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="}(S||(S={})),function(t){t.parse=function(e){const r=e;if("parse"==r)throw new Error("Invalid value for AssignOperator");return t[r]}}(S||(S={}));class N extends f{constructor(t,e,r){super(),this.operator=t,this.variable=e,this.value=r}get astNodeType(){return"assign"}}class F extends f{constructor(t,e){super(),this.name=t,this.args=e}get astNodeType(){return"call"}}class q extends f{constructor(t,e){super(),this.body=t,this.continuing=e}get astNodeType(){return"loop"}}class U extends f{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"body"}}class O extends f{constructor(t,e,r,s){super(),this.condition=t,this.body=e,this.elseif=r,this.else=s}get astNodeType(){return"if"}}class L extends f{constructor(t){super(),this.value=t}get astNodeType(){return"return"}}class P extends f{constructor(t){super(),this.name=t}get astNodeType(){return"enable"}}class C extends f{constructor(t,e){super(),this.name=t,this.type=e}get astNodeType(){return"alias"}}class B extends f{constructor(){super()}get astNodeType(){return"discard"}}class $ extends f{constructor(){super()}get astNodeType(){return"break"}}class j extends f{constructor(){super()}get astNodeType(){return"continue"}}class R extends f{constructor(t){super(),this.name=t}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class D extends R{constructor(t,e){super(t),this.members=e}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(t){for(let e=0;e":return this.left.evaluate(t)>this.right.evaluate(t)?1:0;case"<=":return this.left.evaluate(t)<=this.right.evaluate(t)?1:0;case">=":return this.left.evaluate(t)>=this.right.evaluate(t)?1:0;case"&&":return this.left.evaluate(t)&&this.right.evaluate(t)?1:0;case"||":return this.left.evaluate(t)||this.right.evaluate(t)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}}class ut extends m{constructor(){super()}}class ct extends ut{constructor(t,e){super(),this.selector=t,this.body=e}get astNodeType(){return"case"}}class lt extends ut{constructor(t){super(),this.body=t}get astNodeType(){return"default"}}class ht extends m{constructor(t,e,r){super(),this.name=t,this.type=e,this.attributes=r}get astNodeType(){return"argument"}}class _t extends m{constructor(t,e){super(),this.condition=t,this.body=e}get astNodeType(){return"elseif"}}class pt extends m{constructor(t,e,r){super(),this.name=t,this.type=e,this.attributes=r}get astNodeType(){return"member"}}class dt extends m{constructor(t,e){super(),this.name=t,this.value=e}get astNodeType(){return"attribute"}}!function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"}(M||(M={}));class mt{constructor(t,e,r){this.name=t,this.type=e,this.rule=r}toString(){return this.name}}class ft{}z=ft,ft.none=new mt("",M.reserved,""),ft.eof=new mt("EOF",M.token,""),ft.reserved={asm:new mt("asm",M.reserved,"asm"),bf16:new mt("bf16",M.reserved,"bf16"),do:new mt("do",M.reserved,"do"),enum:new mt("enum",M.reserved,"enum"),f16:new mt("f16",M.reserved,"f16"),f64:new mt("f64",M.reserved,"f64"),handle:new mt("handle",M.reserved,"handle"),i8:new mt("i8",M.reserved,"i8"),i16:new mt("i16",M.reserved,"i16"),i64:new mt("i64",M.reserved,"i64"),mat:new mt("mat",M.reserved,"mat"),premerge:new mt("premerge",M.reserved,"premerge"),regardless:new mt("regardless",M.reserved,"regardless"),typedef:new mt("typedef",M.reserved,"typedef"),u8:new mt("u8",M.reserved,"u8"),u16:new mt("u16",M.reserved,"u16"),u64:new mt("u64",M.reserved,"u64"),unless:new mt("unless",M.reserved,"unless"),using:new mt("using",M.reserved,"using"),vec:new mt("vec",M.reserved,"vec"),void:new mt("void",M.reserved,"void")},ft.keywords={array:new mt("array",M.keyword,"array"),atomic:new mt("atomic",M.keyword,"atomic"),bool:new mt("bool",M.keyword,"bool"),f32:new mt("f32",M.keyword,"f32"),i32:new mt("i32",M.keyword,"i32"),mat2x2:new mt("mat2x2",M.keyword,"mat2x2"),mat2x3:new mt("mat2x3",M.keyword,"mat2x3"),mat2x4:new mt("mat2x4",M.keyword,"mat2x4"),mat3x2:new mt("mat3x2",M.keyword,"mat3x2"),mat3x3:new mt("mat3x3",M.keyword,"mat3x3"),mat3x4:new mt("mat3x4",M.keyword,"mat3x4"),mat4x2:new mt("mat4x2",M.keyword,"mat4x2"),mat4x3:new mt("mat4x3",M.keyword,"mat4x3"),mat4x4:new mt("mat4x4",M.keyword,"mat4x4"),ptr:new mt("ptr",M.keyword,"ptr"),sampler:new mt("sampler",M.keyword,"sampler"),sampler_comparison:new mt("sampler_comparison",M.keyword,"sampler_comparison"),struct:new mt("struct",M.keyword,"struct"),texture_1d:new mt("texture_1d",M.keyword,"texture_1d"),texture_2d:new mt("texture_2d",M.keyword,"texture_2d"),texture_2d_array:new mt("texture_2d_array",M.keyword,"texture_2d_array"),texture_3d:new mt("texture_3d",M.keyword,"texture_3d"),texture_cube:new mt("texture_cube",M.keyword,"texture_cube"),texture_cube_array:new mt("texture_cube_array",M.keyword,"texture_cube_array"),texture_multisampled_2d:new mt("texture_multisampled_2d",M.keyword,"texture_multisampled_2d"),texture_storage_1d:new mt("texture_storage_1d",M.keyword,"texture_storage_1d"),texture_storage_2d:new mt("texture_storage_2d",M.keyword,"texture_storage_2d"),texture_storage_2d_array:new mt("texture_storage_2d_array",M.keyword,"texture_storage_2d_array"),texture_storage_3d:new mt("texture_storage_3d",M.keyword,"texture_storage_3d"),texture_depth_2d:new mt("texture_depth_2d",M.keyword,"texture_depth_2d"),texture_depth_2d_array:new mt("texture_depth_2d_array",M.keyword,"texture_depth_2d_array"),texture_depth_cube:new mt("texture_depth_cube",M.keyword,"texture_depth_cube"),texture_depth_cube_array:new mt("texture_depth_cube_array",M.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new mt("texture_depth_multisampled_2d",M.keyword,"texture_depth_multisampled_2d"),texture_external:new mt("texture_external",M.keyword,"texture_external"),u32:new mt("u32",M.keyword,"u32"),vec2:new mt("vec2",M.keyword,"vec2"),vec3:new mt("vec3",M.keyword,"vec3"),vec4:new mt("vec4",M.keyword,"vec4"),bitcast:new mt("bitcast",M.keyword,"bitcast"),block:new mt("block",M.keyword,"block"),break:new mt("break",M.keyword,"break"),case:new mt("case",M.keyword,"case"),continue:new mt("continue",M.keyword,"continue"),continuing:new mt("continuing",M.keyword,"continuing"),default:new mt("default",M.keyword,"default"),discard:new mt("discard",M.keyword,"discard"),else:new mt("else",M.keyword,"else"),enable:new mt("enable",M.keyword,"enable"),fallthrough:new mt("fallthrough",M.keyword,"fallthrough"),false:new mt("false",M.keyword,"false"),fn:new mt("fn",M.keyword,"fn"),for:new mt("for",M.keyword,"for"),function:new mt("function",M.keyword,"function"),if:new mt("if",M.keyword,"if"),let:new mt("let",M.keyword,"let"),const:new mt("const",M.keyword,"const"),loop:new mt("loop",M.keyword,"loop"),while:new mt("while",M.keyword,"while"),private:new mt("private",M.keyword,"private"),read:new mt("read",M.keyword,"read"),read_write:new mt("read_write",M.keyword,"read_write"),return:new mt("return",M.keyword,"return"),storage:new mt("storage",M.keyword,"storage"),switch:new mt("switch",M.keyword,"switch"),true:new mt("true",M.keyword,"true"),alias:new mt("alias",M.keyword,"alias"),type:new mt("type",M.keyword,"type"),uniform:new mt("uniform",M.keyword,"uniform"),var:new mt("var",M.keyword,"var"),override:new mt("override",M.keyword,"override"),workgroup:new mt("workgroup",M.keyword,"workgroup"),write:new mt("write",M.keyword,"write"),r8unorm:new mt("r8unorm",M.keyword,"r8unorm"),r8snorm:new mt("r8snorm",M.keyword,"r8snorm"),r8uint:new mt("r8uint",M.keyword,"r8uint"),r8sint:new mt("r8sint",M.keyword,"r8sint"),r16uint:new mt("r16uint",M.keyword,"r16uint"),r16sint:new mt("r16sint",M.keyword,"r16sint"),r16float:new mt("r16float",M.keyword,"r16float"),rg8unorm:new mt("rg8unorm",M.keyword,"rg8unorm"),rg8snorm:new mt("rg8snorm",M.keyword,"rg8snorm"),rg8uint:new mt("rg8uint",M.keyword,"rg8uint"),rg8sint:new mt("rg8sint",M.keyword,"rg8sint"),r32uint:new mt("r32uint",M.keyword,"r32uint"),r32sint:new mt("r32sint",M.keyword,"r32sint"),r32float:new mt("r32float",M.keyword,"r32float"),rg16uint:new mt("rg16uint",M.keyword,"rg16uint"),rg16sint:new mt("rg16sint",M.keyword,"rg16sint"),rg16float:new mt("rg16float",M.keyword,"rg16float"),rgba8unorm:new mt("rgba8unorm",M.keyword,"rgba8unorm"),rgba8unorm_srgb:new mt("rgba8unorm_srgb",M.keyword,"rgba8unorm_srgb"),rgba8snorm:new mt("rgba8snorm",M.keyword,"rgba8snorm"),rgba8uint:new mt("rgba8uint",M.keyword,"rgba8uint"),rgba8sint:new mt("rgba8sint",M.keyword,"rgba8sint"),bgra8unorm:new mt("bgra8unorm",M.keyword,"bgra8unorm"),bgra8unorm_srgb:new mt("bgra8unorm_srgb",M.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new mt("rgb10a2unorm",M.keyword,"rgb10a2unorm"),rg11b10float:new mt("rg11b10float",M.keyword,"rg11b10float"),rg32uint:new mt("rg32uint",M.keyword,"rg32uint"),rg32sint:new mt("rg32sint",M.keyword,"rg32sint"),rg32float:new mt("rg32float",M.keyword,"rg32float"),rgba16uint:new mt("rgba16uint",M.keyword,"rgba16uint"),rgba16sint:new mt("rgba16sint",M.keyword,"rgba16sint"),rgba16float:new mt("rgba16float",M.keyword,"rgba16float"),rgba32uint:new mt("rgba32uint",M.keyword,"rgba32uint"),rgba32sint:new mt("rgba32sint",M.keyword,"rgba32sint"),rgba32float:new mt("rgba32float",M.keyword,"rgba32float"),static_assert:new mt("static_assert",M.keyword,"static_assert")},ft.tokens={decimal_float_literal:new mt("decimal_float_literal",M.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new mt("hex_float_literal",M.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?))/),int_literal:new mt("int_literal",M.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new mt("uint_literal",M.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new mt("ident",M.token,/[a-zA-Z][0-9a-zA-Z_]*/),and:new mt("and",M.token,"&"),and_and:new mt("and_and",M.token,"&&"),arrow:new mt("arrow ",M.token,"->"),attr:new mt("attr",M.token,"@"),attr_left:new mt("attr_left",M.token,"[["),attr_right:new mt("attr_right",M.token,"]]"),forward_slash:new mt("forward_slash",M.token,"/"),bang:new mt("bang",M.token,"!"),bracket_left:new mt("bracket_left",M.token,"["),bracket_right:new mt("bracket_right",M.token,"]"),brace_left:new mt("brace_left",M.token,"{"),brace_right:new mt("brace_right",M.token,"}"),colon:new mt("colon",M.token,":"),comma:new mt("comma",M.token,","),equal:new mt("equal",M.token,"="),equal_equal:new mt("equal_equal",M.token,"=="),not_equal:new mt("not_equal",M.token,"!="),greater_than:new mt("greater_than",M.token,">"),greater_than_equal:new mt("greater_than_equal",M.token,">="),shift_right:new mt("shift_right",M.token,">>"),less_than:new mt("less_than",M.token,"<"),less_than_equal:new mt("less_than_equal",M.token,"<="),shift_left:new mt("shift_left",M.token,"<<"),modulo:new mt("modulo",M.token,"%"),minus:new mt("minus",M.token,"-"),minus_minus:new mt("minus_minus",M.token,"--"),period:new mt("period",M.token,"."),plus:new mt("plus",M.token,"+"),plus_plus:new mt("plus_plus",M.token,"++"),or:new mt("or",M.token,"|"),or_or:new mt("or_or",M.token,"||"),paren_left:new mt("paren_left",M.token,"("),paren_right:new mt("paren_right",M.token,")"),semicolon:new mt("semicolon",M.token,";"),star:new mt("star",M.token,"*"),tilde:new mt("tilde",M.token,"~"),underscore:new mt("underscore",M.token,"_"),xor:new mt("xor",M.token,"^"),plus_equal:new mt("plus_equal",M.token,"+="),minus_equal:new mt("minus_equal",M.token,"-="),times_equal:new mt("times_equal",M.token,"*="),division_equal:new mt("division_equal",M.token,"/="),modulo_equal:new mt("modulo_equal",M.token,"%="),and_equal:new mt("and_equal",M.token,"&="),or_equal:new mt("or_equal",M.token,"|="),xor_equal:new mt("xor_equal",M.token,"^="),shift_right_equal:new mt("shift_right_equal",M.token,">>="),shift_left_equal:new mt("shift_left_equal",M.token,"<<=")},ft.storage_class=[z.keywords.function,z.keywords.private,z.keywords.workgroup,z.keywords.uniform,z.keywords.storage],ft.access_mode=[z.keywords.read,z.keywords.write,z.keywords.read_write],ft.sampler_type=[z.keywords.sampler,z.keywords.sampler_comparison],ft.sampled_texture_type=[z.keywords.texture_1d,z.keywords.texture_2d,z.keywords.texture_2d_array,z.keywords.texture_3d,z.keywords.texture_cube,z.keywords.texture_cube_array],ft.multisampled_texture_type=[z.keywords.texture_multisampled_2d],ft.storage_texture_type=[z.keywords.texture_storage_1d,z.keywords.texture_storage_2d,z.keywords.texture_storage_2d_array,z.keywords.texture_storage_3d],ft.depth_texture_type=[z.keywords.texture_depth_2d,z.keywords.texture_depth_2d_array,z.keywords.texture_depth_cube,z.keywords.texture_depth_cube_array,z.keywords.texture_depth_multisampled_2d],ft.texture_external_type=[z.keywords.texture_external],ft.any_texture_type=[...z.sampled_texture_type,...z.multisampled_texture_type,...z.storage_texture_type,...z.depth_texture_type,...z.texture_external_type],ft.texel_format=[z.keywords.r8unorm,z.keywords.r8snorm,z.keywords.r8uint,z.keywords.r8sint,z.keywords.r16uint,z.keywords.r16sint,z.keywords.r16float,z.keywords.rg8unorm,z.keywords.rg8snorm,z.keywords.rg8uint,z.keywords.rg8sint,z.keywords.r32uint,z.keywords.r32sint,z.keywords.r32float,z.keywords.rg16uint,z.keywords.rg16sint,z.keywords.rg16float,z.keywords.rgba8unorm,z.keywords.rgba8unorm_srgb,z.keywords.rgba8snorm,z.keywords.rgba8uint,z.keywords.rgba8sint,z.keywords.bgra8unorm,z.keywords.bgra8unorm_srgb,z.keywords.rgb10a2unorm,z.keywords.rg11b10float,z.keywords.rg32uint,z.keywords.rg32sint,z.keywords.rg32float,z.keywords.rgba16uint,z.keywords.rgba16sint,z.keywords.rgba16float,z.keywords.rgba32uint,z.keywords.rgba32sint,z.keywords.rgba32float],ft.const_literal=[z.tokens.int_literal,z.tokens.uint_literal,z.tokens.decimal_float_literal,z.tokens.hex_float_literal,z.keywords.true,z.keywords.false],ft.literal_or_ident=[z.tokens.ident,z.tokens.int_literal,z.tokens.uint_literal,z.tokens.decimal_float_literal,z.tokens.hex_float_literal],ft.element_count_expression=[z.tokens.int_literal,z.tokens.uint_literal,z.tokens.ident],ft.template_types=[z.keywords.vec2,z.keywords.vec3,z.keywords.vec4,z.keywords.mat2x2,z.keywords.mat2x3,z.keywords.mat2x4,z.keywords.mat3x2,z.keywords.mat3x3,z.keywords.mat3x4,z.keywords.mat4x2,z.keywords.mat4x3,z.keywords.mat4x4,z.keywords.atomic,z.keywords.bitcast,...z.any_texture_type],ft.attribute_name=[z.tokens.ident,z.keywords.block],ft.assignment_operators=[z.tokens.equal,z.tokens.plus_equal,z.tokens.minus_equal,z.tokens.times_equal,z.tokens.division_equal,z.tokens.modulo_equal,z.tokens.and_equal,z.tokens.or_equal,z.tokens.xor_equal,z.tokens.shift_right_equal,z.tokens.shift_left_equal],ft.increment_operators=[z.tokens.plus_plus,z.tokens.minus_minus];class yt{constructor(t,e,r){this.type=t,this.lexeme=e,this.line=r}toString(){return this.lexeme}isTemplateType(){return-1!=ft.template_types.indexOf(this.type)}isArrayType(){return this.type==ft.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class gt{constructor(t){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=null!=t?t:""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new yt(ft.eof,"",this._line)),this._tokens}scanToken(){let t=this._advance();if("\n"==t)return this._line++,!0;if(this._isWhitespace(t))return!0;if("/"==t){if("/"==this._peekAhead()){for(;"\n"!=t;){if(this._isAtEnd())return!0;t=this._advance()}return this._line++,!0}if("*"==this._peekAhead()){this._advance();let e=1;for(;e>0;){if(this._isAtEnd())return!0;if(t=this._advance(),"\n"==t)this._line++;else if("*"==t){if("/"==this._peekAhead()&&(this._advance(),e--,0==e))return!0}else"/"==t&&"*"==this._peekAhead()&&(this._advance(),e++)}return!0}}let e=ft.none;for(;;){let r=this._findType(t);const s=this._peekAhead();if(">"==t&&(">"==s||"="==s)){let t=!1,e=this._tokens.length-1;for(let r=0;r<5&&e>=0;++r,--e)if(this._tokens[e].type===ft.tokens.less_than){e>0&&this._tokens[e-1].isArrayOrTemplateType()&&(t=!0);break}if(t)return this._addToken(r),!0}if(r===ft.none){let s=t,n=0;const i=2;for(let t=0;t=this._source.length}_isWhitespace(t){return" "==t||"\t"==t||"\r"==t}_advance(t=0){let e=this._source[this._current];return t=t||0,t++,this._current+=t,e}_peekAhead(t=0){return t=t||0,this._current+t>=this._source.length?"\0":this._source[this._current+t]}_addToken(t){const e=this._source.substring(this._start,this._current);this._tokens.push(new yt(t,e,this._line))}}class wt{constructor(){this._tokens=[],this._current=0,this._context=new d}parse(t){this._initialize(t);let e=[];for(;!this._isAtEnd();){const t=this._global_decl_or_directive();if(!t)break;e.push(t)}return e}_initialize(t){if(t)if("string"==typeof t){const e=new gt(t);this._tokens=e.scanTokens()}else this._tokens=t;else this._tokens=[];this._current=0}_error(t,e){return console.error(t,e),{token:t,message:e,toString:function(){return`${e}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==ft.eof}_match(t){if(t instanceof mt)return!!this._check(t)&&(this._advance(),!0);for(let e=0,r=t.length;e'.");const e=this._paren_expression();return new rt(t,e)}const t=this._type_decl(),e=this._argument_expression_list();return new st(t,e)}_argument_expression_list(){if(!this._match(ft.tokens.paren_left))return null;const t=[];do{if(this._check(ft.tokens.paren_right))break;const e=this._short_circuit_or_expression();t.push(e)}while(this._match(ft.tokens.comma));return this._consume(ft.tokens.paren_right,"Expected ')' for agument list"),t}_optional_paren_expression(){this._match(ft.tokens.paren_left);const t=this._short_circuit_or_expression();return this._match(ft.tokens.paren_right),new nt([t])}_paren_expression(){this._consume(ft.tokens.paren_left,"Expected '('.");const t=this._short_circuit_or_expression();return this._consume(ft.tokens.paren_right,"Expected ')'."),new nt([t])}_struct_decl(){if(!this._match(ft.keywords.struct))return null;const t=this._consume(ft.tokens.ident,"Expected name for struct.").toString();this._consume(ft.tokens.brace_left,"Expected '{' for struct body.");const e=[];for(;!this._check(ft.tokens.brace_right);){const t=this._attribute(),r=this._consume(ft.tokens.ident,"Expected variable name.").toString();this._consume(ft.tokens.colon,"Expected ':' for struct member type.");const s=this._attribute(),n=this._type_decl();null!=n&&(n.attributes=s),this._check(ft.tokens.brace_right)?this._match(ft.tokens.comma):this._consume(ft.tokens.comma,"Expected ',' for struct member."),e.push(new pt(r,n,t))}this._consume(ft.tokens.brace_right,"Expected '}' after struct body.");const r=new D(t,e);return this._context.structs.set(t,r),r}_global_variable_decl(){const t=this._variable_decl();return t&&this._match(ft.tokens.equal)&&(t.value=this._const_expression()),t}_override_variable_decl(){const t=this._override_decl();return t&&this._match(ft.tokens.equal)&&(t.value=this._const_expression()),t}_global_const_decl(){if(!this._match(ft.keywords.const))return null;const t=this._consume(ft.tokens.ident,"Expected variable name");let e=null;if(this._match(ft.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}let r=null;if(this._match(ft.tokens.equal)){const t=this._short_circuit_or_expression();if(t instanceof Q)r=t;else if(t instanceof tt&&t.initializer instanceof Q)r=t.initializer;else try{const e=t.evaluate(this._context);r=new et(e)}catch(e){r=t}}const s=new E(t.toString(),e,"","",r);return this._context.constants.set(s.name,s),s}_global_let_decl(){if(!this._match(ft.keywords.let))return null;const t=this._consume(ft.tokens.ident,"Expected variable name");let e=null;if(this._match(ft.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}let r=null;return this._match(ft.tokens.equal)&&(r=this._const_expression()),new A(t.toString(),e,"","",r)}_const_expression(){if(this._match(ft.const_literal))return new Z(this._previous().toString());const t=this._type_decl();this._consume(ft.tokens.paren_left,"Expected '('.");let e=[];for(;!this._check(ft.tokens.paren_right)&&(e.push(this._const_expression()),this._check(ft.tokens.comma));)this._advance();return this._consume(ft.tokens.paren_right,"Expected ')'."),new Q(t,e)}_variable_decl(){if(!this._match(ft.keywords.var))return null;let t="",e="";this._match(ft.tokens.less_than)&&(t=this._consume(ft.storage_class,"Expected storage_class.").toString(),this._match(ft.tokens.comma)&&(e=this._consume(ft.access_mode,"Expected access_mode.").toString()),this._consume(ft.tokens.greater_than,"Expected '>'."));const r=this._consume(ft.tokens.ident,"Expected variable name");let s=null;if(this._match(ft.tokens.colon)){const t=this._attribute();s=this._type_decl(),null!=s&&(s.attributes=t)}return new b(r.toString(),s,t,e,null)}_override_decl(){if(!this._match(ft.keywords.override))return null;const t=this._consume(ft.tokens.ident,"Expected variable name");let e=null;if(this._match(ft.tokens.colon)){const t=this._attribute();e=this._type_decl(),null!=e&&(e.attributes=t)}return new v(t.toString(),e,null)}_enable_directive(){const t=this._consume(ft.tokens.ident,"identity expected.");return new P(t.toString())}_type_alias(){const t=this._consume(ft.tokens.ident,"identity expected.");this._consume(ft.tokens.equal,"Expected '=' for type alias.");let e=this._type_decl();if(null===e)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(e.name)&&(e=this._context.aliases.get(e.name).type);const r=new C(t.toString(),e);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([ft.tokens.ident,...ft.texel_format,ft.keywords.bool,ft.keywords.f32,ft.keywords.i32,ft.keywords.u32])){const t=this._advance(),e=t.toString();return this._context.structs.has(e)?this._context.structs.get(e):this._context.aliases.has(e)?this._context.aliases.get(e).type:new R(t.toString())}let t=this._texture_sampler_types();if(t)return t;if(this._check(ft.template_types)){let t=this._advance().toString(),e=null,r=null;return this._match(ft.tokens.less_than)&&(e=this._type_decl(),r=null,this._match(ft.tokens.comma)&&(r=this._consume(ft.access_mode,"Expected access_mode for pointer").toString()),this._consume(ft.tokens.greater_than,"Expected '>' for type.")),new G(t,e,r)}if(this._match(ft.keywords.ptr)){let t=this._previous().toString();this._consume(ft.tokens.less_than,"Expected '<' for pointer.");const e=this._consume(ft.storage_class,"Expected storage_class for pointer");this._consume(ft.tokens.comma,"Expected ',' for pointer.");const r=this._type_decl();let s=null;return this._match(ft.tokens.comma)&&(s=this._consume(ft.access_mode,"Expected access_mode for pointer").toString()),this._consume(ft.tokens.greater_than,"Expected '>' for pointer."),new Y(t,e.toString(),r,s)}const e=this._attribute();if(this._match(ft.keywords.array)){let t=null,r=-1;const s=this._previous();if(this._match(ft.tokens.less_than)){t=this._type_decl(),this._context.aliases.has(t.name)&&(t=this._context.aliases.get(t.name).type);let e="";if(this._match(ft.tokens.comma)){e=this._shift_expression().evaluate(this._context).toString()}this._consume(ft.tokens.greater_than,"Expected '>' for array."),r=e?parseInt(e):0}return new W(s.toString(),e,t,r)}return null}_texture_sampler_types(){if(this._match(ft.sampler_type))return new H(this._previous().toString(),null,null);if(this._match(ft.depth_texture_type))return new H(this._previous().toString(),null,null);if(this._match(ft.sampled_texture_type)||this._match(ft.multisampled_texture_type)){const t=this._previous();this._consume(ft.tokens.less_than,"Expected '<' for sampler type.");const e=this._type_decl();return this._consume(ft.tokens.greater_than,"Expected '>' for sampler type."),new H(t.toString(),e,null)}if(this._match(ft.storage_texture_type)){const t=this._previous();this._consume(ft.tokens.less_than,"Expected '<' for sampler type.");const e=this._consume(ft.texel_format,"Invalid texel format.").toString();this._consume(ft.tokens.comma,"Expected ',' after texel format.");const r=this._consume(ft.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(ft.tokens.greater_than,"Expected '>' for sampler type."),new H(t.toString(),e,r)}return null}_attribute(){let t=[];for(;this._match(ft.tokens.attr);){const e=this._consume(ft.attribute_name,"Expected attribute name"),r=new dt(e.toString(),null);if(this._match(ft.tokens.paren_left)){if(r.value=this._consume(ft.literal_or_ident,"Expected attribute value").toString(),this._check(ft.tokens.comma)){this._advance();do{const t=this._consume(ft.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(t)}while(this._match(ft.tokens.comma))}this._consume(ft.tokens.paren_right,"Expected ')'")}t.push(r)}for(;this._match(ft.tokens.attr_left);){if(!this._check(ft.tokens.attr_right))do{const e=this._consume(ft.attribute_name,"Expected attribute name"),r=new dt(e.toString(),null);if(this._match(ft.tokens.paren_left)){if(r.value=[this._consume(ft.literal_or_ident,"Expected attribute value").toString()],this._check(ft.tokens.comma)){this._advance();do{const t=this._consume(ft.literal_or_ident,"Expected attribute value").toString();r.value.push(t)}while(this._match(ft.tokens.comma))}this._consume(ft.tokens.paren_right,"Expected ')'")}t.push(r)}while(this._match(ft.tokens.comma));this._consume(ft.tokens.attr_right,"Expected ']]' after attribute declarations")}return 0==t.length?null:t}}class kt{constructor(t,e){this.name=t,this.attributes=e,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class xt{constructor(t,e,r){this.name=t,this.type=e,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class bt extends kt{constructor(t,e){super(t,e),this.members=[],this.align=0}get isStruct(){return!0}}class vt extends kt{constructor(t,e){super(t,e),this.count=0,this.stride=0}get isArray(){return!0}}class At extends kt{constructor(t,e,r,s){super(t,r),this.format=e,this.access=s}get isTemplate(){return!0}}!function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"}(I||(I={}));class Et{constructor(t,e,r,s,n,i,a){this.name=t,this.type=e,this.group=r,this.binding=s,this.attributes=n,this.resourceType=i,this.access=a}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Tt{constructor(t,e){this.name=t,this.type=e}}class St{constructor(t,e){this.align=t,this.size=e}}class zt{constructor(t,e,r,s){this.name=t,this.type=e,this.locationType=r,this.location=s,this.interpolation=null}}class Mt{constructor(t,e,r,s){this.name=t,this.type=e,this.locationType=r,this.location=s}}class It{constructor(t,e=null){this.stage=null,this.inputs=[],this.outputs=[],this.name=t,this.stage=e}}class Vt{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class Nt{constructor(t,e,r,s){this.name=t,this.type=e,this.attributes=r,this.id=s}}class Ft{constructor(t){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new Vt,this._types=new Map,t&&this.update(t)}_isStorageTexture(t){return"texture_storage_1d"==t.name||"texture_storage_2d"==t.name||"texture_storage_2d_array"==t.name||"texture_storage_3d"==t.name}update(t){const e=(new wt).parse(t);for(const t of e)if(t instanceof D){const e=this._getTypeInfo(t,null);e instanceof bt&&this.structs.push(e)}else if(t instanceof C)this.aliases.push(this._getAliasInfo(t));else if(t instanceof v){const e=t,r=this._getAttributeNum(e.attributes,"id",0),s=null!=e.type?this._getTypeInfo(e.type,e.attributes):null;this.overrides.push(new Nt(e.name,s,e.attributes,r))}else if(this._isUniformVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=new Et(e.name,n,r,s,e.attributes,I.Uniform,e.access);this.uniforms.push(i)}else if(this._isStorageVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=this._isStorageTexture(n),a=new Et(e.name,n,r,s,e.attributes,i?I.StorageTexture:I.Storage,e.access);this.storage.push(a)}else if(this._isTextureVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=this._isStorageTexture(n),a=new Et(e.name,n,r,s,e.attributes,i?I.StorageTexture:I.Texture,e.access);i?this.storage.push(a):this.textures.push(a)}else if(this._isSamplerVar(t)){const e=t,r=this._getAttributeNum(e.attributes,"group",0),s=this._getAttributeNum(e.attributes,"binding",0),n=this._getTypeInfo(e.type,e.attributes),i=new Et(e.name,n,r,s,e.attributes,I.Sampler,e.access);this.samplers.push(i)}else if(t instanceof y){const e=this._getAttribute(t,"vertex"),r=this._getAttribute(t,"fragment"),s=this._getAttribute(t,"compute"),n=e||r||s;if(n){const e=new It(t.name,n.name);e.inputs=this._getInputs(t.args),e.outputs=this._getOutputs(t.returnType),this.entry[n.name].push(e)}}else;}getBindGroups(){const t=[];function e(e,r){e>=t.length&&(t.length=e+1),void 0===t[e]&&(t[e]=[]),r>=t[e].length&&(t[e].length=r+1)}for(const r of this.uniforms){e(r.group,r.binding);t[r.group][r.binding]=r}for(const r of this.storage){e(r.group,r.binding);t[r.group][r.binding]=r}for(const r of this.textures){e(r.group,r.binding);t[r.group][r.binding]=r}for(const r of this.samplers){e(r.group,r.binding);t[r.group][r.binding]=r}return t}_getOutputs(t,e=void 0){if(void 0===e&&(e=[]),t instanceof D)this._getStructOutputs(t,e);else{const r=this._getOutputInfo(t);null!==r&&e.push(r)}return e}_getStructOutputs(t,e){for(const r of t.members)if(r.type instanceof D)this._getStructOutputs(r.type,e);else{const t=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(null!==t){const s=this._getTypeInfo(r.type,r.type.attributes),n=this._parseInt(t.value),i=new Mt(r.name,s,t.name,n);e.push(i)}}}_getOutputInfo(t){const e=this._getAttribute(t,"location")||this._getAttribute(t,"builtin");if(null!==e){const r=this._getTypeInfo(t,t.attributes),s=this._parseInt(e.value);return new Mt("",r,e.name,s)}return null}_getInputs(t,e=void 0){void 0===e&&(e=[]);for(const r of t)if(r.type instanceof D)this._getStructInputs(r.type,e);else{const t=this._getInputInfo(r);null!==t&&e.push(t)}return e}_getStructInputs(t,e){for(const r of t.members)if(r.type instanceof D)this._getStructInputs(r.type,e);else{const t=this._getInputInfo(r);null!==t&&e.push(t)}}_getInputInfo(t){const e=this._getAttribute(t,"location")||this._getAttribute(t,"builtin");if(null!==e){const r=this._getAttribute(t,"interpolation"),s=this._getTypeInfo(t.type,t.attributes),n=this._parseInt(e.value),i=new zt(t.name,s,e.name,n);return null!==r&&(i.interpolation=this._parseString(r.value)),i}return null}_parseString(t){return t instanceof Array&&(t=t[0]),t}_parseInt(t){t instanceof Array&&(t=t[0]);const e=parseInt(t);return isNaN(e)?t:e}_getAlias(t){for(const e of this.aliases)if(e.name==t)return e.type;return null}_getAliasInfo(t){return new Tt(t.name,this._getTypeInfo(t.type,null))}_getTypeInfo(t,e){if(this._types.has(t))return this._types.get(t);if(t instanceof W){const r=t,s=this._getTypeInfo(r.format,r.attributes),n=new vt(r.name,e);return n.format=s,n.count=r.count,this._types.set(t,n),this._updateTypeInfo(n),n}if(t instanceof D){const r=t,s=new bt(r.name,e);for(const t of r.members){const e=this._getTypeInfo(t.type,t.attributes);s.members.push(new xt(t.name,e,t.attributes))}return this._types.set(t,s),this._updateTypeInfo(s),s}if(t instanceof H){const r=t,s=r.format instanceof R,n=r.format?s?this._getTypeInfo(r.format,null):new kt(r.format,null):null,i=new At(r.name,n,e,r.access);return this._types.set(t,i),this._updateTypeInfo(i),i}if(t instanceof G){const r=t,s=r.format?this._getTypeInfo(r.format,null):null,n=new At(r.name,s,e,r.access);return this._types.set(t,n),this._updateTypeInfo(n),n}const r=new kt(t.name,e);return this._types.set(t,r),this._updateTypeInfo(r),r}_updateTypeInfo(t){var e,r;const s=this._getTypeSize(t);if(t.size=null!==(e=null==s?void 0:s.size)&&void 0!==e?e:0,t instanceof vt){const e=this._getTypeSize(t.format);t.stride=null!==(r=null==e?void 0:e.size)&&void 0!==r?r:0,this._updateTypeInfo(t.format)}t instanceof bt&&this._updateStructInfo(t)}_updateStructInfo(t){var e;let r=0,s=0,n=0,i=0;for(let a=0,o=t.members.length;a{const r=Lt(t,e.type,0);return[e.name,{typeDefinition:r,group:e.group,binding:e.binding,size:r.size}]})))}function Ut(t,e,r){return{fields:Object.fromEntries(e.members.map((e=>[e.name,{offset:e.offset,type:Lt(t,e.type,0)}]))),size:e.size,offset:r}}function Ot(t,e=""){if(!t)throw new Error(e)}function Lt(t,e,r){if(e.isArray){Ot(!e.isStruct,"struct array is invalid"),Ot(!e.isStruct,"template array is invalid");const s=e;return{size:s.size,elementType:Lt(t,s.format,r),numElements:s.count}}if(e.isStruct){Ot(!e.isTemplate,"template struct is invalid");return Ut(t,e,r)}{const t=e,r=e.isTemplate?`${t.name}<${t.format.name}>`:e.name;return{size:e.size,type:r}}}function Pt(t){return Array.isArray(t)||r(t)?[...t,1,1].slice(0,3):function(t){return[t.width,t.height||1,t.depthOrArrayLayers||1]}(t)}function Ct(t,e){const r=Pt(t),s=Math.max(...r.slice(0,"3d"===e?3:2));return 1+Math.log2(s)|0}Ft._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}},Ft._textureTypes=ft.any_texture_type.map((t=>t.name)),Ft._samplerTypes=ft.sampler_type.map((t=>t.name));const Bt=new WeakMap;function $t(t,e){let r=Bt.get(t);r||(r={pipelineByFormat:{},moduleByView:{}},Bt.set(t,r));let{sampler:s}=r;const{pipelineByFormat:n,moduleByView:i}=r,a=function(t){switch(t.dimension){case"1d":return"1d";case"3d":return"3d";default:return t.depthOrArrayLayers>1?"2d-array":"2d"}}(e);let o=i[a];o||(o=t.createShaderModule({label:`mip level generation for ${a}`,code:"\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n "}),i[a]=o),s||(s=t.createSampler({minFilter:"linear"}),r.sampler=s);const u=`${e.format}`;n[u]||(n[u]=t.createRenderPipeline({label:`mip level generator pipeline for ${a}`,layout:"auto",vertex:{module:o,entryPoint:"vs"},fragment:{module:o,entryPoint:"fs",targets:[{format:e.format}]}}));const c=n[u],l=t.createCommandEncoder({label:"mip gen encoder"});for(let r=1;r[[e,t],[r,t]])).flat());function Dt(t){return"indices"===t}function Gt(t,e){if(r(t))return t;let s=t;if(r(s.data))return s.data;(Array.isArray(t)||"number"==typeof t)&&(s={data:t});let n=s.type;return n||(n=Dt(e)?Uint32Array:Float32Array),new n(s.data)}const Yt=[{re:/coord|texture|uv/i,numComponents:2},{re:/color|colour/i,numComponents:4}];function Wt(t,e){const r=function(t){for(const{re:e,numComponents:r}of Yt)if(e.test(t))return r;return 3}(t);if(e%r>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${r} but ${e} values is not evenly divisible by ${r}. You should specify it.`);return r}const Ht=/(\w+)(?:x(\d))$/;function Xt(t){const e=Ht.exec(t),[r,s]=e?[e[1],parseInt(e[2])]:[t,1];return{Type:Rt.get(r),numComponents:s}}function Zt(t,e){return new(0,Object.getPrototypeOf(t).constructor)(e)}function Qt(t,e={}){const r=void 0===e.interleave||e.interleave,s=e.stepMode||"vertex",n=e.shaderLocation?Array.isArray(e.shaderLocation)?e.shaderLocation:[e.shaderLocation]:[0];let i=0;const a=[],o=[],u=[];return Object.keys(t).filter((t=>!Dt(t))).forEach((e=>{const c=t[e],l=Gt(c,e),h=function(t,e){return t.numComponents||Wt(e,function(t){return t.length?t:t.data}(t).length)}(c,e),_=h/4%1==0?4:h/3%1==0?3:4;for(let t=0;t1?`x${e}`:""}`,m=n.shift();0===n.length&&n.push(m+1),o.push({offset:r,format:d,shaderLocation:m}),u.push({data:l,offset:t,stride:h})}r||(a.push({stepMode:s,arrayStride:i,attributes:o.slice()}),i=0,o.length=0)})),o.length&&a.push({stepMode:s,arrayStride:i,attributes:o}),{bufferLayouts:a,typedArrays:u}}function Jt(t,e){return r(t)?{data:t,offset:0,stride:e}:t}function Kt(t,e,r,s){const n=new Map;t.forEach(((t,i)=>{const{offset:a,format:o}=t,{numComponents:u}=Xt(o),{data:c,offset:l,stride:h}=Jt(e[i],u),_=(t=>{const e=Object.getPrototypeOf(t).constructor,r=n.get(e);if(r)return r;const i=new e(s);return n.set(e,i),i})(c);for(let t=0;tMath.max(1,Math.floor(t/2**e))))}function ae(t,e,s,n){const i=function(t,e){if(r(t))return t;const{Type:s}=ne(e);return new s(t)}(s.data||s,e.format),a=ie(e,0),{bytesPerElement:o}=ne(e.format),u=n.origin||[0,0,0];t.queue.writeTexture({texture:e,origin:u},i,{bytesPerRow:o*a[0],rowsPerImage:a[1]},a)}function oe(t,e,r,s={}){r.forEach(((r,n)=>{const i=[0,0,n+(s.baseArrayLayer||0)];if(te(r))ae(t,e,r,{origin:i});else{const n=r,{flipY:a,premultipliedAlpha:o,colorSpace:u}=s;t.queue.copyExternalImageToTexture({source:n,flipY:a},{texture:e,premultipliedAlpha:o,colorSpace:u,origin:i},ue(n,s))}})),e.mipLevelCount>1&&$t(t,e)}function ue(t,e){if(t instanceof HTMLVideoElement)return[t.videoWidth,t.videoHeight,1];{const s=t,{width:n,height:i}=s;if(n>0&&i>0&&!te(t))return[n,i,1];const a=e.format||"rgba8unorm",{bytesPerElement:o,bytesPerChannel:u}=ne(a),c=r(t)||Array.isArray(t)?t:t.data;return function(t,e,r,s="2d"){if(r%1!=0)throw new Error("can't guess dimensions");if(t||e){if(e){if(!t&&(t=r/e)%1)throw new Error("can't guess dimensions")}else if((e=r/t)%1)throw new Error("can't guess dimensions")}else{const n=Math.sqrt(r/("cube"===s?6:1));n%1==0?(t=n,e=n):(t=r,e=1)}const n=r/t/e;if(n%1)throw new Error("can't guess dimensions");return[t,e,n]}(n,i,(r(c)?c.byteLength:c.length*u)/o)}}function ce(t,e,r={}){const s=ue(e[0],r);s[2]=s[2]>1?s[2]:e.length;const n=t.createTexture({dimension:ee(r.dimension),format:r.format||"rgba8unorm",mipLevelCount:r.mipLevelCount?r.mipLevelCount:r.mips?Ct(s):1,size:s,usage:(r.usage??0)|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return oe(t,n,e,r),n}async function le(t,e={}){const r=await fetch(t),s=await r.blob(),n={...e,...void 0!==e.colorSpaceConversion&&{colorSpaceConversion:"none"}};return await createImageBitmap(s,n)}async function he(t,e,r={}){return ce(t,await Promise.all(e.map((t=>le(t)))),r)}class _e{typedArray;cursor=0;numComponents;constructor(t,e){this.typedArray=t,this.numComponents=e}get numElements(){return this.typedArray.length/this.numComponents}push(...t){for(const e of t)if(Array.isArray(e)||r(e)){const e=t;this.typedArray.set(e,this.cursor),this.cursor+=e.length}else this.typedArray[this.cursor++]=e}reset(t=0){this.cursor=t}}function pe(t,e,r){return new _e(new r(t*e),t)}const de=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function me(t=1,e=0,r=1,s=24,n=1,i=!0,a=!0){if(s<3)throw new Error("radialSubdivisions must be 3 or greater");if(n<1)throw new Error("verticalSubdivisions must be 1 or greater");const o=(i?2:0)+(a?2:0),u=(s+1)*(n+1+o),c=pe(3,u,Float32Array),l=pe(3,u,Float32Array),h=pe(2,u,Float32Array),_=pe(3,s*(n+o/2)*2,Uint16Array),p=s+1,d=Math.atan2(t-e,r),m=Math.cos(d),f=Math.sin(d),y=n+(a?2:0);for(let a=i?-2:0;a<=y;++a){let i,o=a/n,u=r*o;a<0?(u=0,o=1,i=t):a>n?(u=r,o=1,i=e):i=t+a/n*(e-t),-2!==a&&a!==n+2||(i=0,o=0),u-=r/2;for(let t=0;tn?l.push(0,1,0):0===i?l.push(0,0,0):l.push(e*m,f,r*m),h.push(t/s,1-o)}}for(let t=0;t[t,e.typedArray])))},createCrescentVertices:function(t,e,r,s,n,i,a){if(n<=0)throw new Error("subdivisionDown must be > 0");const o=a-i,u=2*(n+1)*4,c=pe(3,u,Float32Array),l=pe(3,u,Float32Array),h=pe(2,u,Float32Array);function _(t,e,r){return t+(e-t)*r}function p(t,e){return t.map(((t,r)=>t+e[r]))}function d(t,e){return t.map(((t,r)=>t*e[r]))}function m(e,r,a,u,m,f){for(let y=0;y<=n;y++){const g=r/1,w=y/n,k=2*(g-.5),x=(i+w*o)*Math.PI,b=Math.sin(x),v=Math.cos(x),A=_(t,e,b),E=k*s,T=v*t,S=b*A;c.push(E,T,S);const z=p(d([0,b,v],a),u);l.push(z),h.push(g*m+f,w)}}for(let t=0;t<2;t++){const s=2*(t/1-.5);m(e,t,[1,1,1],[0,0,0],1,0),m(e,t,[0,0,0],[s,0,0],0,0),m(r,t,[1,1,1],[0,0,0],1,0),m(r,t,[0,0,0],[s,0,0],0,1)}const f=pe(3,2*n*4,Uint16Array);function y(t,e){for(let r=0;r0&&s!==e){const t=l+(s+1),e=l+s,r=l+s-_,n=l+(s+1)-_;c.push(t,e,r),c.push(t,r,n)}}l+=e+1}return{position:a.typedArray,normal:o.typedArray,texcoord:u.typedArray,indices:c.typedArray}},createPlaneVertices:function(t=1,e=1,r=1,s=1){const n=(r+1)*(s+1),i=pe(3,n,Float32Array),a=pe(3,n,Float32Array),o=pe(2,n,Float32Array);for(let n=0;n<=s;n++)for(let u=0;u<=r;u++){const c=u/r,l=n/s;i.push(t*c-.5*t,0,e*l-.5*e),a.push(0,1,0),o.push(c,l)}const u=r+1,c=pe(3,r*s*2,Uint16Array);for(let t=0;t 0");const o=n-s,u=a-i,c=(e+1)*(r+1),l=pe(3,c,Float32Array),h=pe(3,c,Float32Array),_=pe(2,c,Float32Array);for(let n=0;n<=r;n++)for(let a=0;a<=e;a++){const c=a/e,p=n/r,d=u*c+i,m=o*p+s,f=Math.sin(d),y=Math.cos(d),g=Math.sin(m),w=y*g,k=Math.cos(m),x=f*g;l.push(t*w,t*k,t*x),h.push(w,k,x),_.push(1-c,p)}const p=e+1,d=pe(3,e*r*2,Uint16Array);for(let t=0;tDt(t)));if(l){const e=Gt(l[1],"indices"),r=t.createBuffer({size:e.byteLength,usage:GPUBufferUsage.INDEX|s,mappedAtCreation:!0});Zt(e,r.getMappedRange()).set(e),r.unmap(),c.indexBuffer=r,c.indexFormat=e instanceof Uint16Array?"uint16":"uint32",c.numElements=e.length}return c},t.createTextureFromImage=async function(t,e,r={}){return he(t,[e],r)},t.createTextureFromImages=he,t.createTextureFromSource=function(t,e,r={}){return ce(t,[e],r)},t.createTextureFromSources=ce,t.generateMipmap=$t,t.getSizeForMipFromTexture=ie,t.getSizeFromSource=ue,t.interleaveVertexData=Kt,t.isTypedArray=r,t.loadImageBitmap=le,t.makeShaderDataDefinitions=function(t){const e=new Ft(t),r=Object.fromEntries(e.structs.map((t=>[t.name,Ut(e,t,0)]))),s=qt(e,e.uniforms);return{structs:r,storages:qt(e,e.storage),uniforms:s}},t.makeStructuredView=function(t,e,r=0){const s=t,n=u(void 0===s.group?t:s.typeDefinition,e,r);return{...n,set(t){c(t,n.views)}}},t.makeTypedArrayViews=u,t.normalizeGPUExtent3D=Pt,t.numMipLevels=Ct,t.primitives=ye,t.setStructuredValues=function(t,e,r,s=0){p(t.typeDefinition,e,r,s)},t.setStructuredView=c,t.setTypedValues=p,t.subarray=function(t,e,r){return t.subarray(e,e+r)}})); //# sourceMappingURL=webgpu-utils.min.js.map diff --git a/dist/0.x/webgpu-utils.min.js.map b/dist/0.x/webgpu-utils.min.js.map index 6ed20a1..9613653 100644 --- a/dist/0.x/webgpu-utils.min.js.map +++ b/dist/0.x/webgpu-utils.min.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created.\n *\n * To reset all types to the default call it with no arguments\n *\n * @param types array of types to make views for\n * @param flatten whether to flatten or expand the specified types.\n */\nexport function setIntrinsicsToView(types: readonly kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}\n","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type.\n * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray\n *\n * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not\n * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2.\n * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3.\n *\n * For attribute formats, guesses are made based on type and number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":["roundUpToMultipleOf","v","multiple","isTypedArray","arr","length","buffer","ArrayBuffer","byteLength","b","i32","numElements","align","size","type","View","Int32Array","u32","Uint32Array","f32","Float32Array","f16","Uint16Array","vec2f","vec2i","vec2u","vec2h","vec3i","vec3u","vec3f","vec3h","vec4i","vec4u","vec4f","vec4h","mat2x2f","mat2x2h","mat3x2f","mat3x2h","mat4x2f","mat4x2h","mat2x3f","pad","mat2x3h","mat3x3f","mat3x3h","mat4x3f","mat4x3h","mat2x4f","mat2x4h","mat3x4f","mat3x4h","mat4x4f","mat4x4h","bool","typeInfo","kTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","getSizeOfTypeDef","typeDef","asArrayDef","elementType","asStructDef","fields","asIntrinsicDef","makeIntrinsicTypedArrayView","baseOffset","isArray","undefined","sizeInBytes","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","makeTypedArrayViews","arrayBuffer","offset","makeViews","elementSize","effectiveNumElements","fn","i","Array","fill","map","_","views","name","entries","setStructuredView","data","view","dataLen","stride","set","asArray","forEach","newValue","ndx","asViews","key","s_views","WeakMap","getView","Ctor","viewsByCtor","get","Map","getViewsByCtor","setIntrinsicFromArrayLikeOfNumber","index","setTypedValues","isArrayLikeOfNumber","fieldDef","ParseContext","constructor","this","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","Statement","super","Function","args","returnType","body","StaticAssert","expression","While","condition","Continuing","For","init","increment","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","_a","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","Math","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","max","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","ConstExpr","initializer","_b","property","postfix","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","rule","TokenTypes","none","reserved","eof","token","asm","bf16","do","enum","f64","handle","i8","i16","i64","mat","premerge","regardless","typedef","u8","u16","u64","unless","using","vec","void","keywords","array","keyword","atomic","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","ptr","sampler","sampler_comparison","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_external","vec2","vec3","vec4","bitcast","block","break","case","continue","default","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","switch","true","alias","uniform","var","override","workgroup","write","r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm_srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm_srgb","rgb10a2unorm","rg11b10float","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","static_assert","tokens","decimal_float_literal","hex_float_literal","int_literal","uint_literal","ident","and","and_and","arrow","attr","attr_left","attr_right","forward_slash","bang","bracket_left","bracket_right","brace_left","brace_right","colon","comma","equal","equal_equal","not_equal","greater_than","greater_than_equal","shift_right","less_than","less_than_equal","shift_left","modulo","minus","minus_minus","period","plus","plus_plus","or","or_or","paren_left","paren_right","semicolon","star","tilde","underscore","xor","plus_equal","minus_equal","times_equal","division_equal","modulo_equal","and_equal","or_equal","xor_equal","shift_right_equal","shift_left_equal","storage_class","access_mode","sampler_type","sampled_texture_type","multisampled_texture_type","storage_texture_type","depth_texture_type","texture_external_type","any_texture_type","texel_format","const_literal","literal_or_ident","element_count_expression","template_types","attribute_name","assignment_operators","increment_operators","Token","lexeme","line","isTemplateType","indexOf","isArrayType","isArrayOrTemplateType","WgslScanner","source","_tokens","_start","_current","_line","_source","scanTokens","_isAtEnd","scanToken","push","_advance","_isWhitespace","_peekAhead","commentLevel","matchType","matchedType","_findType","nextLexeme","foundLessThan","ti","_addToken","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_context","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","scanner","_error","message","error","_peek","_check","l","_consume","tk","t","_previous","_type_alias","_enable_directive","attrs","_attribute","_var","_global_variable_decl","_override","_override_variable_decl","_let","_global_let_decl","_const","_global_const_decl","_struct","_struct_decl","_fn","_function_decl","argAttrs","typeAttrs","_type_decl","_return","_compound_statement","_statement","_if_statement","_switch_statement","_loop_statement","_for_statement","_while_statement","_continuing_statement","_static_assert_statement","result","_return_statement","_variable_statement","_increment_decrement_statement","_func_call_statement","_assignment_statement","_optional_paren_expression","_for_init","_short_circuit_or_expression","_for_increment","_variable_decl","savedPos","_unary_expression","decrement","isUnderscore","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","_c","_d","selectors","_shift_expression","nextStatement","_match_elseif","_elseif_statement","expr","_short_circuit_and_expr","_inclusive_or_expression","_exclusive_or_expression","_and_expression","_equality_expression","_relational_expression","_additive_expression","_multiplicative_expression","_singular_expression","_primary_expression","p","_postfix_expression","_getStruct","parseFloat","_paren_expression","arg","memberAttrs","memberName","memberType","structNode","_const_expression","_override_decl","valueExpr","constValue","aliasType","aliasNode","typeName","_texture_sampler_types","pointer","decl","countInt","parseInt","TypeInfo","isTemplate","MemberInfo","StructInfo","ArrayInfo","TemplateInfo","VariableInfo","group","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","WgslReflect","code","uniforms","textures","samplers","overrides","entry","_types","update","_isStorageTexture","ast","node","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_getInputs","_getOutputs","getBindGroups","groups","_makeRoom","u","_getStructOutputs","output","_getOutputInfo","m","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","_getAlias","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","arrayType","E","_textureTypes","_samplerTypes","defaultValue","k","getNamedVariables","reflect","variables","fromEntries","typeDefinition","addType","makeStructDefinition","structInfo","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","texture","perDeviceInfo","pipelineByFormat","moduleByView","getViewDimensionForTexture","module","createShaderModule","label","createSampler","minFilter","createRenderPipeline","layout","entryPoint","targets","pipeline","encoder","createCommandEncoder","baseMipLevel","mipLevelCount","baseArrayLayer","bindGroup","createBindGroup","getBindGroupLayout","resource","createView","arrayLayerCount","renderPassDescriptor","colorAttachments","loadOp","storeOp","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","queue","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","filter","arrayName","totalNumComponents","getArray","getNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","subarray","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","viewDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","layer","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","createTexture","mips","usage","GPUTextureUsage","TEXTURE_BINDING","COPY_DST","RENDER_ATTACHMENT","async","loadImageBitmap","url","res","fetch","blob","opt","colorSpaceConversion","createImageBitmap","createTextureFromImages","urls","Promise","all","TypedArrayWrapper","cursor","reset","createAugmentedTypedArray","CUBE_FACE_INDICES","createTruncatedConeVertices","bottomRadius","topRadius","radialSubdivisions","verticalSubdivisions","topCap","bottomCap","extra","numVertices","positions","normals","texcoords","indices","vertsAroundEdge","slant","cosSlant","sinSlant","yy","ringRadius","y","ii","position","normal","texcoord","expandRLEData","rleData","padding","runLength","element","jj","colors","numVerts","color","verticalRadius","outerRadius","innerRadius","thickness","subdivisionsDown","startOffset","endOffset","offsetRange","lerp","vAdd","vMultiply","createArc","arcRadius","x","normalMult","normalAdd","uMult","uAdd","z","uBack","xBack","angle","radius","px","py","pz","createSurface","leftArcOffset","rightArcOffset","numVerticesDown","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","divisions","stacks","stackPower","firstIndex","radiusSpan","pointsPerStack","stack","stackRadius","theta","d","subdivisionsWidth","subdivisionsDepth","numVertsAcross","subdivisionsAxis","subdivisionsHeight","startLatitudeInRadians","endLatitudeInRadians","startLongitudeInRadians","endLongitudeInRadians","latRange","longRange","phi","sinTheta","cosTheta","sinPhi","ux","uy","uz","numVertsAround","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","xOffset","yOffset","byteOffset","alignment","numBytes","buffers","bufferNdx","attribs","attrib0","data0","createBuffer","GPUBufferUsage","VERTEX","mappedAtCreation","getMappedRange","unmap","buffersAndAttributes","indicesEntry","find","indexBuffer","INDEX","indexFormat","storages","varDef","asVarDef"],"mappings":"mPAAO,MAAMA,EAAsB,CAACC,EAAWC,MAAwBD,EAAIC,EAAW,GAAKA,EAAY,GAAKA,ECkD/F,MAAAC,EAAgBC,GAC3BA,GAA6B,iBAAfA,EAAIC,QAAuBD,EAAIE,kBAAkBC,aAAyC,iBAAnBH,EAAII,WC3BrFC,EAAuC,CAC3CC,IAAK,CAAEC,YAAa,EAAGC,MAAO,EAAGC,KAAM,EAAGC,KAAM,MAAOC,KAAMC,YAC7DC,IAAK,CAAEN,YAAa,EAAGC,MAAO,EAAGC,KAAM,EAAGC,KAAM,MAAOC,KAAMG,aAC7DC,IAAK,CAAER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E,EACA5Q,EACAgV,EAAgC,CAAA,GAClC,OAAO8D,GAAyBlI,EAAQ,CAAC5Q,GAASgV,EACpD,gNHpLM,SAAoCvK,GACtC,MAAM2E,EAAU,IAAI5E,GAAYC,GAE1Bpf,EAAUxE,OAAOyoB,YAAYF,EAAQ/jB,QAAQnC,KAAIwmB,GAC5C,CAACA,EAAWrmB,KAAMomB,GAAqBL,EAASM,EAAY,OAGjEhF,EAAWyE,GAAkBC,EAASA,EAAQ1E,UAGpD,MAAO,CACHrf,UACA43B,SAJa9T,GAAkBC,EAASA,EAAQxiB,SAKhD8d,WAER,uBF6RM,SAA6BwY,EAA+Cz6B,EAA2BC,EAAS,GAClH,MAAMy6B,EAAWD,EAEX95B,EAAQZ,OADqBN,IAAnBi7B,EAAS/Z,MAAsB8Z,EAA6BC,EAAS5T,eAC1C9mB,EAAaC,GACxD,MAAO,IACAU,EACH,GAAAQ,CAAIJ,GACAD,EAAkBC,EAAMJ,EAAMA,MACjC,EAET,oIAyFM,SAA8B85B,EAA4B15B,EAAWf,EAA0BC,EAAS,GAC1GmC,EAAeq4B,EAAO3T,eAAgB/lB,EAAMf,EAAaC,EAC7D,+DDze+CnF,EAAiBmF,EAAgBlF,GAC9E,OAAOD,EAAImzB,SAAShuB,EAAQA,EAASlF,EACvC","x_google_ignoreList":[3]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n pad?: number[];\n};\n\nconst b: Record = {\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\nconst typeInfo: Record = {\n ...b,\n\n 'vec2': b.vec2f,\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\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};\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\nfunction range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType)) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array. Use a TypedArray or a FullArraySpec to choose a different type.\n * The 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 guess. 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 at number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":["roundUpToMultipleOf","v","multiple","isTypedArray","arr","length","buffer","ArrayBuffer","byteLength","b","i32","numElements","align","size","type","View","Int32Array","u32","Uint32Array","f32","Float32Array","f16","Uint16Array","vec2f","vec2i","vec2u","vec2h","vec3i","vec3u","vec3f","vec3h","vec4i","vec4u","vec4f","vec4h","mat2x2f","mat2x2h","mat3x2f","mat3x2h","mat4x2f","mat4x2h","mat2x3f","pad","mat2x3h","mat3x3f","mat3x3h","mat4x3f","mat4x3h","mat2x4f","mat2x4h","mat3x4f","mat3x4h","mat4x4f","mat4x4h","typeInfo","getSizeOfTypeDef","typeDef","asArrayDef","elementType","asStructDef","fields","asIntrinsicDef","makeIntrinsicTypedArrayView","baseOffset","isArray","undefined","sizeInBytes","baseNumElements","BYTES_PER_ELEMENT","Error","isIntrinsic","makeTypedArrayViews","arrayBuffer","offset","makeViews","elementSize","effectiveNumElements","fn","i","Array","fill","map","_","views","name","Object","entries","setStructuredView","data","view","dataLen","stride","set","asArray","forEach","newValue","ndx","asViews","key","s_views","WeakMap","getView","Ctor","viewsByCtor","get","Map","getViewsByCtor","setIntrinsicFromArrayLikeOfNumber","index","setTypedValues","isArrayLikeOfNumber","fieldDef","ParseContext","constructor","this","constants","aliases","structs","Node","isAstNode","astNodeType","evaluate","context","evaluateString","toString","Statement","super","Function","args","returnType","body","StaticAssert","expression","While","condition","Continuing","For","init","increment","Var","storage","access","value","Override","Let","Const","IncrementOperator","AssignOperator","_a","TokenClass","ResourceType","parse","val","Increment","operator","variable","Assign","Call","Loop","continuing","Switch","If","elseif","_else","else","Return","Enable","Alias","Discard","Break","Continue","Type","isStruct","Struct","members","getMemberIndex","TemplateType","format","PointerType","ArrayType","attributes","count","SamplerType","Expression","StringExpr","CreateExpr","CallExpr","Math","abs","acos","acosh","asin","asinh","atan","atan2","atanh","ceil","min","max","cos","PI","sqrt","pow","exp","floor","log","log2","round","sign","sin","sinh","tan","tanh","trunc","VariableExpr","ConstExpr","initializer","_b","property","postfix","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","rule","TokenTypes","none","reserved","eof","token","asm","bf16","do","enum","f64","handle","i8","i16","i64","mat","premerge","regardless","typedef","u8","u16","u64","unless","using","vec","void","keywords","array","keyword","atomic","bool","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","ptr","sampler","sampler_comparison","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_external","vec2","vec3","vec4","bitcast","block","break","case","continue","default","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","switch","true","alias","uniform","var","override","workgroup","write","r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm_srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm_srgb","rgb10a2unorm","rg11b10float","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","static_assert","tokens","decimal_float_literal","hex_float_literal","int_literal","uint_literal","ident","and","and_and","arrow","attr","attr_left","attr_right","forward_slash","bang","bracket_left","bracket_right","brace_left","brace_right","colon","comma","equal","equal_equal","not_equal","greater_than","greater_than_equal","shift_right","less_than","less_than_equal","shift_left","modulo","minus","minus_minus","period","plus","plus_plus","or","or_or","paren_left","paren_right","semicolon","star","tilde","underscore","xor","plus_equal","minus_equal","times_equal","division_equal","modulo_equal","and_equal","or_equal","xor_equal","shift_right_equal","shift_left_equal","storage_class","access_mode","sampler_type","sampled_texture_type","multisampled_texture_type","storage_texture_type","depth_texture_type","texture_external_type","any_texture_type","texel_format","const_literal","literal_or_ident","element_count_expression","template_types","attribute_name","assignment_operators","increment_operators","Token","lexeme","line","isTemplateType","indexOf","isArrayType","isArrayOrTemplateType","WgslScanner","source","_tokens","_start","_current","_line","_source","scanTokens","_isAtEnd","scanToken","push","_advance","_isWhitespace","_peekAhead","commentLevel","matchType","matchedType","_findType","nextLexeme","foundLessThan","ti","_addToken","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_context","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","scanner","_error","message","error","_peek","types","_check","l","_consume","tk","t","_previous","_type_alias","_enable_directive","attrs","_attribute","_var","_global_variable_decl","_override","_override_variable_decl","_let","_global_let_decl","_const","_global_const_decl","_struct","_struct_decl","_fn","_function_decl","argAttrs","typeAttrs","_type_decl","_return","_compound_statement","_statement","_if_statement","_switch_statement","_loop_statement","_for_statement","_while_statement","_continuing_statement","_static_assert_statement","result","_return_statement","_variable_statement","_increment_decrement_statement","_func_call_statement","_assignment_statement","_optional_paren_expression","_for_init","_short_circuit_or_expression","_for_increment","_variable_decl","savedPos","_unary_expression","decrement","isUnderscore","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","_c","_d","selectors","_shift_expression","nextStatement","_match_elseif","_elseif_statement","expr","_short_circuit_and_expr","_inclusive_or_expression","_exclusive_or_expression","_and_expression","_equality_expression","_relational_expression","_additive_expression","_multiplicative_expression","_singular_expression","_primary_expression","p","_postfix_expression","_getStruct","has","parseFloat","_paren_expression","arg","memberAttrs","memberName","memberType","structNode","_const_expression","_override_decl","valueExpr","constValue","aliasType","aliasNode","typeName","_texture_sampler_types","pointer","decl","countInt","parseInt","TypeInfo","isTemplate","MemberInfo","StructInfo","ArrayInfo","TemplateInfo","VariableInfo","group","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","WgslReflect","code","uniforms","textures","samplers","overrides","entry","_types","update","_isStorageTexture","ast","node","info","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_getInputs","_getOutputs","getBindGroups","groups","_makeRoom","u","_getStructOutputs","output","_getOutputInfo","m","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","_getAlias","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","arrayType","E","_textureTypes","_samplerTypes","obj","defaultValue","k","getNamedVariables","reflect","variables","fromEntries","typeDefinition","addType","makeStructDefinition","structInfo","assert","cond","msg","arrayInfo","asTemplateInfo","normalizeGPUExtent3D","slice","width","height","depthOrArrayLayers","normalizeGPUExtent3Dict","numMipLevels","dimension","sizes","maxSize","byDevice","generateMipmap","device","texture","perDeviceInfo","pipelineByFormat","moduleByView","getViewDimensionForTexture","module","createShaderModule","label","createSampler","minFilter","createRenderPipeline","layout","entryPoint","targets","pipeline","encoder","createCommandEncoder","baseMipLevel","mipLevelCount","baseArrayLayer","bindGroup","createBindGroup","getBindGroupLayout","resource","createView","arrayLayerCount","renderPassDescriptor","colorAttachments","loadOp","storeOp","pass","beginRenderPass","setPipeline","setBindGroup","draw","end","commandBuffer","finish","queue","submit","kTypedArrayToAttribFormat","Int8Array","formats","defaultForType","Uint8Array","Int16Array","kVertexFormatPrefixToType","s1","s2","flat","isIndices","makeTypedArrayFromArrayUnion","asFullSpec","kNameToNumComponents","re","numComponents","guessNumComponentsFromName","test","guessNumComponentsFromNameImpl","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","keys","filter","arrayName","totalNumComponents","getArray","getNumComponents","step","component","normalize","shift","arrayStride","getTypedArrayWithOffsetAndStride","ta","interleaveVertexData","attribute","srcOffset","newView","dstOffset","srcOff","subarray","isTextureRawDataSource","src","isTextureData","textureViewDimensionToDimension","viewDimension","kFormatToTypedArray","kTextureFormatRE","getTextureFormatInfo","channels","bits","numChannels","bytesPerChannel","bytesPerElement","getSizeForMipFromTexture","mipLevel","uploadDataToTexture","toTypedArray","origin","writeTexture","bytesPerRow","rowsPerImage","copySourcesToTexture","sources","layer","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","createTexture","mips","usage","GPUTextureUsage","TEXTURE_BINDING","COPY_DST","RENDER_ATTACHMENT","async","loadImageBitmap","url","res","fetch","blob","opt","colorSpaceConversion","createImageBitmap","createTextureFromImages","urls","Promise","all","TypedArrayWrapper","cursor","reset","createAugmentedTypedArray","CUBE_FACE_INDICES","createTruncatedConeVertices","bottomRadius","topRadius","radialSubdivisions","verticalSubdivisions","topCap","bottomCap","extra","numVertices","positions","normals","texcoords","indices","vertsAroundEdge","slant","cosSlant","sinSlant","yy","ringRadius","y","ii","position","normal","texcoord","expandRLEData","rleData","padding","runLength","element","jj","colors","numVerts","color","verticalRadius","outerRadius","innerRadius","thickness","subdivisionsDown","startOffset","endOffset","offsetRange","lerp","vAdd","vMultiply","createArc","arcRadius","x","normalMult","normalAdd","uMult","uAdd","z","uBack","xBack","angle","radius","px","py","pz","createSurface","leftArcOffset","rightArcOffset","numVerticesDown","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","divisions","stacks","stackPower","firstIndex","radiusSpan","pointsPerStack","stack","stackRadius","theta","d","subdivisionsWidth","subdivisionsDepth","numVertsAcross","subdivisionsAxis","subdivisionsHeight","startLatitudeInRadians","endLatitudeInRadians","startLongitudeInRadians","endLongitudeInRadians","latRange","longRange","phi","sinTheta","cosTheta","sinPhi","ux","uy","uz","numVertsAround","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","xOffset","yOffset","byteOffset","alignment","numBytes","buffers","bufferNdx","attribs","attrib0","data0","createBuffer","GPUBufferUsage","VERTEX","mappedAtCreation","getMappedRange","unmap","buffersAndAttributes","indicesEntry","find","indexBuffer","INDEX","indexFormat","storages","varDef","asVarDef"],"mappings":"mPAAO,MAAMA,EAAsB,CAACC,EAAWC,MAAwBD,EAAIC,EAAW,GAAKA,EAAY,GAAKA,ECkD/F,MAAAC,EAAgBC,GAC3BA,GAA6B,iBAAfA,EAAIC,QAAuBD,EAAIE,kBAAkBC,aAAyC,iBAAnBH,EAAII,WC5BrFC,EAA6B,CACjCC,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,MAAOC,KAAMC,YACjEY,MAAO,CAAEjB,YAAa,EAAGC,MAAO,GAAIC,KAAM,GAAIC,KAAM,MAAOC,KAA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AazE,EAA0C,CAAA,GACrH,OAAOgF,GAAwBpJ,EAAQ,CAAC6I,GAAMzE,EAChD,yDAnEM,SACFpE,EACAhR,EACAoV,EAAgC,CAAA,GAClC,OAAO+D,GAAyBnI,EAAQ,CAAChR,GAASoV,EACpD,qMHpLM,SAAoCzK,GACtC,MAAM6E,EAAU,IAAI9E,GAAYC,GAE1Bvf,EAAUhC,OAAOsmB,YAAYF,EAAQpkB,QAAQpC,KAAI8mB,GAC5C,CAACA,EAAW3mB,KAAM0mB,GAAqBL,EAASM,EAAY,OAGjElF,EAAW2E,GAAkBC,EAASA,EAAQ5E,UAGpD,MAAO,CACHxf,UACAk4B,SAJa/T,GAAkBC,EAASA,EAAQ7iB,SAKhDie,WAER,uBFuOM,SAA6B2Y,EAA+Ch7B,EAA2BC,EAAS,GAClH,MAAMg7B,EAAWD,EAEXr6B,EAAQZ,OADqBN,IAAnBw7B,EAASla,MAAsBia,EAA6BC,EAAS7T,eAC1CpnB,EAAaC,GACxD,MAAO,IACAU,EACH,GAAAS,CAAIJ,GACAD,EAAkBC,EAAML,EAAMA,MACjC,EAET,4GAyFM,SAA8Bq6B,EAA4Bh6B,EAAWhB,EAA0BC,EAAS,GAC1GoC,EAAe24B,EAAO5T,eAAgBpmB,EAAMhB,EAAaC,EAC7D,+DDnb+CrE,EAAiBqE,EAAgBpE,GAC9E,OAAOD,EAAI4yB,SAASvuB,EAAQA,EAASpE,EACvC","x_google_ignoreList":[3]} \ No newline at end of file diff --git a/dist/0.x/webgpu-utils.module.js b/dist/0.x/webgpu-utils.module.js index bf82328..b05d5d1 100644 --- a/dist/0.x/webgpu-utils.module.js +++ b/dist/0.x/webgpu-utils.module.js @@ -1,11 +1,5 @@ -/* webgpu-utils@0.15.0, license MIT */ +/* webgpu-utils@0.14.1, license MIT */ const roundUpToMultipleOf = (v, multiple) => (((v + multiple - 1) / multiple) | 0) * multiple; -function keysOf(obj) { - return Object.keys(obj); -} -function range(count, fn) { - return new Array(count).fill(0).map((_, i) => fn(i)); -} class TypedArrayViewGenerator { arrayBuffer; @@ -68,16 +62,12 @@ const b = { mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array }, mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array }, mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array }, - // Note: At least as of WGSL V1 you can not create a bool for uniform or storage. - // You can only create one in an internal struct. But, this code generates - // views of structs and it needs to not fail if the struct has a bool - bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array }, }; const typeInfo = { ...b, - 'vec2': b.vec2i, - 'vec2': b.vec2u, - 'vec2': b.vec2f, + 'vec2': b.vec2f, + 'vec2': b.vec2i, + 'vec2': b.vec2u, 'vec2': b.vec2h, 'vec3': b.vec3i, 'vec3': b.vec3u, @@ -106,56 +96,6 @@ const typeInfo = { 'mat4x4': b.mat4x4f, 'mat4x4': b.mat4x4h, }; -const kTypes = keysOf(typeInfo); -/** - * Set which intrinsic types to make views for. - * - * Example: - * - * Given a an array of intrinsics like this - * `array` - * - * The default is to create a single `Float32Array(4 * 200)` - * because creating 200 `Float32Array` views is not usually - * what you want. - * - * If you do want individual views then you'd call - * `setIntrinsicsToView(['vec3f`])` and now you get - * an array of 200 `Float32Array`s. - * - * Note: `setIntrinsicsToView` always sets ALL types. The list you - * pass it is the types you want views created for, all other types - * will be reset to do the default. In other words - * - * ```js - * setIntrinsicsToView(['vec3f`]) - * setIntrinsicsToView(['vec2f`]) - * ``` - * - * Only `vec2f` will have views created. `vec3f` has been reset to the default by - * the second call - * - * You can pass in `true` as the 2nd parameter to make it set which types - * to flatten and all others will be set to have views created. - * - * To reset all types to the default call it with no arguments - * - * @param types array of types to make views for - * @param flatten whether to flatten or expand the specified types. - */ -function setIntrinsicsToView(types = [], flatten) { - // we need to track what we've viewed because for example `vec3f` references - // the same info as `vec3` so we'd set one and reset the other. - const visited = new Set(); - for (const type of kTypes) { - const info = typeInfo[type]; - if (!visited.has(info)) { - visited.add(info); - info.flatten = types.includes(type) ? flatten : !flatten; - } - } -} -setIntrinsicsToView(); // This needs to be fixed! 😱 function getSizeOfTypeDef(typeDef) { const asArrayDef = typeDef; @@ -187,6 +127,9 @@ function getSizeOfTypeDef(typeDef) { } } } +function range(count, fn) { + return new Array(count).fill(0).map((_, i) => fn(i)); +} // If numElements is undefined this is NOT an array. If it is defined then it IS an array // Sizes for arrays are different than sizes for non-arrays. Example // a vec3f non array is Float32Array(3) @@ -266,7 +209,7 @@ function makeTypedArrayViews(typeDef, arrayBuffer, offset) { // On the other hand, if we have `array` the maybe we do want // 10 `Float32Array(16)` views since you might want to do // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`; - if (isIntrinsic(elementType) && typeInfo[elementType.type].flatten) { + if (isIntrinsic(elementType)) { return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements); } else { @@ -5836,5 +5779,5 @@ var primitives = /*#__PURE__*/Object.freeze({ createXYQuadVertices: createXYQuadVertices }); -export { TypedArrayViewGenerator, copySourceToTexture, copySourcesToTexture, createBufferLayoutsFromArrays, createBuffersAndAttributesFromArrays, createTextureFromImage, createTextureFromImages, createTextureFromSource, createTextureFromSources, generateMipmap, getSizeForMipFromTexture, getSizeFromSource, interleaveVertexData, isTypedArray, kTypes, loadImageBitmap, makeShaderDataDefinitions, makeStructuredView, makeTypedArrayViews, normalizeGPUExtent3D, numMipLevels, primitives, setIntrinsicsToView, setStructuredValues, setStructuredView, setTypedValues, subarray }; +export { TypedArrayViewGenerator, copySourceToTexture, copySourcesToTexture, createBufferLayoutsFromArrays, createBuffersAndAttributesFromArrays, createTextureFromImage, createTextureFromImages, createTextureFromSource, createTextureFromSources, generateMipmap, getSizeForMipFromTexture, getSizeFromSource, interleaveVertexData, isTypedArray, loadImageBitmap, makeShaderDataDefinitions, makeStructuredView, makeTypedArrayViews, normalizeGPUExtent3D, numMipLevels, primitives, setStructuredValues, setStructuredView, setTypedValues, subarray }; //# sourceMappingURL=webgpu-utils.module.js.map diff --git a/dist/0.x/webgpu-utils.module.js.map b/dist/0.x/webgpu-utils.module.js.map index 7340cf3..734dd78 100644 --- a/dist/0.x/webgpu-utils.module.js.map +++ b/dist/0.x/webgpu-utils.module.js.map @@ -1 +1 @@ -{"version":3,"file":"webgpu-utils.module.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created.\n *\n * To reset all types to the default call it with no arguments\n *\n * @param types array of types to make views for\n * @param flatten whether to flatten or expand the specified types.\n */\nexport function setIntrinsicsToView(types: readonly kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}\n","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type.\n * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray\n *\n * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not\n * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2.\n * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3.\n *\n * For attribute formats, guesses are made based on type and number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";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;;MCgBa,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,KAAK,CAAC,SAAiB,EAAA;QACnB,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KACrE;AACD,IAAA,GAAG,CAAC,QAAgB,EAAA;AAChB,QAAA,IAAI,CA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U,IAAI,SAAS,GAAG,CAAC,CAAC;AAC7B,KAAA;IAED,OAAO;QACL,QAAQ,EAAE,SAAS,CAAC,UAAU;QAC9B,MAAM,EAAE,OAAO,CAAC,UAAU;QAC1B,QAAQ,EAAE,SAAS,CAAC,UAAU;QAC9B,OAAO,EAAE,OAAO,CAAC,UAAU;KAC5B,CAAC;AACJ;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[3]} \ No newline at end of file +{"version":3,"file":"webgpu-utils.module.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n pad?: number[];\n};\n\nconst b: Record = {\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\nconst typeInfo: Record = {\n ...b,\n\n 'vec2': b.vec2f,\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\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};\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\nfunction range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType)) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const elementSize = getSizeOfTypeDef(elementType);\n const effectiveNumElements = asArrayDef.numElements === 0\n ? (buffer.byteLength - baseOffset) / elementSize\n : asArrayDef.numElements;\n return range(effectiveNumElements, i => makeViews(elementType, baseOffset + elementSize * i)) as Views[];\n }\n } else if (typeof typeDef === 'string') {\n throw Error('unreachable');\n } else {\n const fields = (typeDef as StructDefinition).fields;\n if (fields) {\n const views: Views = {};\n for (const [name, {type, offset}] of Object.entries(fields)) {\n views[name] = makeViews(type, baseOffset + offset);\n }\n return views;\n } else {\n return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset);\n }\n }\n };\n return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer };\n}\n\n/**\n * Given a set of TypeArrayViews and matching JavaScript data\n * sets the content of the views.\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n *\n * setStructuredViews({\n * direction: [1, 2, 3],\n * strength: 45,\n * matrix: [\n * 1, 0, 0, 0,\n * 0, 1, 0, 0,\n * 0, 0, 1, 0,\n * 0, 0, 0, 1,\n * ],\n * });\n * ```\n *\n * The code above will set the various views, which all point to different\n * locations within the same array buffer.\n *\n * See @link {makeTypedArrayViews}.\n *\n * @param data The new values\n * @param views TypedArray views as returned from {@link makeTypedArrayViews}\n */\nexport function setStructuredView(data: any, views: TypedArrayOrViews): void {\n if (data === undefined) {\n return;\n } else if (isTypedArray(views)) {\n const view = views as TypedArray;\n if (view.length === 1 && typeof data === 'number') {\n view[0] = data;\n } else {\n if (Array.isArray(data[0]) || isTypedArray(data[0])) {\n // complete hack!\n // there's no type data here so let's guess based on the user's data\n const dataLen = data[0].length;\n const stride = dataLen === 3 ? 4 : dataLen;\n for (let i = 0; i < data.length; ++i) {\n const offset = i * stride;\n view.set(data[i], offset);\n }\n } else {\n view.set(data as number[]);\n }\n }\n } else if (Array.isArray(views)) {\n const asArray = views as Views[];\n (data as any[]).forEach((newValue, ndx) => {\n setStructuredView(newValue, asArray[ndx]);\n });\n } else {\n const asViews = views as Views;\n for (const [key, newValue] of Object.entries(data)) {\n const view = asViews[key];\n if (view) {\n setStructuredView(newValue, view);\n }\n }\n }\n}\n\nexport type StructuredView = ArrayBufferViews & {\n /**\n * Sets the contents of the TypedArrays based on the data passed in\n * Note: The data may be sparse\n *\n * example:\n *\n * ```js\n * const code = `\n * struct HSL {\n * hue: f32,\n * sat: f32,\n * lum: f32,\n * };\n * struct MyUniforms {\n * colors: array,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * colors: [\n * ,\n * ,\n * { hue: 0.5, sat: 1.0, lum: 0.5 }, // only set the 3rd color\n * ],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * ```\n *\n * @param data\n */\n set(data: any): void;\n}\n\n/**\n * Given a VariableDefinition, create matching TypedArray views\n * @param varDef A VariableDefinition as returned from {@link makeShaderDataDefinitions}\n * @param arrayBuffer Optional ArrayBuffer for the views\n * @param offset Optional offset into the ArrayBuffer for the views\n * @returns TypedArray views for the various named fields of the structure as well\n * as a `set` function to make them easy to set, and the arrayBuffer\n */\nexport function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView {\n const asVarDef = varDef as VariableDefinition;\n const typeDef = asVarDef.group === undefined ? varDef as StructDefinition : asVarDef.typeDefinition;\n const views = makeTypedArrayViews(typeDef, arrayBuffer, offset);\n return {\n ...views,\n set(data: any) {\n setStructuredView(data, views.views);\n },\n };\n}\n\ntype ViewsByCtor = Map;\nconst s_views = new WeakMap();\n\nfunction getViewsByCtor(arrayBuffer: ArrayBuffer): ViewsByCtor {\n let viewsByCtor = s_views.get(arrayBuffer);\n if (!viewsByCtor) {\n viewsByCtor = new Map();\n s_views.set(arrayBuffer, viewsByCtor);\n }\n return viewsByCtor;\n}\n\nfunction getView(arrayBuffer: ArrayBuffer, Ctor: TypedArrayConstructor): T {\n const viewsByCtor = getViewsByCtor(arrayBuffer);\n let view = viewsByCtor.get(Ctor);\n if (!view) {\n view = new Ctor(arrayBuffer);\n viewsByCtor.set(Ctor, view);\n }\n return view as T;\n}\n\n// Is this something like [1,2,3]?\nfunction isArrayLikeOfNumber(data: any) {\n return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number';\n}\n\nfunction setIntrinsicFromArrayLikeOfNumber(typeDef: IntrinsicDefinition, data: any, arrayBuffer: ArrayBuffer, offset: number) {\n const asIntrinsicDefinition = typeDef as IntrinsicDefinition;\n const type = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param typeDef A variable definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset);\n}","class ParseContext {\n constructor() {\n this.constants = new Map();\n this.aliases = new Map();\n this.structs = new Map();\n }\n}\n/**\n * @class Node\n * @category AST\n * Base class for AST nodes parsed from a WGSL shader.\n */\nclass Node {\n constructor() { }\n get isAstNode() {\n return true;\n }\n get astNodeType() {\n return \"\";\n }\n evaluate(context) {\n throw new Error(\"Cannot evaluate node\");\n }\n evaluateString(context) {\n return this.evaluate(context).toString();\n }\n}\n/**\n * @class Statement\n * @extends Node\n * @category AST\n */\nclass Statement extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Function\n * @extends Statement\n * @category AST\n */\nclass Function extends Statement {\n constructor(name, args, returnType, body) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n}\n/**\n * @class StaticAssert\n * @extends Statement\n * @category AST\n */\nclass StaticAssert extends Statement {\n constructor(expression) {\n super();\n this.expression = expression;\n }\n get astNodeType() {\n return \"staticAssert\";\n }\n}\n/**\n * @class While\n * @extends Statement\n * @category AST\n */\nclass While extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"while\";\n }\n}\n/**\n * @class Continuing\n * @extends Statement\n * @category AST\n */\nclass Continuing extends Statement {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"continuing\";\n }\n}\n/**\n * @class For\n * @extends Statement\n * @category AST\n */\nclass For extends Statement {\n constructor(init, condition, increment, body) {\n super();\n this.init = init;\n this.condition = condition;\n this.increment = increment;\n this.body = body;\n }\n get astNodeType() {\n return \"for\";\n }\n}\n/**\n * @class Var\n * @extends Statement\n * @category AST\n */\nclass Var extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"var\";\n }\n}\n/**\n * @class Override\n * @extends Statement\n * @category AST\n */\nclass Override extends Statement {\n constructor(name, type, value) {\n super();\n this.name = name;\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"override\";\n }\n}\n/**\n * @class Let\n * @extends Statement\n * @category AST\n */\nclass Let extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"let\";\n }\n}\n/**\n * @class Const\n * @extends Statement\n * @category AST\n */\nclass Const extends Statement {\n constructor(name, type, storage, access, value) {\n super();\n this.name = name;\n this.type = type;\n this.storage = storage;\n this.access = access;\n this.value = value;\n }\n get astNodeType() {\n return \"const\";\n }\n evaluate(context) {\n return this.value.evaluate(context);\n }\n}\nvar IncrementOperator;\n(function (IncrementOperator) {\n IncrementOperator[\"increment\"] = \"++\";\n IncrementOperator[\"decrement\"] = \"--\";\n})(IncrementOperator || (IncrementOperator = {}));\n(function (IncrementOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for IncrementOperator\");\n return IncrementOperator[key];\n }\n IncrementOperator.parse = parse;\n})(IncrementOperator || (IncrementOperator = {}));\n/**\n * @class Increment\n * @extends Statement\n * @category AST\n */\nclass Increment extends Statement {\n constructor(operator, variable) {\n super();\n this.operator = operator;\n this.variable = variable;\n }\n get astNodeType() {\n return \"increment\";\n }\n}\nvar AssignOperator;\n(function (AssignOperator) {\n AssignOperator[\"assign\"] = \"=\";\n AssignOperator[\"addAssign\"] = \"+=\";\n AssignOperator[\"subtractAssin\"] = \"-=\";\n AssignOperator[\"multiplyAssign\"] = \"*=\";\n AssignOperator[\"divideAssign\"] = \"/=\";\n AssignOperator[\"moduloAssign\"] = \"%=\";\n AssignOperator[\"andAssign\"] = \"&=\";\n AssignOperator[\"orAssign\"] = \"|=\";\n AssignOperator[\"xorAssign\"] = \"^=\";\n AssignOperator[\"shiftLeftAssign\"] = \"<<=\";\n AssignOperator[\"shiftRightAssign\"] = \">>=\";\n})(AssignOperator || (AssignOperator = {}));\n(function (AssignOperator) {\n function parse(val) {\n const key = val;\n if (key == \"parse\")\n throw new Error(\"Invalid value for AssignOperator\");\n return AssignOperator[key];\n }\n AssignOperator.parse = parse;\n})(AssignOperator || (AssignOperator = {}));\n/**\n * @class Assign\n * @extends Statement\n * @category AST\n */\nclass Assign extends Statement {\n constructor(operator, variable, value) {\n super();\n this.operator = operator;\n this.variable = variable;\n this.value = value;\n }\n get astNodeType() {\n return \"assign\";\n }\n}\n/**\n * @class Call\n * @extends Statement\n * @category AST\n */\nclass Call extends Statement {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"call\";\n }\n}\n/**\n * @class Loop\n * @extends Statement\n * @category AST\n */\nclass Loop extends Statement {\n constructor(body, continuing) {\n super();\n this.body = body;\n this.continuing = continuing;\n }\n get astNodeType() {\n return \"loop\";\n }\n}\n/**\n * @class Switch\n * @extends Statement\n * @category AST\n */\nclass Switch extends Statement {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"body\";\n }\n}\n/**\n * @class If\n * @extends Statement\n * @category AST\n */\nclass If extends Statement {\n constructor(condition, body, elseif, _else) {\n super();\n this.condition = condition;\n this.body = body;\n this.elseif = elseif;\n this.else = _else;\n }\n get astNodeType() {\n return \"if\";\n }\n}\n/**\n * @class Return\n * @extends Statement\n * @category AST\n */\nclass Return extends Statement {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"return\";\n }\n}\n/**\n * @class Enable\n * @extends Statement\n * @category AST\n */\nclass Enable extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"enable\";\n }\n}\n/**\n * @class Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n}\n/**\n * @class VariableExpr\n * @extends Expression\n * @category AST\n */\nclass VariableExpr extends Expression {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"varExpr\";\n }\n}\n/**\n * @class ConstExpr\n * @extends Expression\n * @category AST\n */\nclass ConstExpr extends Expression {\n constructor(name, initializer) {\n super();\n this.name = name;\n this.initializer = initializer;\n }\n get astNodeType() {\n return \"constExpr\";\n }\n evaluate(context) {\n var _a, _b;\n if (this.initializer instanceof CreateExpr) {\n // This is a struct constant\n const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context);\n const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name;\n const struct = context.structs.get(type);\n const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property);\n if (memberIndex != -1) {\n const value = this.initializer.args[memberIndex].evaluate(context);\n return value;\n }\n console.log(memberIndex);\n }\n return this.initializer.evaluate(context);\n }\n}\n/**\n * @class LiteralExpr\n * @extends Expression\n * @category AST\n */\nclass LiteralExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"literalExpr\";\n }\n evaluate() {\n return this.value;\n }\n}\n/**\n * @class BitcastExpr\n * @extends Expression\n * @category AST\n */\nclass BitcastExpr extends Expression {\n constructor(type, value) {\n super();\n this.type = type;\n this.value = value;\n }\n get astNodeType() {\n return \"bitcastExpr\";\n }\n}\n/**\n * @class TypecastExpr\n * @extends Expression\n * @category AST\n */\nclass TypecastExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"typecastExpr\";\n }\n evaluate(context) {\n return this.args[0].evaluate(context);\n }\n}\n/**\n * @class GroupingExpr\n * @extends Expression\n * @category AST\n */\nclass GroupingExpr extends Expression {\n constructor(contents) {\n super();\n this.contents = contents;\n }\n get astNodeType() {\n return \"groupExpr\";\n }\n evaluate(context) {\n return this.contents[0].evaluate(context);\n }\n}\n/**\n * @class Operator\n * @extends Expression\n * @category AST\n */\nclass Operator extends Expression {\n constructor() {\n super();\n }\n}\n/**\n * @class UnaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, !, ~\n */\nclass UnaryOperator extends Operator {\n constructor(operator, right) {\n super();\n this.operator = operator;\n this.right = right;\n }\n get astNodeType() {\n return \"unaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.right.evaluate(context);\n case \"-\":\n return -this.right.evaluate(context);\n case \"!\":\n return this.right.evaluate(context) ? 0 : 1;\n case \"~\":\n return ~this.right.evaluate(context);\n default:\n throw new Error(\"Unknown unary operator: \" + this.operator);\n }\n }\n}\n/**\n * @class BinaryOperator\n * @extends Operator\n * @category AST\n * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, ||\n */\nclass BinaryOperator extends Operator {\n constructor(operator, left, right) {\n super();\n this.operator = operator;\n this.left = left;\n this.right = right;\n }\n get astNodeType() {\n return \"binaryOp\";\n }\n evaluate(context) {\n switch (this.operator) {\n case \"+\":\n return this.left.evaluate(context) + this.right.evaluate(context);\n case \"-\":\n return this.left.evaluate(context) - this.right.evaluate(context);\n case \"*\":\n return this.left.evaluate(context) * this.right.evaluate(context);\n case \"/\":\n return this.left.evaluate(context) / this.right.evaluate(context);\n case \"%\":\n return this.left.evaluate(context) % this.right.evaluate(context);\n case \"==\":\n return this.left.evaluate(context) == this.right.evaluate(context)\n ? 1\n : 0;\n case \"!=\":\n return this.left.evaluate(context) != this.right.evaluate(context)\n ? 1\n : 0;\n case \"<\":\n return this.left.evaluate(context) < this.right.evaluate(context)\n ? 1\n : 0;\n case \">\":\n return this.left.evaluate(context) > this.right.evaluate(context)\n ? 1\n : 0;\n case \"<=\":\n return this.left.evaluate(context) <= this.right.evaluate(context)\n ? 1\n : 0;\n case \">=\":\n return this.left.evaluate(context) >= this.right.evaluate(context)\n ? 1\n : 0;\n case \"&&\":\n return this.left.evaluate(context) && this.right.evaluate(context)\n ? 1\n : 0;\n case \"||\":\n return this.left.evaluate(context) || this.right.evaluate(context)\n ? 1\n : 0;\n default:\n throw new Error(`Unknown operator ${this.operator}`);\n }\n }\n}\n/**\n * @class SwitchCase\n * @extends Node\n * @category AST\n */\nclass SwitchCase extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class Case\n * @extends SwitchCase\n * @category AST\n */\nclass Case extends SwitchCase {\n constructor(selector, body) {\n super();\n this.selector = selector;\n this.body = body;\n }\n get astNodeType() {\n return \"case\";\n }\n}\n/**\n * @class Default\n * @extends SwitchCase\n * @category AST\n */\nclass Default extends SwitchCase {\n constructor(body) {\n super();\n this.body = body;\n }\n get astNodeType() {\n return \"default\";\n }\n}\n/**\n * @class Argument\n * @extends Node\n * @category AST\n */\nclass Argument extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"argument\";\n }\n}\n/**\n * @class ElseIf\n * @extends Node\n * @category AST\n */\nclass ElseIf extends Node {\n constructor(condition, body) {\n super();\n this.condition = condition;\n this.body = body;\n }\n get astNodeType() {\n return \"elseif\";\n }\n}\n/**\n * @class Member\n * @extends Node\n * @category AST\n */\nclass Member extends Node {\n constructor(name, type, attributes) {\n super();\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n }\n get astNodeType() {\n return \"member\";\n }\n}\n/**\n * @class Attribute\n * @extends Node\n * @category AST\n */\nclass Attribute extends Node {\n constructor(name, value) {\n super();\n this.name = name;\n this.value = value;\n }\n get astNodeType() {\n return \"attribute\";\n }\n}\n\nvar _a;\nvar TokenClass;\n(function (TokenClass) {\n TokenClass[TokenClass[\"token\"] = 0] = \"token\";\n TokenClass[TokenClass[\"keyword\"] = 1] = \"keyword\";\n TokenClass[TokenClass[\"reserved\"] = 2] = \"reserved\";\n})(TokenClass || (TokenClass = {}));\nclass TokenType {\n constructor(name, type, rule) {\n this.name = name;\n this.type = type;\n this.rule = rule;\n }\n toString() {\n return this.name;\n }\n}\n/// Catalog of defined token types, keywords, and reserved words.\nclass TokenTypes {\n}\n_a = TokenTypes;\nTokenTypes.none = new TokenType(\"\", TokenClass.reserved, \"\");\nTokenTypes.eof = new TokenType(\"EOF\", TokenClass.token, \"\");\nTokenTypes.reserved = {\n asm: new TokenType(\"asm\", TokenClass.reserved, \"asm\"),\n bf16: new TokenType(\"bf16\", TokenClass.reserved, \"bf16\"),\n do: new TokenType(\"do\", TokenClass.reserved, \"do\"),\n enum: new TokenType(\"enum\", TokenClass.reserved, \"enum\"),\n f16: new TokenType(\"f16\", TokenClass.reserved, \"f16\"),\n f64: new TokenType(\"f64\", TokenClass.reserved, \"f64\"),\n handle: new TokenType(\"handle\", TokenClass.reserved, \"handle\"),\n i8: new TokenType(\"i8\", TokenClass.reserved, \"i8\"),\n i16: new TokenType(\"i16\", TokenClass.reserved, \"i16\"),\n i64: new TokenType(\"i64\", TokenClass.reserved, \"i64\"),\n mat: new TokenType(\"mat\", TokenClass.reserved, \"mat\"),\n premerge: new TokenType(\"premerge\", TokenClass.reserved, \"premerge\"),\n regardless: new TokenType(\"regardless\", TokenClass.reserved, \"regardless\"),\n typedef: new TokenType(\"typedef\", TokenClass.reserved, \"typedef\"),\n u8: new TokenType(\"u8\", TokenClass.reserved, \"u8\"),\n u16: new TokenType(\"u16\", TokenClass.reserved, \"u16\"),\n u64: new TokenType(\"u64\", TokenClass.reserved, \"u64\"),\n unless: new TokenType(\"unless\", TokenClass.reserved, \"unless\"),\n using: new TokenType(\"using\", TokenClass.reserved, \"using\"),\n vec: new TokenType(\"vec\", TokenClass.reserved, \"vec\"),\n void: new TokenType(\"void\", TokenClass.reserved, \"void\"),\n};\nTokenTypes.keywords = {\n array: new TokenType(\"array\", TokenClass.keyword, \"array\"),\n atomic: new TokenType(\"atomic\", TokenClass.keyword, \"atomic\"),\n bool: new TokenType(\"bool\", TokenClass.keyword, \"bool\"),\n f32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n i32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n mat2x2: new TokenType(\"mat2x2\", TokenClass.keyword, \"mat2x2\"),\n mat2x3: new TokenType(\"mat2x3\", TokenClass.keyword, \"mat2x3\"),\n mat2x4: new TokenType(\"mat2x4\", TokenClass.keyword, \"mat2x4\"),\n mat3x2: new TokenType(\"mat3x2\", TokenClass.keyword, \"mat3x2\"),\n mat3x3: new TokenType(\"mat3x3\", TokenClass.keyword, \"mat3x3\"),\n mat3x4: new TokenType(\"mat3x4\", TokenClass.keyword, \"mat3x4\"),\n mat4x2: new TokenType(\"mat4x2\", TokenClass.keyword, \"mat4x2\"),\n mat4x3: new TokenType(\"mat4x3\", TokenClass.keyword, \"mat4x3\"),\n mat4x4: new TokenType(\"mat4x4\", TokenClass.keyword, \"mat4x4\"),\n ptr: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),\n sampler: new TokenType(\"sampler\", TokenClass.keyword, \"sampler\"),\n sampler_comparison: new TokenType(\"sampler_comparison\", TokenClass.keyword, \"sampler_comparison\"),\n struct: new TokenType(\"struct\", TokenClass.keyword, \"struct\"),\n texture_1d: new TokenType(\"texture_1d\", TokenClass.keyword, \"texture_1d\"),\n texture_2d: new TokenType(\"texture_2d\", TokenClass.keyword, \"texture_2d\"),\n texture_2d_array: new TokenType(\"texture_2d_array\", TokenClass.keyword, \"texture_2d_array\"),\n texture_3d: new TokenType(\"texture_3d\", TokenClass.keyword, \"texture_3d\"),\n texture_cube: new TokenType(\"texture_cube\", TokenClass.keyword, \"texture_cube\"),\n texture_cube_array: new TokenType(\"texture_cube_array\", TokenClass.keyword, \"texture_cube_array\"),\n texture_multisampled_2d: new TokenType(\"texture_multisampled_2d\", TokenClass.keyword, \"texture_multisampled_2d\"),\n texture_storage_1d: new TokenType(\"texture_storage_1d\", TokenClass.keyword, \"texture_storage_1d\"),\n texture_storage_2d: new TokenType(\"texture_storage_2d\", TokenClass.keyword, \"texture_storage_2d\"),\n texture_storage_2d_array: new TokenType(\"texture_storage_2d_array\", TokenClass.keyword, \"texture_storage_2d_array\"),\n texture_storage_3d: new TokenType(\"texture_storage_3d\", TokenClass.keyword, \"texture_storage_3d\"),\n texture_depth_2d: new TokenType(\"texture_depth_2d\", TokenClass.keyword, \"texture_depth_2d\"),\n texture_depth_2d_array: new TokenType(\"texture_depth_2d_array\", TokenClass.keyword, \"texture_depth_2d_array\"),\n texture_depth_cube: new TokenType(\"texture_depth_cube\", TokenClass.keyword, \"texture_depth_cube\"),\n texture_depth_cube_array: new TokenType(\"texture_depth_cube_array\", TokenClass.keyword, \"texture_depth_cube_array\"),\n texture_depth_multisampled_2d: new TokenType(\"texture_depth_multisampled_2d\", TokenClass.keyword, \"texture_depth_multisampled_2d\"),\n texture_external: new TokenType(\"texture_external\", TokenClass.keyword, \"texture_external\"),\n u32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n vec2: new TokenType(\"vec2\", TokenClass.keyword, \"vec2\"),\n vec3: new TokenType(\"vec3\", TokenClass.keyword, \"vec3\"),\n vec4: new TokenType(\"vec4\", TokenClass.keyword, \"vec4\"),\n bitcast: new TokenType(\"bitcast\", TokenClass.keyword, \"bitcast\"),\n block: new TokenType(\"block\", TokenClass.keyword, \"block\"),\n break: new TokenType(\"break\", TokenClass.keyword, \"break\"),\n case: new TokenType(\"case\", TokenClass.keyword, \"case\"),\n continue: new TokenType(\"continue\", TokenClass.keyword, \"continue\"),\n continuing: new TokenType(\"continuing\", TokenClass.keyword, \"continuing\"),\n default: new TokenType(\"default\", TokenClass.keyword, \"default\"),\n discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right))\n return null;\n let isUnderscore = this._match(TokenTypes.tokens.underscore);\n if (!isUnderscore)\n _var = this._unary_expression();\n if (!isUnderscore && _var == null)\n return null;\n const type = this._consume(TokenTypes.assignment_operators, \"Expected assignment operator.\");\n const value = this._short_circuit_or_expression();\n return new Assign(AssignOperator.parse(type.lexeme), _var, value);\n }\n _func_call_statement() {\n // ident argument_expression_list\n if (!this._check(TokenTypes.tokens.ident))\n return null;\n const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.name = name;\n this.stage = stage;\n }\n}\nclass EntryFunctions {\n constructor() {\n this.vertex = [];\n this.fragment = [];\n this.compute = [];\n }\n}\nclass OverrideInfo {\n constructor(name, type, attributes, id) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.id = id;\n }\n}\nclass WgslReflect {\n constructor(code) {\n /// All top-level uniform vars in the shader.\n this.uniforms = [];\n /// All top-level storage vars in the shader.\n this.storage = [];\n /// All top-level texture vars in the shader;\n this.textures = [];\n // All top-level sampler vars in the shader.\n this.samplers = [];\n /// All top-level type aliases in the shader.\n this.aliases = [];\n /// All top-level overrides in the shader.\n this.overrides = [];\n /// All top-level structs in the shader.\n this.structs = [];\n /// All entry functions in the shader: vertex, fragment, and/or compute.\n this.entry = new EntryFunctions();\n this._types = new Map();\n if (code) {\n this.update(code);\n }\n }\n _isStorageTexture(type) {\n return (type.name == \"texture_storage_1d\" ||\n type.name == \"texture_storage_2d\" ||\n type.name == \"texture_storage_2d_array\" ||\n type.name == \"texture_storage_3d\");\n }\n update(code) {\n const parser = new WgslParser();\n const ast = parser.parse(code);\n for (const node of ast) {\n if (node instanceof Struct) {\n const info = this._getTypeInfo(node, null);\n if (info instanceof StructInfo) {\n this.structs.push(info);\n }\n continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\n }\n getBindGroups() {\n const groups = [];\n function _makeRoom(group, binding) {\n if (group >= groups.length)\n groups.length = group + 1;\n if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While };\n//# sourceMappingURL=wgsl_reflect.module.js.map\n","import {\n WgslReflect,\n ArrayInfo,\n StructInfo,\n TemplateInfo,\n TypeInfo,\n VariableInfo,\n} from 'wgsl_reflect';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: VariableDefinitions,\n structs: StructDefinitions,\n};\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\n/**\n * Given a WGSL shader, returns data definitions for structures,\n * uniforms, and storage buffers\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct MyStruct {\n * color: vec4f,\n * brightness: f32,\n * kernel: array,\n * };\n * @group(0) @binding(0) var myUniforms: MyUniforms;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms);\n *\n * myUniformValues.set({\n * color: [1, 0, 1, 1],\n * brightness: 0.8,\n * kernel: [\n * 1, 0, -1,\n * 2, 0, -2,\n * 1, 0, -1,\n * ],\n * });\n * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer);\n * ```\n *\n * @param code WGSL shader. Note: it is not required for this to be a complete shader\n * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView}\n */\nexport function makeShaderDataDefinitions(code: string): ShaderDataDefinitions {\n const reflect = new WgslReflect(code);\n\n const structs = Object.fromEntries(reflect.structs.map(structInfo => {\n return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)];\n }));\n\n const uniforms = getNamedVariables(reflect, reflect.uniforms);\n const storages = getNamedVariables(reflect, reflect.storage);\n\n return {\n structs,\n storages,\n uniforms,\n };\n}\n\nfunction assert(cond: boolean, msg = '') {\n if (!cond) {\n throw new Error(msg);\n }\n}\n\n/*\n write down what I want for a given type\n\n struct VSUniforms {\n foo: u32,\n };\n @group(4) @binding(1) var uni1: f32;\n @group(3) @binding(2) var uni2: array;\n @group(2) @binding(3) var uni3: VSUniforms;\n @group(1) @binding(4) var uni4: array;\n\n uni1: {\n type: 'f32',\n numElements: undefined\n },\n uni2: {\n type: 'array',\n elementType: 'f32'\n numElements: 5,\n },\n uni3: {\n type: 'struct',\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n },\n uni4: {\n type: 'array',\n elementType:\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n fields: {\n foo: {\n type: 'f32',\n numElements: undefined\n }\n },\n ...\n ]\n\n */\n\n\n\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n\n","import {\n isTypedArray,\n} from './typed-arrays.js';\n\nfunction getViewDimensionForTexture(texture: GPUTexture): GPUTextureViewDimension {\n switch (texture.dimension) {\n case '1d':\n return '1d';\n case '3d':\n return '3d';\n default: // to shut up TS\n case '2d':\n return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d';\n }\n}\n\nfunction normalizeGPUExtent3Dict(size: GPUExtent3DDict) {\n return [size.width, size.height || 1, size.depthOrArrayLayers || 1];\n}\n\n/**\n * Converts a `GPUExtent3D` into an array of numbers\n *\n * `GPUExtent3D` has two forms `[width, height?, depth?]` or\n * `{width: number, height?: number, depthOrArrayLayers?: number}`\n *\n * You pass one of those in here and it returns an array of 3 numbers\n * so that your code doesn't have to deal with multiple forms.\n *\n * @param size\n * @returns an array of 3 numbers, [width, height, depthOrArrayLayers]\n */\nexport function normalizeGPUExtent3D(size: GPUExtent3D): number[] {\n return (Array.isArray(size) || isTypedArray(size))\n ? [...(size as Iterable), 1, 1].slice(0, 3)\n : normalizeGPUExtent3Dict(size as GPUExtent3DDict);\n}\n\n/**\n * Given a GPUExtent3D returns the number of mip levels needed\n *\n * @param size\n * @returns number of mip levels needed for the given size\n */\nexport function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension) {\n const sizes = normalizeGPUExtent3D(size);\n const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2));\n return 1 + Math.log2(maxSize) | 0;\n}\n\n// Use a WeakMap so the device can be destroyed and/or lost\nconst byDevice = new WeakMap();\n\n/**\n * Generates mip levels from level 0 to the last mip for an existing texture\n *\n * The texture must have been created with TEXTURE_BINDING and\n * RENDER_ATTACHMENT and been created with mip levels\n *\n * @param device\n * @param texture\n */\nexport function generateMipmap(device: GPUDevice, texture: GPUTexture) {\n let perDeviceInfo = byDevice.get(device);\n if (!perDeviceInfo) {\n perDeviceInfo = {\n pipelineByFormat: {},\n moduleByView: {},\n };\n byDevice.set(device, perDeviceInfo);\n }\n let {\n sampler,\n } = perDeviceInfo;\n const {\n pipelineByFormat,\n moduleByView,\n } = perDeviceInfo;\n const view = getViewDimensionForTexture(texture);\n let module = moduleByView[view];\n if (!module) {\n module = device.createShaderModule({\n label: `mip level generation for ${view}`,\n code: `\n struct VSOutput {\n @builtin(position) position: vec4f,\n @location(0) texcoord: vec2f,\n };\n\n @vertex fn vs(\n @builtin(vertex_index) vertexIndex : u32\n ) -> VSOutput {\n var pos = array(\n vec2f(-1.0, -1.0),\n vec2f(-1.0, 3.0),\n vec2f( 3.0, -1.0),\n );\n\n var vsOutput: VSOutput;\n let xy = pos[vertexIndex];\n vsOutput.position = vec4f(xy, 0.0, 1.0);\n vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5);\n return vsOutput;\n }\n\n @group(0) @binding(0) var ourSampler: sampler;\n @group(0) @binding(1) var ourTexture: texture_2d;\n\n @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f {\n return textureSample(ourTexture, ourSampler, fsInput.texcoord);\n }\n `,\n });\n moduleByView[view] = module;\n }\n\n if (!sampler) {\n sampler = device.createSampler({\n minFilter: 'linear',\n });\n perDeviceInfo.sampler = sampler;\n }\n\n const id = `${texture.format}`;\n\n if (!pipelineByFormat[id]) {\n pipelineByFormat[id] = device.createRenderPipeline({\n label: `mip level generator pipeline for ${view}`,\n layout: 'auto',\n vertex: {\n module,\n entryPoint: 'vs',\n },\n fragment: {\n module,\n entryPoint: 'fs',\n targets: [{ format: texture.format }],\n },\n });\n }\n const pipeline = pipelineByFormat[id];\n\n const encoder = device.createCommandEncoder({\n label: 'mip gen encoder',\n });\n\n for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) {\n for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) {\n const bindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n { binding: 0, resource: sampler },\n {\n binding: 1,\n resource: texture.createView({\n dimension: '2d',\n baseMipLevel: baseMipLevel - 1,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n },\n ],\n });\n\n const renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'mip gen renderPass',\n colorAttachments: [\n {\n view: texture.createView({\n baseMipLevel,\n mipLevelCount: 1,\n baseArrayLayer,\n arrayLayerCount: 1,\n }),\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n };\n\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n pass.end();\n }\n }\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\n\nconst kTypedArrayToAttribFormat = new Map([\n [ Int8Array, { formats: ['sint8', 'snorm8' ], defaultForType: 1 } ],\n [ Uint8Array, { formats: ['uint8', 'unorm8' ], defaultForType: 1 } ],\n [ Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 } ],\n [ Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 } ],\n [ Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 } ],\n [ Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 } ],\n [ Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 } ],\n // TODO: Add Float16Array\n]);\n\nconst kVertexFormatPrefixToType = new Map(\n [...kTypedArrayToAttribFormat.entries()].map(([Type, {formats: [s1, s2]}]) => [[s1, Type], [s2, Type]] as [[string, TypedArrayConstructor], [string, TypedArrayConstructor]]).flat()\n);\n\n/**\n * See {@link Arrays} for details\n */\nexport type FullArraySpec = {\n data: number | number[] | TypedArray,\n type?: TypedArrayConstructor,\n numComponents?: number,\n shaderLocation?: number,\n normalize?: boolean,\n};\n\nexport type ArrayUnion = number | number[] | TypedArray | FullArraySpec;\n\n/**\n * Named Arrays\n *\n * A set of named arrays are passed to various functions like\n * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays}\n *\n * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec}\n *\n * If it's a native array then, if the name of the array is `indices` the data will be converted\n * to a `Uint32Array`, otherwise a `Float32Array. Use a TypedArray or a FullArraySpec to choose a different type.\n * The 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 guess. 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 at number of components. The guess is\n * based on this table where (d) is the default for that type if `normalize` is not specified\n *\n * | Type | .. | normalize |\n * | ------------ | ----------- | ----------- |\n * | Int8Array | sint8 | snorm8 (d) |\n * | Uint8Array | uint8 | unorm8 (d) |\n * | Int16Array | sint16 | snorm16 (d) |\n * | Uint16Array | uint16 | unorm16 (d) |\n * | Int32Array | sint32 (d) | snorm32 |\n * | Uint32Array | uint32 (d) | unorm32 |\n * | Float32Array | float32 (d) | float32 |\n *\n */\nexport type Arrays = { [key: string]: ArrayUnion };\nexport type ArraysOptions = {\n interleave?: boolean,\n stepMode?: GPUVertexStepMode,\n usage?: GPUBufferUsageFlags,\n shaderLocation?: number,\n};\n\n/**\n * Returned by {@link createBuffersAndAttributesFromArrays}\n */\nexport type BuffersAndAttributes = {\n numElements: number,\n bufferLayouts: GPUVertexBufferLayout[],\n buffers: GPUBuffer[],\n indexBuffer?: GPUBuffer,\n indexFormat?: GPUIndexFormat,\n};\n\nfunction isIndices(name: string) {\n return name === \"indices\";\n}\n\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n","import {\n TypedArray,\n TypedArrayConstructor,\n isTypedArray,\n} from './typed-arrays.js';\nimport {\n generateMipmap,\n numMipLevels,\n} from './generate-mipmap.js';\n\nexport type CopyTextureOptions = {\n flipY?: boolean,\n premultipliedAlpha?: boolean,\n colorSpace?: PredefinedColorSpace;\n dimension?: GPUTextureViewDimension;\n baseArrayLayer?: number;\n};\n\nexport type TextureData = {\n data: TypedArray | number[],\n};\nexport type TextureCreationData = TextureData & {\n width?: number,\n height?: number,\n};\n\nexport type TextureRawDataSource = TextureCreationData | TypedArray | number[];\nexport type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource;\n\nfunction isTextureData(source: TextureSource) {\n const src = source as TextureData;\n return isTypedArray(src.data) || Array.isArray(src.data);\n}\n\nfunction isTextureRawDataSource(source: TextureSource) {\n return isTypedArray(source) || Array.isArray(source) || isTextureData(source);\n}\n\nfunction toTypedArray(v: TypedArray | number[], format: GPUTextureFormat): TypedArray {\n if (isTypedArray(v)) {\n return v as TypedArray;\n }\n const { Type } = getTextureFormatInfo(format);\n return new Type(v);\n}\n\nfunction guessDimensions(width: number | undefined, height: number | undefined, numElements: number, dimension: GPUTextureViewDimension = '2d'): number[] {\n if (numElements % 1 !== 0) {\n throw new Error(\"can't guess dimensions\");\n }\n if (!width && !height) {\n const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1));\n if (size % 1 === 0) {\n width = size;\n height = size;\n } else {\n width = numElements;\n height = 1;\n }\n } else if (!height) {\n height = numElements / width!;\n if (height % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n } else if (!width) {\n width = numElements / height;\n if (width % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n }\n const depth = numElements / width! / height;\n if (depth % 1) {\n throw new Error(\"can't guess dimensions\");\n }\n return [width!, height, depth];\n}\n\nfunction textureViewDimensionToDimension(viewDimension: GPUTextureViewDimension | undefined) {\n switch (viewDimension) {\n case '1d': return '1d';\n case '3d': return '3d';\n default: return '2d';\n }\n}\n\nconst kFormatToTypedArray: {[key: string]: TypedArrayConstructor} = {\n '8snorm': Int8Array,\n '8unorm': Uint8Array,\n '8sint': Int8Array,\n '8uint': Uint8Array,\n '16snorm': Int16Array,\n '16unorm': Uint16Array,\n '16sint': Int16Array,\n '16uint': Uint16Array,\n '32snorm': Int32Array,\n '32unorm': Uint32Array,\n '32sint': Int32Array,\n '32uint': Uint32Array,\n '16float': Uint16Array, // TODO: change to Float16Array\n '32float': Float32Array,\n};\n\nconst kTextureFormatRE = /([a-z]+)(\\d+)([a-z]+)/;\n\nfunction getTextureFormatInfo(format: GPUTextureFormat) {\n // this is a hack! It will only work for common formats\n const [, channels, bits, typeName] = kTextureFormatRE.exec(format)!;\n // TODO: if the regex fails, use table for other formats?\n const numChannels = channels.length;\n const bytesPerChannel = parseInt(bits) / 8;\n const bytesPerElement = numChannels * bytesPerChannel;\n const Type = kFormatToTypedArray[`${bits}${typeName}`];\n\n return {\n channels,\n numChannels,\n bytesPerChannel,\n bytesPerElement,\n Type,\n };\n}\n\n\n/**\n * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers]\n */\nexport function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1\n * @param xOffset the amount to offset the quad in X\n * @param yOffset the amount to offset the quad in Y\n * @return the created XY Quad vertices\n */\nexport function createXYQuadVertices(size: number = 2, xOffset: number = 0, yOffset: number = 0) {\n size *= 0.5;\n return {\n position: {\n numComponents: 2,\n data: [\n xOffset + -1 * size, yOffset + -1 * size,\n xOffset + 1 * size, yOffset + -1 * size,\n xOffset + -1 * size, yOffset + 1 * size,\n xOffset + 1 * size, yOffset + 1 * size,\n ],\n },\n normal: [\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n 0, 0, 1,\n ],\n texcoord: [\n 0, 0,\n 1, 0,\n 0, 1,\n 1, 1,\n ],\n indices: [ 0, 1, 2, 2, 1, 3 ],\n } as Arrays;\n}\n\n/**\n * Creates XZ plane vertices.\n *\n * The created plane has position, normal, and texcoord data\n *\n * @param width Width of the plane. Default = 1\n * @param depth Depth of the plane. Default = 1\n * @param subdivisionsWidth Number of steps across the plane. Default = 1\n * @param subdivisionsDepth Number of steps down the plane. Default = 1\n * @return The created plane vertices.\n */\nexport function createPlaneVertices(\n width = 1,\n depth = 1,\n subdivisionsWidth = 1,\n subdivisionsDepth = 1) {\n const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n for (let z = 0; z <= subdivisionsDepth; z++) {\n for (let x = 0; x <= subdivisionsWidth; x++) {\n const u = x / subdivisionsWidth;\n const v = z / subdivisionsDepth;\n positions.push(\n width * u - width * 0.5,\n 0,\n depth * v - depth * 0.5);\n normals.push(0, 1, 0);\n texcoords.push(u, v);\n }\n }\n\n const numVertsAcross = subdivisionsWidth + 1;\n const indices = createAugmentedTypedArray(\n 3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array);\n\n for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line\n for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (z + 0) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x,\n (z + 0) * numVertsAcross + x + 1);\n\n // Make triangle 2 of quad.\n indices.push(\n (z + 1) * numVertsAcross + x,\n (z + 1) * numVertsAcross + x + 1,\n (z + 0) * numVertsAcross + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates sphere vertices.\n *\n * The created sphere has position, normal, and texcoord data\n *\n * @param radius radius of the sphere.\n * @param subdivisionsAxis number of steps around the sphere.\n * @param subdivisionsHeight number of vertically on the sphere.\n * @param startLatitudeInRadians where to start the\n * top of the sphere.\n * @param endLatitudeInRadians Where to end the\n * bottom of the sphere.\n * @param startLongitudeInRadians where to start\n * wrapping the sphere.\n * @param endLongitudeInRadians where to end\n * wrapping the sphere.\n * @return The created sphere vertices.\n */\nexport function createSphereVertices(\n radius = 1,\n subdivisionsAxis = 24,\n subdivisionsHeight = 12,\n startLatitudeInRadians = 0,\n endLatitudeInRadians = Math.PI,\n startLongitudeInRadians = 0,\n endLongitudeInRadians = Math.PI * 2) {\n if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) {\n throw new Error('subdivisionAxis and subdivisionHeight must be > 0');\n }\n\n const latRange = endLatitudeInRadians - startLatitudeInRadians;\n const longRange = endLongitudeInRadians - startLongitudeInRadians;\n\n // We are going to generate our sphere by iterating through its\n // spherical coordinates and generating 2 triangles for each quad on a\n // ring of the sphere.\n const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n // Generate the individual vertices in our vertex buffer.\n for (let y = 0; y <= subdivisionsHeight; y++) {\n for (let x = 0; x <= subdivisionsAxis; x++) {\n // Generate a vertex based on its spherical coordinates\n const u = x / subdivisionsAxis;\n const v = y / subdivisionsHeight;\n const theta = longRange * u + startLongitudeInRadians;\n const phi = latRange * v + startLatitudeInRadians;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const sinPhi = Math.sin(phi);\n const cosPhi = Math.cos(phi);\n const ux = cosTheta * sinPhi;\n const uy = cosPhi;\n const uz = sinTheta * sinPhi;\n positions.push(radius * ux, radius * uy, radius * uz);\n normals.push(ux, uy, uz);\n texcoords.push(1 - u, v);\n }\n }\n\n const numVertsAround = subdivisionsAxis + 1;\n const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array);\n for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line\n for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line\n // Make triangle 1 of quad.\n indices.push(\n (y + 0) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x);\n\n // Make triangle 2 of quad.\n indices.push(\n (y + 1) * numVertsAround + x,\n (y + 0) * numVertsAround + x + 1,\n (y + 1) * numVertsAround + x + 1);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Array of the indices of corners of each face of a cube.\n */\nconst CUBE_FACE_INDICES = [\n [3, 7, 5, 1], // right\n [6, 2, 0, 4], // left\n [6, 7, 3, 2], // ??\n [0, 1, 5, 4], // ??\n [7, 6, 4, 5], // front\n [2, 3, 1, 0], // back\n];\n\n/**\n * Creates the vertices and indices for a cube.\n *\n * The cube is created around the origin. (-size / 2, size / 2).\n *\n * @param size width, height and depth of the cube.\n * @return The created vertices.\n */\nexport function createCubeVertices(size = 1) {\n const k = size / 2;\n\n const cornerVertices = [\n [-k, -k, -k],\n [+k, -k, -k],\n [-k, +k, -k],\n [+k, +k, -k],\n [-k, -k, +k],\n [+k, -k, +k],\n [-k, +k, +k],\n [+k, +k, +k],\n ];\n\n const faceNormals = [\n [+1, +0, +0],\n [-1, +0, +0],\n [+0, +1, +0],\n [+0, -1, +0],\n [+0, +0, +1],\n [+0, +0, -1],\n ];\n\n const uvCoords = [\n [1, 0],\n [0, 0],\n [0, 1],\n [1, 1],\n ];\n\n const numVertices = 6 * 4;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2 , numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array);\n\n for (let f = 0; f < 6; ++f) {\n const faceIndices = CUBE_FACE_INDICES[f];\n for (let v = 0; v < 4; ++v) {\n const position = cornerVertices[faceIndices[v]];\n const normal = faceNormals[f];\n const uv = uvCoords[v];\n\n // Each face needs all four vertices because the normals and texture\n // coordinates are not all the same.\n positions.push(position);\n normals.push(normal);\n texcoords.push(uv);\n\n }\n // Two triangles make a square face.\n const offset = 4 * f;\n indices.push(offset + 0, offset + 1, offset + 2);\n indices.push(offset + 0, offset + 2, offset + 3);\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates vertices for a truncated cone, which is like a cylinder\n * except that it has different top and bottom radii. A truncated cone\n * can also be used to create cylinders and regular cones. The\n * truncated cone will be created centered about the origin, with the\n * y axis as its vertical axis. .\n *\n * @param bottomRadius Bottom radius of truncated cone.\n * @param topRadius Top radius of truncated cone.\n * @param height Height of truncated cone.\n * @param radialSubdivisions The number of subdivisions around the\n * truncated cone.\n * @param verticalSubdivisions The number of subdivisions down the\n * truncated cone.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created cone vertices.\n */\nexport function createTruncatedConeVertices(\n bottomRadius = 1,\n topRadius = 0,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param verticalRadius The vertical radius of the crescent.\n * @param outerRadius The outer radius of the crescent.\n * @param innerRadius The inner radius of the crescent.\n * @param thickness The thickness of the crescent.\n * @param subdivisionsDown number of steps around the crescent.\n * @param startOffset Where to start arc. Default 0.\n * @param endOffset Where to end arg. Default 1.\n * @return The created vertices.\n */\nexport function createCrescentVertices(\n verticalRadius: 2,\n outerRadius: 1,\n innerRadius: 0,\n thickness: 1,\n subdivisionsDown: 12,\n startOffset: 0,\n endOffset: 1) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param radius Radius of cylinder.\n * @param height Height of cylinder.\n * @param radialSubdivisions The number of subdivisions around the cylinder.\n * @param verticalSubdivisions The number of subdivisions down the cylinder.\n * @param topCap Create top cap. Default = true.\n * @param bottomCap Create bottom cap. Default = true.\n * @return The created vertices.\n */\nexport function createCylinderVertices(\n radius = 1,\n height = 1,\n radialSubdivisions = 24,\n verticalSubdivisions = 1,\n topCap = true,\n bottomCap = true) {\n return createTruncatedConeVertices(\n radius,\n radius,\n height,\n radialSubdivisions,\n verticalSubdivisions,\n topCap,\n bottomCap);\n}\n\n/**\n * Creates vertices for a torus\n *\n * @param radius radius of center of torus circle.\n * @param thickness radius of torus ring.\n * @param radialSubdivisions The number of subdivisions around the torus.\n * @param bodySubdivisions The number of subdivisions around the body torus.\n * @param startAngle start angle in radians. Default = 0.\n * @param endAngle end angle in radians. Default = Math.PI * 2.\n * @return The created vertices.\n */\nexport function createTorusVertices(\n radius = 1,\n thickness = 0.24,\n radialSubdivisions = 24,\n bodySubdivisions = 12,\n startAngle = 0,\n endAngle = Math.PI * 2) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (bodySubdivisions < 3) {\n throw new Error('verticalSubdivisions must be 3 or greater');\n }\n const range = endAngle - startAngle;\n\n const radialParts = radialSubdivisions + 1;\n const bodyParts = bodySubdivisions + 1;\n const numVertices = radialParts * bodyParts;\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array);\n\n for (let slice = 0; slice < bodyParts; ++slice) {\n const v = slice / bodySubdivisions;\n const sliceAngle = v * Math.PI * 2;\n const sliceSin = Math.sin(sliceAngle);\n const ringRadius = radius + sliceSin * thickness;\n const ny = Math.cos(sliceAngle);\n const y = ny * thickness;\n for (let ring = 0; ring < radialParts; ++ring) {\n const u = ring / radialSubdivisions;\n const ringAngle = startAngle + u * range;\n const xSin = Math.sin(ringAngle);\n const zCos = Math.cos(ringAngle);\n const x = xSin * ringRadius;\n const z = zCos * ringRadius;\n const nx = xSin * sliceSin;\n const nz = zCos * sliceSin;\n positions.push(x, y, z);\n normals.push(nx, ny, nz);\n texcoords.push(u, 1 - v);\n }\n }\n\n for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line\n for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line\n const nextRingIndex = 1 + ring;\n const nextSliceIndex = 1 + slice;\n indices.push(radialParts * slice + ring,\n radialParts * nextSliceIndex + ring,\n radialParts * slice + nextRingIndex);\n indices.push(radialParts * nextSliceIndex + ring,\n radialParts * nextSliceIndex + nextRingIndex,\n radialParts * slice + nextRingIndex);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Creates disc vertices. The disc will be in the xz plane, centered at\n * the origin. When creating, at least 3 divisions, or pie\n * pieces, need to be specified, otherwise the triangles making\n * up the disc will be degenerate. You can also specify the\n * number of radial pieces `stacks`. A value of 1 for\n * stacks will give you a simple disc of pie pieces. If you\n * want to create an annulus you can set `innerRadius` to a\n * value > 0. Finally, `stackPower` allows you to have the widths\n * increase or decrease as you move away from the center. This\n * is particularly useful when using the disc as a ground plane\n * with a fixed camera such that you don't need the resolution\n * of small triangles near the perimeter. For example, a value\n * of 2 will produce stacks whose outside radius increases with\n * the square of the stack index. A value of 1 will give uniform\n * stacks.\n *\n * @param radius Radius of the ground plane.\n * @param divisions Number of triangles in the ground plane (at least 3).\n * @param stacks Number of radial divisions (default=1).\n * @param innerRadius Default 0.\n * @param stackPower Power to raise stack size to for decreasing width.\n * @return The created vertices.\n */\nexport function createDiscVertices(\n radius = 1,\n divisions = 24,\n stacks = 1,\n innerRadius = 0,\n stackPower = 1) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";AAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ;;MCwBvG,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,KAAK,CAAC,SAAiB,EAAA;QACnB,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KACrE;AACD,IAAA,GAAG,CAAC,QAAgB,EAAA;AAChB,QAAA,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC;KAC/B;IACD,OAAO,CAAuB,IAA2B,EAAE,WAAmB,EAAA;AAC1E,QAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,UA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C,MAAM,CAAC,GAAG,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,gBAAA,MAAM,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;AACzB,gBAAA,MAAM,CAAC,GAAG,UAAU,GAAG,CAAC,GAAG,cAAc,CAAC;gBAC1C,MAAM,CAAC,GAAG,UAAU,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC;;gBAGhD,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,aAAA;AACF,SAAA;AAED,QAAA,UAAU,IAAI,SAAS,GAAG,CAAC,CAAC;AAC7B,KAAA;IAED,OAAO;QACL,QAAQ,EAAE,SAAS,CAAC,UAAU;QAC9B,MAAM,EAAE,OAAO,CAAC,UAAU;QAC1B,QAAQ,EAAE,SAAS,CAAC,UAAU;QAC9B,OAAO,EAAE,OAAO,CAAC,UAAU;KAC5B,CAAC;AACJ;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[3]} \ No newline at end of file diff --git a/dist/1.x/attribute-utils.d.ts b/dist/1.x/attribute-utils.d.ts deleted file mode 100644 index c7319f6..0000000 --- a/dist/1.x/attribute-utils.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -/// -import { TypedArray, TypedArrayConstructor } from './typed-arrays.js'; -/** - * See {@link Arrays} for details - */ -export type FullArraySpec = { - data: number | number[] | TypedArray; - type?: TypedArrayConstructor; - numComponents?: number; - shaderLocation?: number; - normalize?: boolean; -}; -export type ArrayUnion = number | number[] | TypedArray | FullArraySpec; -/** - * Named Arrays - * - * A set of named arrays are passed to various functions like - * {@link createBufferLayoutsFromArrays} and {@link createBuffersAndAttributesFromArrays} - * - * Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a {@link FullArraySpec} - * - * If it's a native array then, if the name of the array is `indices` the data will be converted - * to a `Uint32Array`, otherwise a `Float32Array`. Use a TypedArray or a {@link FullArraySpec} to choose a different type. - * The {@link FullArraySpec} `type` is only used if it's not already a TypedArray - * - * If it's a native array or a TypedArray or if `numComponents` in a {@link FullArraySpec} is not - * specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2. - * If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3. - * - * For attribute formats, guesses are made based on type and number of components. The guess is - * based on this table where (d) is the default for that type if `normalize` is not specified - * - * | Type | .. | normalize | - * | ------------ | ----------- | ----------- | - * | Int8Array | sint8 | snorm8 (d) | - * | Uint8Array | uint8 | unorm8 (d) | - * | Int16Array | sint16 | snorm16 (d) | - * | Uint16Array | uint16 | unorm16 (d) | - * | Int32Array | sint32 (d) | snorm32 | - * | Uint32Array | uint32 (d) | unorm32 | - * | Float32Array | float32 (d) | float32 | - * - */ -export type Arrays = { - [key: string]: ArrayUnion; -}; -export type ArraysOptions = { - interleave?: boolean; - stepMode?: GPUVertexStepMode; - usage?: GPUBufferUsageFlags; - shaderLocation?: number; -}; -/** - * Returned by {@link createBuffersAndAttributesFromArrays} - */ -export type BuffersAndAttributes = { - numElements: number; - bufferLayouts: GPUVertexBufferLayout[]; - buffers: GPUBuffer[]; - indexBuffer?: GPUBuffer; - indexFormat?: GPUIndexFormat; -}; -type TypedArrayWithOffsetAndStride = { - data: TypedArray; - offset: number; /** In elements not bytes */ - stride: number; /** In elements not bytes */ -}; -/** - * Given a set of named arrays, generates an array `GPUBufferLayout`s - * - * Examples: - * - * ```js - * const arrays = { - * 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], - * 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], - * 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], - * }; - * - * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays); - * ``` - * - * results in `bufferLayouts` being - * - * ```js - * [ - * { - * stepMode: 'vertex', - * arrayStride: 32, - * attributes: [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ], - * }, - * ] - * ``` - * - * and `typedArrays` being - * - * ``` - * [ - * someFloat32Array0, - * someFloat32Array1, - * someFloat32Array2, - * ] - * ``` - * - * See {@link Arrays} for details on the various types of arrays. - * - * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made) - */ -export declare function createBufferLayoutsFromArrays(arrays: Arrays, options?: ArraysOptions): { - bufferLayouts: GPUVertexBufferLayout[]; - typedArrays: TypedArrayWithOffsetAndStride[]; -}; -/** - * Given an array of `GPUVertexAttribute`s and a corresponding array - * of TypedArrays, interleaves the contents of the typed arrays - * into the given ArrayBuffer - * - * example: - * - * ```js - * const attributes: GPUVertexAttribute[] = [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ]; - * const typedArrays = [ - * 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]), - * 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]), - * 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]), - * ]; - * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv - * const arrayBuffer = new ArrayBuffer(arrayStride * 24) - * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer) - * ``` - * - * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved - * - * See {@link Arrays} for details on the various types of arrays. - * - * Note: You can generate `attributes` and `typedArrays` above by calling - * {@link createBufferLayoutsFromArrays} - */ -export declare function interleaveVertexData(attributes: GPUVertexAttribute[], typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[], arrayStride: number, arrayBuffer: ArrayBuffer): void; -/** - * Given arrays, create buffers, fills the buffers with data if provided, optionally - * interleaves the data (the default). - * - * Example: - * - * ```js - * const { - * buffers, - * bufferLayouts, - * indexBuffer, - * indexFormat, - * numElements, - * } = createBuffersAndAttributesFromArrays(device, { - * 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], - * 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], - * 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], - * 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], - * }); - * ``` - * - * Where `bufferLayouts` will be - * - * ```js - * [ - * { - * stepMode: 'vertex', - * arrayStride: 32, - * attributes: [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ], - * }, - * ] - * ``` - * - * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX` - * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX` - * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices) - * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no - * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays}) - * - * See {@link Arrays} for details on the various types of arrays. - * Also see the cube and instancing examples. - */ -export declare function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options?: ArraysOptions): BuffersAndAttributes; -/** - * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer` - * for the buffers specified in `buffersAndAttributes`. - * - * This is extremely simple function. It is equivalent to - * - * ```js - * buffersAndAttributes.buffers.forEach((buffer, i) => { - * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer); - * }); -* - * if (buffersAndAttributes.indexBuffer) { - * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!); - * } - * ``` - * - * It exists solely for simple cases. If you have a complex case, call the passEncoder - * yourself as appropriate. - * - * @param passEncoder a render pass encoder - * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays} - * @param firstVertexBufferIndex The first vertex buffer index. default = 0. - */ -export declare function setVertexAndIndexBuffers(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes, firstVertexBufferIndex?: number): void; -/** - * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed` - * - * This is an extremely simple function. See {@link setVertexAndIndexBuffers}. - * If you need something more complex, call pass encoder functions yourself as appropriate. - * - * @param passEncoder a render pass encoder - * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays} - */ -export declare function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes): void; -export {}; diff --git a/dist/1.x/buffer-views.d.ts b/dist/1.x/buffer-views.d.ts deleted file mode 100644 index 5dbaefa..0000000 --- a/dist/1.x/buffer-views.d.ts +++ /dev/null @@ -1,257 +0,0 @@ -import { StructDefinition, TypeDefinition, VariableDefinition } from './data-definitions.js'; -import { TypedArrayConstructor, TypedArray } from './typed-arrays.js'; -type TypeDef = { - numElements: number; - align: number; - size: number; - type: string; - View: TypedArrayConstructor; - flatten?: boolean; - pad?: readonly number[]; -}; -declare const typeInfo: { - readonly [K: string]: TypeDef; -}; -export type kType = Extract; -export declare const kTypes: readonly kType[]; -/** - * Set which intrinsic types to make views for. - * - * Example: - * - * Given a an array of intrinsics like this - * `array` - * - * The default is to create a single `Float32Array(4 * 200)` - * because creating 200 `Float32Array` views is not usually - * what you want. - * - * If you do want individual views then you'd call - * `setIntrinsicsToView(['vec3f`])` and now you get - * an array of 200 `Float32Array`s. - * - * Note: `setIntrinsicsToView` always sets ALL types. The list you - * pass it is the types you want views created for, all other types - * will be reset to do the default. In other words - * - * ```js - * setIntrinsicsToView(['vec3f`]) - * setIntrinsicsToView(['vec2f`]) - * ``` - * - * Only `vec2f` will have views created. `vec3f` has been reset to the default by - * the second call - * - * You can pass in `true` as the 2nd parameter to make it set which types - * to flatten and all others will be set to have views created. For example - * to expand all types would be `setIntrinsicsToView([], true)`. To expand - * all except `f32` would be `setIntrinsicsToView(['f32'], true)`. - * - * To reset all types to the default call it with no arguments - * - * @param types array of types to make views for - * @param flatten whether to flatten or expand the specified types. - */ -export declare function setIntrinsicsToView(types?: readonly kType[], flatten?: boolean): void; -export type TypedArrayOrViews = TypedArray | Views | Views[]; -export interface Views { - [x: string]: TypedArrayOrViews; -} -export type ArrayBufferViews = { - views: any; // because otherwise this is too much of a PITA to use in typescript - arrayBuffer: ArrayBuffer; -}; -/** - * Creates a set of named TypedArray views on an ArrayBuffer. If you don't - * pass in an ArrayBuffer, one will be created. If you're using an unsized - * array then you must pass in your own arraybuffer - * - * Example: - * - * ```js - * const code = ` - * struct Stuff { - * direction: vec3f, - * strength: f32, - * matrix: mat4x4f, - * }; - * @group(0) @binding(0) var uni: Stuff; - * `; - * const defs = makeShaderDataDefinitions(code); - * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition); - * ``` - * - * views would effectively be - * - * ```js - * views = { - * direction: Float32Array(arrayBuffer, 0, 3), - * strength: Float32Array(arrayBuffer, 3, 4), - * matrix: Float32Array(arraybuffer, 4, 20), - * }; - * ``` - * - * You can use the views directly or you can use @link {setStructuredView} - * - * @param typeDef Definition of the various types of views. - * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created) - * @param offset Optional offset in existing ArrayBuffer to start the views. - * @returns A bunch of named TypedArray views and the ArrayBuffer - */ -export declare function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews; -/** - * Given a set of TypeArrayViews and matching JavaScript data - * sets the content of the views. - * - * Example: - * - * ```js - * const code = ` - * struct Stuff { - * direction: vec3f, - * strength: f32, - * matrix: mat4x4f, - * }; - * @group(0) @binding(0) var uni: Stuff; - * `; - * const defs = makeShaderDataDefinitions(code); - * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition); - * - * setStructuredViews({ - * direction: [1, 2, 3], - * strength: 45, - * matrix: [ - * 1, 0, 0, 0, - * 0, 1, 0, 0, - * 0, 0, 1, 0, - * 0, 0, 0, 1, - * ], - * }); - * ``` - * - * The code above will set the various views, which all point to different - * locations within the same array buffer. - * - * See @link {makeTypedArrayViews}. - * - * @param data The new values - * @param views TypedArray views as returned from {@link makeTypedArrayViews} - */ -export declare function setStructuredView(data: any, views: TypedArrayOrViews): void; -export type StructuredView = ArrayBufferViews & { - /** - * Sets the contents of the TypedArrays based on the data passed in - * Note: The data may be sparse - * - * example: - * - * ```js - * const code = ` - * struct HSL { - * hue: f32, - * sat: f32, - * lum: f32, - * }; - * struct MyUniforms { - * colors: array, - * brightness: f32, - * kernel: array, - * }; - * @group(0) @binding(0) var myUniforms: MyUniforms; - * `; - * const defs = makeShaderDataDefinitions(code); - * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms); - * - * 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, - * ], - * }); - * ``` - * - * @param data - */ - set(data: any): void; -}; -/** - * 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 - */ -export declare function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset?: number): StructuredView; -/** - * Sets values on an existing array buffer from a TypeDefinition - * @param typeDef A type definition provided by @link {makeShaderDataDefinitions} - * @param data The source data - * @param arrayBuffer The arrayBuffer who's data to set. - * @param offset An offset in the arrayBuffer to start at. - */ -export declare function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset?: number): void; -/** - * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}. - * @param varDef A variable definition provided by @link {makeShaderDataDefinitions} - * @param data The source data - * @param arrayBuffer The arrayBuffer who's data to set. - * @param offset An offset in the arrayBuffer to start at. - */ -export declare function setStructuredValues(varDef: VariableDefinition, data: any, arrayBuffer: ArrayBuffer, offset?: number): void; -/** - * Returns the size, align, and unalignedSize of "the" unsized array element. Unsized arrays are only - * allowed at the outer most level or the last member of a top level struct. - * - * Example: - * - * ```js - * const code = ` - * struct Foo { - * a: u32, - * b: array, - * }; - * @group(0) @binding(0) var f: Foo; - * `; - * const defs = makeShaderDataDefinitions(code); - * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement( - * defs.storages.f); - * // size = 16 (since you need to allocate 16 bytes per element) - * // align = 16 (since vec3f needs to be aligned to 16 bytes) - * // unalignedSize = 12 (since only 12 bytes are used for a vec3f) - * ``` - * - * Generally you only need size. Example: - * - * ```js - * const code = ` - * struct Foo { - * a: u32, - * b: array, - * }; - * @group(0) @binding(0) var f: Foo; - * `; - * const defs = makeShaderDataDefinitions(code); - * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f); - * const numElements = 10; - * const views = makeStructuredViews( - * defs.storages.f, - * new ArrayBuffer(defs.storages.f.size + size * numElements)); - * ``` - * - * @param varDef A variable definition provided by @link {makeShaderDataDefinitions} - * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition. - * If there is no unsized array, size = 0. - */ -export declare function getSizeAndAlignmentOfUnsizedArrayElement(varDef: VariableDefinition | StructDefinition): { - size: number; - align: number; -}; -export {}; diff --git a/dist/1.x/data-definitions.d.ts b/dist/1.x/data-definitions.d.ts deleted file mode 100644 index 78dc8ee..0000000 --- a/dist/1.x/data-definitions.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/// -export type FieldDefinition = { - offset: number; - type: TypeDefinition; -}; -export type FieldDefinitions = { - [x: string]: FieldDefinition; -}; -export type TypeDefinition = { - size: number; -}; -export type StructDefinition = TypeDefinition & { - fields: FieldDefinitions; - size: number; -}; -export type IntrinsicDefinition = TypeDefinition & { - type: string; - numElements?: number; -}; -export type ArrayDefinition = TypeDefinition & { - elementType: TypeDefinition; - numElements: number; -}; -/** - * @group(x) @binding(y) var<...> definition - */ -export interface VariableDefinition { - binding: number; - group: number; - size: number; - typeDefinition: TypeDefinition; -} -export type StructDefinitions = { - [x: string]: StructDefinition; -}; -export type VariableDefinitions = { - [x: string]: VariableDefinition; -}; -export type Resource = { - name: string; - group: number; - entry: GPUBindGroupLayoutEntry; -}; -export type EntryPoint = { - stage: GPUShaderStageFlags; - resources: Resource[]; -}; -export type EntryPoints = { - [x: string]: EntryPoint; -}; -type ShaderDataDefinitions = { - uniforms: VariableDefinitions; - storages: VariableDefinitions; - structs: StructDefinitions; - entryPoints: EntryPoints; -}; -/** - * This should be compatible with GPUProgramableStage - */ -export type ProgrammableStage = { - entryPoint?: string; -}; -/** - * Compatible with GPURenderPipelineDescriptor and GPUComputePipelineDescriptor - */ -export type PipelineDescriptor = { - vertex?: ProgrammableStage; - fragment?: ProgrammableStage; - compute?: ProgrammableStage; -}; -/** - * Gets GPUBindGroupLayoutDescriptors for the given pipeline. - * - * Important: Assumes you pipeline is valid (it doesn't check for errors). - * - * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float - * sampler can not be derived since it is unknown at compile time pipeline creation time - * which texture you'll use. - * - * MAINTENANCE_TODO: Add example - * - * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as - * returned from @link {makeShaderDataDefinitions}. If an array more than 1 - * definition it's assumed the vertex shader is in the first and the fragment - * shader in the second. - * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed - * to `createRenderPipeline` or `createComputePipeline`. - * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to - * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group - * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding. - */ -export declare function makeBindGroupLayoutDescriptors(defs: ShaderDataDefinitions | ShaderDataDefinitions[], desc: PipelineDescriptor): GPUBindGroupLayoutDescriptor[]; -/** - * Given a WGSL shader, returns data definitions for structures, - * uniforms, and storage buffers - * - * Example: - * - * ```js - * const code = ` - * struct MyStruct { - * color: vec4f, - * brightness: f32, - * kernel: array, - * }; - * @group(0) @binding(0) var myUniforms: MyUniforms; - * `; - * const defs = makeShaderDataDefinitions(code); - * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms); - * - * myUniformValues.set({ - * color: [1, 0, 1, 1], - * brightness: 0.8, - * kernel: [ - * 1, 0, -1, - * 2, 0, -2, - * 1, 0, -1, - * ], - * }); - * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer); - * ``` - * - * @param code WGSL shader. Note: it is not required for this to be a complete shader - * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView} - */ -export declare function makeShaderDataDefinitions(code: string): ShaderDataDefinitions; -export {}; diff --git a/dist/1.x/generate-mipmap.d.ts b/dist/1.x/generate-mipmap.d.ts deleted file mode 100644 index 500a725..0000000 --- a/dist/1.x/generate-mipmap.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// -/** - * Converts a `GPUExtent3D` into an array of numbers - * - * `GPUExtent3D` has two forms `[width, height?, depth?]` or - * `{width: number, height?: number, depthOrArrayLayers?: number}` - * - * You pass one of those in here and it returns an array of 3 numbers - * so that your code doesn't have to deal with multiple forms. - * - * @param size - * @returns an array of 3 numbers, [width, height, depthOrArrayLayers] - */ -export declare function normalizeGPUExtent3D(size: GPUExtent3D): number[]; -/** - * Given a GPUExtent3D returns the number of mip levels needed - * - * @param size - * @returns number of mip levels needed for the given size - */ -export declare function numMipLevels(size: GPUExtent3D, dimension?: GPUTextureDimension): number; -/** - * Generates mip levels from level 0 to the last mip for an existing texture - * - * The texture must have been created with TEXTURE_BINDING and RENDER_ATTACHMENT - * and been created with mip levels - * - * @param device A GPUDevice - * @param texture The texture to create mips for - * @param textureBindingViewDimension This is only needed in compatibility mode - * and it is only needed when the texture is going to be used as a cube map. - */ -export declare function generateMipmap(device: GPUDevice, texture: GPUTexture, textureBindingViewDimension?: GPUTextureViewDimension): void; diff --git a/dist/1.x/primitives.d.ts b/dist/1.x/primitives.d.ts deleted file mode 100644 index fcb2569..0000000 --- a/dist/1.x/primitives.d.ts +++ /dev/null @@ -1,277 +0,0 @@ -import { TypedArray } from './typed-arrays.js'; -import { Arrays } from './attribute-utils.js'; -/** - * A class to provide `push` on a typed array. - * - * example: - * - * ```js - * const positions = new TypedArrayWrapper(new Float32Array(300), 3); - * positions.push(1, 2, 3); // add a position - * positions.push([4, 5, 6]); // add a position - * positions.push(new Float32Array(6)); // add 2 positions - * const data = positions.typedArray; - * ``` - */ -export declare class TypedArrayWrapper { - typedArray: T; - cursor: number; - numComponents: number; - constructor(arr: T, numComponents: number); - get numElements(): number; - push(...data: (number | Iterable)[]): void; - reset(index?: number): void; -} -/** - * Creates XY quad vertices - * - * The default with no parameters will return a 2x2 quad with values from -1 to +1. - * If you want a unit quad with that goes from 0 to 1 you'd call it with - * - * createXYQuadVertices(1, 0.5, 0.5); - * - * If you want a unit quad centered above 0,0 you'd call it with - * - * primitives.createXYQuadVertices(1, 0, 0.5); - * - * @param params - * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 - * @param params.xOffset the amount to offset the quad in X. Default = 0 - * @param params.yOffset the amount to offset the quad in Y. Default = 0 - * @return the created XY Quad vertices - */ -export declare function createXYQuadVertices({ size: inSize, xOffset, yOffset }?: { - size?: number | undefined; - xOffset?: number | undefined; - yOffset?: number | undefined; -}): Arrays; -/** - * Creates XZ plane vertices. - * - * The created plane has position, normal, and texcoord data - * - * @param params - * @param params.width Width of the plane. Default = 1 - * @param params.depth Depth of the plane. Default = 1 - * @param params.subdivisionsWidth Number of steps across the plane. Default = 1 - * @param params.subdivisionsDepth Number of steps down the plane. Default = 1 - * @return The created plane vertices. - */ -export declare function createPlaneVertices({ width, depth, subdivisionsWidth, subdivisionsDepth, }?: { - width?: number | undefined; - depth?: number | undefined; - subdivisionsWidth?: number | undefined; - subdivisionsDepth?: number | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates sphere vertices. - * - * The created sphere has position, normal, and texcoord data - * - * @param params - * @param params.radius radius of the sphere. Default = 1 - * @param params.subdivisionsAxis number of steps around the sphere. Default = 24 - * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12 - * @param params.startLatitudeInRadians where to start the - * top of the sphere. Default = 0 - * @param params.endLatitudeInRadians Where to end the - * bottom of the sphere. Default = π - * @param params.startLongitudeInRadians where to start - * wrapping the sphere. Default = 0 - * @param params.endLongitudeInRadians where to end - * wrapping the sphere. Default = 2π - * @return The created sphere vertices. - */ -export declare function createSphereVertices({ radius, subdivisionsAxis, subdivisionsHeight, startLatitudeInRadians, endLatitudeInRadians, startLongitudeInRadians, endLongitudeInRadians, }?: { - radius?: number | undefined; - subdivisionsAxis?: number | undefined; - subdivisionsHeight?: number | undefined; - startLatitudeInRadians?: number | undefined; - endLatitudeInRadians?: number | undefined; - startLongitudeInRadians?: number | undefined; - endLongitudeInRadians?: number | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates the vertices and indices for a cube. - * - * The cube is created around the origin. (-size / 2, size / 2). - * - * @param params - * @param params.size width, height and depth of the cube. Default = 1 - * @return The created vertices. - */ -export declare function createCubeVertices({ size }?: { - size?: number | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates vertices for a truncated cone, which is like a cylinder - * except that it has different top and bottom radii. A truncated cone - * can also be used to create cylinders and regular cones. The - * truncated cone will be created centered about the origin, with the - * y axis as its vertical axis. . - * - * @param bottomRadius Bottom radius of truncated cone. Default = 1 - * @param topRadius Top radius of truncated cone. Default = 0 - * @param height Height of truncated cone. Default = 1 - * @param radialSubdivisions The number of subdivisions around the - * truncated cone. Default = 24 - * @param verticalSubdivisions The number of subdivisions down the - * truncated cone. Default = 1 - * @param topCap Create top cap. Default = true. - * @param bottomCap Create bottom cap. Default = true. - * @return The created cone vertices. - */ -export declare function createTruncatedConeVertices({ bottomRadius, topRadius, height, radialSubdivisions, verticalSubdivisions, topCap, bottomCap, }?: { - bottomRadius?: number | undefined; - topRadius?: number | undefined; - height?: number | undefined; - radialSubdivisions?: number | undefined; - verticalSubdivisions?: number | undefined; - topCap?: boolean | undefined; - bottomCap?: boolean | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates 3D 'F' vertices. - * An 'F' is useful because you can easily tell which way it is oriented. - * The created 'F' has position, normal, texcoord, and color arrays. - * - * @return The created vertices. - */ -export declare function create3DFVertices(): { - [k: string]: Uint8Array | Uint16Array | Float32Array; -}; -/** - * Creates crescent vertices. - * - * @param params - * @param params.verticalRadius The vertical radius of the crescent. Default = 2 - * @param params.outerRadius The outer radius of the crescent. Default = 1 - * @param params.innerRadius The inner radius of the crescent. Default = 0 - * @param params.thickness The thickness of the crescent. Default = 1 - * @param params.subdivisionsDown number of steps around the crescent. Default = 12 - * @param params.startOffset Where to start arc. Default 0. Default = 0 - * @param params.endOffset Where to end arg. Default 1. Default = 1 - * @return The created vertices. - */ -export declare function createCrescentVertices({ verticalRadius, outerRadius, innerRadius, thickness, subdivisionsDown, startOffset, endOffset, }?: { - verticalRadius?: number | undefined; - outerRadius?: number | undefined; - innerRadius?: number | undefined; - thickness?: number | undefined; - subdivisionsDown?: number | undefined; - startOffset?: number | undefined; - endOffset?: number | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates cylinder vertices. The cylinder will be created around the origin - * along the y-axis. - * - * @param params - * @param params.radius Radius of cylinder. Default = 1 - * @param params.height Height of cylinder. Default = 1 - * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24 - * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1 - * @param params.topCap Create top cap. Default = true. - * @param params.bottomCap Create bottom cap. Default = true. - * @return The created vertices. - */ -export declare function createCylinderVertices({ radius, height, radialSubdivisions, verticalSubdivisions, topCap, bottomCap, }?: { - radius?: number | undefined; - height?: number | undefined; - radialSubdivisions?: number | undefined; - verticalSubdivisions?: number | undefined; - topCap?: boolean | undefined; - bottomCap?: boolean | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates vertices for a torus - * - * @param params - * @param params.radius radius of center of torus circle. Default = 1 - * @param params.thickness radius of torus ring. Default = 0.24 - * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24 - * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12 - * @param params.startAngle start angle in radians. Default = 0. - * @param params.endAngle end angle in radians. Default = Math.PI * 2. - * @return The created vertices. - */ -export declare function createTorusVertices({ radius, thickness, radialSubdivisions, bodySubdivisions, startAngle, endAngle, }?: { - radius?: number | undefined; - thickness?: number | undefined; - radialSubdivisions?: number | undefined; - bodySubdivisions?: number | undefined; - startAngle?: number | undefined; - endAngle?: number | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; -/** - * Creates disc vertices. The disc will be in the xz plane, centered at - * the origin. When creating, at least 3 divisions, or pie - * pieces, need to be specified, otherwise the triangles making - * up the disc will be degenerate. You can also specify the - * number of radial pieces `stacks`. A value of 1 for - * stacks will give you a simple disc of pie pieces. If you - * want to create an annulus you can set `innerRadius` to a - * value > 0. Finally, `stackPower` allows you to have the widths - * increase or decrease as you move away from the center. This - * is particularly useful when using the disc as a ground plane - * with a fixed camera such that you don't need the resolution - * of small triangles near the perimeter. For example, a value - * of 2 will produce stacks whose outside radius increases with - * the square of the stack index. A value of 1 will give uniform - * stacks. - * - * @param params - * @param params.radius Radius of the ground plane. Default = 1 - * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24 - * @param params.stacks Number of radial divisions. Default = 1 - * @param params.innerRadius Default = 0 - * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1 - * @return The created vertices. - */ -export declare function createDiscVertices({ radius, divisions, stacks, innerRadius, stackPower, }?: { - radius?: number | undefined; - divisions?: number | undefined; - stacks?: number | undefined; - innerRadius?: number | undefined; - stackPower?: number | undefined; -}): { - position: Float32Array; - normal: Float32Array; - texcoord: Float32Array; - indices: Uint16Array; -}; diff --git a/dist/1.x/texture-utils.d.ts b/dist/1.x/texture-utils.d.ts deleted file mode 100644 index 9855619..0000000 --- a/dist/1.x/texture-utils.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -/// -import { TypedArray } from './typed-arrays.js'; -export type CopyTextureOptions = { - flipY?: boolean; - premultipliedAlpha?: boolean; - colorSpace?: PredefinedColorSpace; - dimension?: GPUTextureViewDimension; - baseArrayLayer?: number; -}; -export type TextureData = { - data: TypedArray | number[]; -}; -export type TextureCreationData = TextureData & { - width?: number; - height?: number; -}; -export type TextureRawDataSource = TextureCreationData | TypedArray | number[]; -export type TextureSource = GPUImageCopyExternalImage['source'] | TextureRawDataSource; -/** - * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers] - */ -export declare function getSizeForMipFromTexture(texture: GPUTexture, mipLevel: number): number[]; -/** - * Copies a an array of "sources" (Video, Canvas, OffscreenCanvas, ImageBitmap) - * to a texture and then optionally generates mip levels - */ -export declare function copySourcesToTexture(device: GPUDevice, texture: GPUTexture, sources: TextureSource[], options?: CopyTextureOptions): void; -/** - * Copies a "source" (Video, Canvas, OffscreenCanvas, ImageBitmap) - * to a texture and then optionally generates mip levels - */ -export declare function copySourceToTexture(device: GPUDevice, texture: GPUTexture, source: TextureSource, options?: CopyTextureOptions): void; -/** - * @property mips if true and mipLevelCount is not set then wll automatically generate - * the correct number of mip levels. - * @property format Defaults to "rgba8unorm" - * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true - */ -export type CreateTextureOptions = CopyTextureOptions & { - mips?: boolean; - usage?: GPUTextureUsageFlags; - format?: GPUTextureFormat; - mipLevelCount?: number; -}; -/** - * Gets the size from a source. This is to smooth out the fact that different - * sources have a different way to get their size. - */ -export declare function getSizeFromSource(source: TextureSource, options: CreateTextureOptions): number[]; -/** - * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap) - * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount - * then it will automatically make the correct number of mip levels. - * - * Example: - * - * ```js - * const texture = createTextureFromSource( - * device, - * [ - * someCanvasOrVideoOrImageImageBitmap0, - * someCanvasOrVideoOrImageImageBitmap1, - * ], - * { - * usage: GPUTextureUsage.TEXTURE_BINDING | - * GPUTextureUsage.RENDER_ATTACHMENT | - * GPUTextureUsage.COPY_DST, - * mips: true, - * } - * ); - * ``` - */ -export declare function createTextureFromSources(device: GPUDevice, sources: TextureSource[], options?: CreateTextureOptions): GPUTexture; -/** - * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap) - * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount - * then it will automatically make the correct number of mip levels. - * - * Example: - * - * ```js - * const texture = createTextureFromSource( - * device, - * someCanvasOrVideoOrImageImageBitmap, - * { - * usage: GPUTextureUsage.TEXTURE_BINDING | - * GPUTextureUsage.RENDER_ATTACHMENT | - * GPUTextureUsage.COPY_DST, - * mips: true, - * } - * ); - * ``` - */ -export declare function createTextureFromSource(device: GPUDevice, source: TextureSource, options?: CreateTextureOptions): GPUTexture; -export type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions; -/** - * Load an ImageBitmap - * @param url - * @param options - * @returns the loaded ImageBitmap - */ -export declare function loadImageBitmap(url: string, options?: ImageBitmapOptions): Promise; -/** - * Load images and create a texture from them, optionally generating mip levels - * - * Assumes all the urls reference images of the same size. - * - * Example: - * - * ```js - * const texture = await createTextureFromImage( - * device, - * [ - * 'https://someimage1.url', - * 'https://someimage2.url', - * ], - * { - * mips: true, - * flipY: true, - * }, - * ); - * ``` - */ -export declare function createTextureFromImages(device: GPUDevice, urls: string[], options?: CreateTextureFromBitmapOptions): Promise; -/** - * Load an image and create a texture from it, optionally generating mip levels - * - * Example: - * - * ```js - * const texture = await createTextureFromImage(device, 'https://someimage.url', { - * mips: true, - * flipY: true, - * }); - * ``` - */ -export declare function createTextureFromImage(device: GPUDevice, url: string, options?: CreateTextureFromBitmapOptions): Promise; diff --git a/dist/1.x/typed-arrays.d.ts b/dist/1.x/typed-arrays.d.ts deleted file mode 100644 index 2baed59..0000000 --- a/dist/1.x/typed-arrays.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor; -export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; -export declare class TypedArrayViewGenerator { - arrayBuffer: ArrayBuffer; - byteOffset: number; - constructor(sizeInBytes: number); - align(alignment: number): void; - pad(numBytes: number): void; - getView(Ctor: TypedArrayConstructor, numElements: number): T; -} -export declare function subarray(arr: TypedArray, offset: number, length: number): T; -export declare const isTypedArray: (arr: any) => any; diff --git a/dist/1.x/utils.d.ts b/dist/1.x/utils.d.ts deleted file mode 100644 index 30b83b7..0000000 --- a/dist/1.x/utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const roundUpToMultipleOf: (v: number, multiple: number) => number; -export declare function keysOf(obj: { - [k in T]: unknown; -}): readonly T[]; -export declare function range(count: number, fn: (i: number) => T): T[]; diff --git a/dist/1.x/webgpu-utils.d.ts b/dist/1.x/webgpu-utils.d.ts deleted file mode 100644 index a85462f..0000000 --- a/dist/1.x/webgpu-utils.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './buffer-views.js'; -export * from './data-definitions.js'; -export * from './generate-mipmap.js'; -export * from './attribute-utils.js'; -export * from './texture-utils.js'; -export * from './typed-arrays.js'; -export * as primitives from './primitives.js'; diff --git a/dist/1.x/webgpu-utils.js b/dist/1.x/webgpu-utils.js deleted file mode 100644 index de2809c..0000000 --- a/dist/1.x/webgpu-utils.js +++ /dev/null @@ -1,6489 +0,0 @@ -/* webgpu-utils@1.3.0, license MIT */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.webgpuUtils = {})); -})(this, (function (exports) { 'use strict'; - - const roundUpToMultipleOf = (v, multiple) => (((v + multiple - 1) / multiple) | 0) * multiple; - function keysOf(obj) { - return Object.keys(obj); - } - function range(count, fn) { - return new Array(count).fill(0).map((_, i) => fn(i)); - } - - class TypedArrayViewGenerator { - arrayBuffer; - byteOffset; - constructor(sizeInBytes) { - this.arrayBuffer = new ArrayBuffer(sizeInBytes); - this.byteOffset = 0; - } - align(alignment) { - this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment); - } - pad(numBytes) { - this.byteOffset += numBytes; - } - getView(Ctor, numElements) { - const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements); - this.byteOffset += view.byteLength; - return view; - } - } - function subarray(arr, offset, length) { - return arr.subarray(offset, offset + length); - } - // TODO: fix better? - const isTypedArray = (arr) => arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number'; - - const b = { - i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array }, - u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array }, - f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array }, - f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array }, - vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array }, - vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array }, - vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array }, - vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array }, - vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array }, - vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array }, - vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array }, - vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array }, - vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array }, - vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array }, - vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array }, - vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array }, - // AlignOf(vecR) SizeOf(array) - mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array }, - mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array }, - mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array }, - mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array }, - mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array }, - mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array }, - mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array }, - mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array }, - mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array }, - mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array }, - mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array }, - mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array }, - mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array }, - mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array }, - // Note: At least as of WGSL V1 you can not create a bool for uniform or storage. - // You can only create one in an internal struct. But, this code generates - // views of structs and it needs to not fail if the struct has a bool - bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array }, - }; - const typeInfo = { - ...b, - 'vec2': b.vec2i, - 'vec2': b.vec2u, - 'vec2': b.vec2f, - 'vec2': b.vec2h, - 'vec3': b.vec3i, - 'vec3': b.vec3u, - 'vec3': b.vec3f, - 'vec3': b.vec3h, - 'vec4': b.vec4i, - 'vec4': b.vec4u, - 'vec4': b.vec4f, - 'vec4': b.vec4h, - 'mat2x2': b.mat2x2f, - 'mat2x2': b.mat2x2h, - 'mat3x2': b.mat3x2f, - 'mat3x2': b.mat3x2h, - 'mat4x2': b.mat4x2f, - 'mat4x2': b.mat4x2h, - 'mat2x3': b.mat2x3f, - 'mat2x3': b.mat2x3h, - 'mat3x3': b.mat3x3f, - 'mat3x3': b.mat3x3h, - 'mat4x3': b.mat4x3f, - 'mat4x3': b.mat4x3h, - 'mat2x4': b.mat2x4f, - 'mat2x4': b.mat2x4h, - 'mat3x4': b.mat3x4f, - 'mat3x4': b.mat3x4h, - 'mat4x4': b.mat4x4f, - 'mat4x4': b.mat4x4h, - }; - const kTypes = keysOf(typeInfo); - /** - * Set which intrinsic types to make views for. - * - * Example: - * - * Given a an array of intrinsics like this - * `array` - * - * The default is to create a single `Float32Array(4 * 200)` - * because creating 200 `Float32Array` views is not usually - * what you want. - * - * If you do want individual views then you'd call - * `setIntrinsicsToView(['vec3f`])` and now you get - * an array of 200 `Float32Array`s. - * - * Note: `setIntrinsicsToView` always sets ALL types. The list you - * pass it is the types you want views created for, all other types - * will be reset to do the default. In other words - * - * ```js - * setIntrinsicsToView(['vec3f`]) - * setIntrinsicsToView(['vec2f`]) - * ``` - * - * Only `vec2f` will have views created. `vec3f` has been reset to the default by - * the second call - * - * You can pass in `true` as the 2nd parameter to make it set which types - * to flatten and all others will be set to have views created. For example - * to expand all types would be `setIntrinsicsToView([], true)`. To expand - * all except `f32` would be `setIntrinsicsToView(['f32'], true)`. - * - * To reset all types to the default call it with no arguments - * - * @param types array of types to make views for - * @param flatten whether to flatten or expand the specified types. - */ - function setIntrinsicsToView(types = [], flatten) { - // we need to track what we've viewed because for example `vec3f` references - // the same info as `vec3` so we'd set one and reset the other. - const visited = new Set(); - for (const type of kTypes) { - const info = typeInfo[type]; - if (!visited.has(info)) { - visited.add(info); - info.flatten = types.includes(type) ? flatten : !flatten; - } - } - } - setIntrinsicsToView(); - // This needs to be fixed! 😱 - function getSizeOfTypeDef(typeDef) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - return asArrayDef.size; - /* - if (isIntrinsic(elementType)) { - const asIntrinsicDef = elementType as IntrinsicDefinition; - const { align } = typeInfo[asIntrinsicDef.type]; - return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements; - } else { - return asArrayDef.numElements * getSizeOfTypeDef(elementType); - } - */ - } - else { - const asStructDef = typeDef; - const numElements = asArrayDef.numElements || 1; - if (asStructDef.fields) { - return typeDef.size * numElements; - } - else { - const asIntrinsicDef = typeDef; - const { align } = typeInfo[asIntrinsicDef.type]; - return numElements > 1 - ? roundUpToMultipleOf(typeDef.size, align) * numElements - : typeDef.size; - } - } - } - // If numElements is undefined this is NOT an array. If it is defined then it IS an array - // Sizes for arrays are different than sizes for non-arrays. Example - // a vec3f non array is Float32Array(3) - // a vec3f array of 2 is Float32Array(4 * 2) - // a vec3f array of 1 is Float32Array(4 * 1) - function makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset, numElements) { - const { size, type } = typeDef; - try { - const { View, align } = typeInfo[type]; - const isArray = numElements !== undefined; - const sizeInBytes = isArray - ? roundUpToMultipleOf(size, align) - : size; - const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT; - const effectiveNumElements = isArray - ? (numElements === 0 - ? (buffer.byteLength - baseOffset) / sizeInBytes - : numElements) - : 1; - return new View(buffer, baseOffset, baseNumElements * effectiveNumElements); - } - catch { - throw new Error(`unknown type: ${type}`); - } - } - function isIntrinsic(typeDef) { - return !typeDef.fields && - !typeDef.elementType; - } - /** - * Creates a set of named TypedArray views on an ArrayBuffer. If you don't - * pass in an ArrayBuffer, one will be created. If you're using an unsized - * array then you must pass in your own arraybuffer - * - * Example: - * - * ```js - * const code = ` - * struct Stuff { - * direction: vec3f, - * strength: f32, - * matrix: mat4x4f, - * }; - * @group(0) @binding(0) var uni: Stuff; - * `; - * const defs = makeShaderDataDefinitions(code); - * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition); - * ``` - * - * views would effectively be - * - * ```js - * views = { - * direction: Float32Array(arrayBuffer, 0, 3), - * strength: Float32Array(arrayBuffer, 3, 4), - * matrix: Float32Array(arraybuffer, 4, 20), - * }; - * ``` - * - * You can use the views directly or you can use @link {setStructuredView} - * - * @param typeDef Definition of the various types of views. - * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created) - * @param offset Optional offset in existing ArrayBuffer to start the views. - * @returns A bunch of named TypedArray views and the ArrayBuffer - */ - function makeTypedArrayViews(typeDef, arrayBuffer, offset) { - const baseOffset = offset || 0; - const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef)); - const makeViews = (typeDef, baseOffset) => { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - // TODO: Should be optional? Per Type? Depth set? Per field? - // The issue is, if we have `array` we don't likely - // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view. - // On the other hand, if we have `array` the maybe we do want - // 10 `Float32Array(16)` views since you might want to do - // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`; - if (isIntrinsic(elementType) && typeInfo[elementType.type].flatten) { - return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements); - } - else { - const { size } = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef); - const effectiveNumElements = asArrayDef.numElements === 0 - ? (buffer.byteLength - baseOffset) / size - : asArrayDef.numElements; - return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * i)); - } - } - else if (typeof typeDef === 'string') { - throw Error('unreachable'); - } - else { - const fields = typeDef.fields; - if (fields) { - const views = {}; - for (const [name, { type, offset }] of Object.entries(fields)) { - views[name] = makeViews(type, baseOffset + offset); - } - return views; - } - else { - return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset); - } - } - }; - return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer }; - } - /** - * Given a set of TypeArrayViews and matching JavaScript data - * sets the content of the views. - * - * Example: - * - * ```js - * const code = ` - * struct Stuff { - * direction: vec3f, - * strength: f32, - * matrix: mat4x4f, - * }; - * @group(0) @binding(0) var uni: Stuff; - * `; - * const defs = makeShaderDataDefinitions(code); - * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition); - * - * setStructuredViews({ - * direction: [1, 2, 3], - * strength: 45, - * matrix: [ - * 1, 0, 0, 0, - * 0, 1, 0, 0, - * 0, 0, 1, 0, - * 0, 0, 0, 1, - * ], - * }); - * ``` - * - * The code above will set the various views, which all point to different - * locations within the same array buffer. - * - * See @link {makeTypedArrayViews}. - * - * @param data The new values - * @param views TypedArray views as returned from {@link makeTypedArrayViews} - */ - function setStructuredView(data, views) { - if (data === undefined) { - return; - } - else if (isTypedArray(views)) { - const view = views; - if (view.length === 1 && typeof data === 'number') { - view[0] = data; - } - else { - if (Array.isArray(data[0]) || isTypedArray(data[0])) { - // complete hack! - // there's no type data here so let's guess based on the user's data - const dataLen = data[0].length; - const stride = dataLen === 3 ? 4 : dataLen; - for (let i = 0; i < data.length; ++i) { - const offset = i * stride; - view.set(data[i], offset); - } - } - else { - view.set(data); - } - } - } - else if (Array.isArray(views)) { - const asArray = views; - data.forEach((newValue, ndx) => { - setStructuredView(newValue, asArray[ndx]); - }); - } - else { - const asViews = views; - for (const [key, newValue] of Object.entries(data)) { - const view = asViews[key]; - if (view) { - setStructuredView(newValue, view); - } - } - } - } - /** - * 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 - */ - function makeStructuredView(varDef, arrayBuffer, offset = 0) { - const asVarDef = varDef; - const typeDef = asVarDef.group === undefined ? varDef : asVarDef.typeDefinition; - const views = makeTypedArrayViews(typeDef, arrayBuffer, offset); - return { - ...views, - set(data) { - setStructuredView(data, views.views); - }, - }; - } - const s_views = new WeakMap(); - function getViewsByCtor(arrayBuffer) { - let viewsByCtor = s_views.get(arrayBuffer); - if (!viewsByCtor) { - viewsByCtor = new Map(); - s_views.set(arrayBuffer, viewsByCtor); - } - return viewsByCtor; - } - function getView(arrayBuffer, Ctor) { - const viewsByCtor = getViewsByCtor(arrayBuffer); - let view = viewsByCtor.get(Ctor); - if (!view) { - view = new Ctor(arrayBuffer); - viewsByCtor.set(Ctor, view); - } - return view; - } - // Is this something like [1,2,3]? - function isArrayLikeOfNumber(data) { - return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number'; - } - function setIntrinsicFromArrayLikeOfNumber(typeDef, data, arrayBuffer, offset) { - const asIntrinsicDefinition = typeDef; - const type = typeInfo[asIntrinsicDefinition.type]; - const view = getView(arrayBuffer, type.View); - const index = offset / view.BYTES_PER_ELEMENT; - if (typeof data === 'number') { - view[index] = data; - } - else { - view.set(data, index); - } - } - /** - * Sets values on an existing array buffer from a TypeDefinition - * @param typeDef A type definition provided by @link {makeShaderDataDefinitions} - * @param data The source data - * @param arrayBuffer The arrayBuffer who's data to set. - * @param offset An offset in the arrayBuffer to start at. - */ - function setTypedValues(typeDef, data, arrayBuffer, offset = 0) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - // It's ArrayDefinition - if (isIntrinsic(elementType)) { - const asIntrinsicDef = elementType; - if (isArrayLikeOfNumber(data)) { - setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset); - return; - } - } - data.forEach((newValue, ndx) => { - setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx); - }); - return; - } - const asStructDef = typeDef; - const fields = asStructDef.fields; - if (fields) { - // It's StructDefinition - for (const [key, newValue] of Object.entries(data)) { - const fieldDef = fields[key]; - if (fieldDef) { - setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset); - } - } - } - else { - // It's IntrinsicDefinition - setIntrinsicFromArrayLikeOfNumber(typeDef, data, arrayBuffer, offset); - } - } - /** - * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}. - * @param varDef A variable definition provided by @link {makeShaderDataDefinitions} - * @param data The source data - * @param arrayBuffer The arrayBuffer who's data to set. - * @param offset An offset in the arrayBuffer to start at. - */ - function setStructuredValues(varDef, data, arrayBuffer, offset = 0) { - setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset); - } - function getAlignmentOfTypeDef(typeDef) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - return getAlignmentOfTypeDef(elementType); - } - const asStructDef = typeDef; - const fields = asStructDef.fields; - if (fields) { - return Object.values(fields).reduce((max, { type }) => Math.max(max, getAlignmentOfTypeDef(type)), 0); - } - const { type } = typeDef; - const { align } = typeInfo[type]; - return align; - } - function getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - const unalignedSize = elementType.size; - const align = getAlignmentOfTypeDef(elementType); - return { - unalignedSize, - align, - size: roundUpToMultipleOf(unalignedSize, align), - }; - } - const asStructDef = typeDef; - const fields = asStructDef.fields; - if (fields) { - const lastField = Object.values(fields).pop(); - if (lastField.type.size === 0) { - return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type); - } - } - return { - size: 0, - unalignedSize: 0, - align: 1, - }; - } - /** - * Returns the size, align, and unalignedSize of "the" unsized array element. Unsized arrays are only - * allowed at the outer most level or the last member of a top level struct. - * - * Example: - * - * ```js - * const code = ` - * struct Foo { - * a: u32, - * b: array, - * }; - * @group(0) @binding(0) var f: Foo; - * `; - * const defs = makeShaderDataDefinitions(code); - * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement( - * defs.storages.f); - * // size = 16 (since you need to allocate 16 bytes per element) - * // align = 16 (since vec3f needs to be aligned to 16 bytes) - * // unalignedSize = 12 (since only 12 bytes are used for a vec3f) - * ``` - * - * Generally you only need size. Example: - * - * ```js - * const code = ` - * struct Foo { - * a: u32, - * b: array, - * }; - * @group(0) @binding(0) var f: Foo; - * `; - * const defs = makeShaderDataDefinitions(code); - * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f); - * const numElements = 10; - * const views = makeStructuredViews( - * defs.storages.f, - * new ArrayBuffer(defs.storages.f.size + size * numElements)); - * ``` - * - * @param varDef A variable definition provided by @link {makeShaderDataDefinitions} - * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition. - * If there is no unsized array, size = 0. - */ - function getSizeAndAlignmentOfUnsizedArrayElement(varDef) { - const asVarDef = varDef; - const typeDef = asVarDef.group === undefined ? varDef : asVarDef.typeDefinition; - return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef); - } - - class ParseContext { - constructor() { - this.constants = new Map(); - this.aliases = new Map(); - this.structs = new Map(); - } - } - /** - * @class Node - * @category AST - * Base class for AST nodes parsed from a WGSL shader. - */ - class Node { - constructor() { } - get isAstNode() { - return true; - } - get astNodeType() { - return ""; - } - evaluate(context) { - throw new Error("Cannot evaluate node"); - } - evaluateString(context) { - return this.evaluate(context).toString(); - } - search(callback) { } - searchBlock(block, callback) { - if (block) { - callback(_BlockStart.instance); - for (const node of block) { - if (node instanceof Array) { - this.searchBlock(node, callback); - } - else { - node.search(callback); - } - } - callback(_BlockEnd.instance); - } - } - } - // For internal use only - class _BlockStart extends Node { - } - _BlockStart.instance = new _BlockStart(); - // For internal use only - class _BlockEnd extends Node { - } - _BlockEnd.instance = new _BlockEnd(); - /** - * @class Statement - * @extends Node - * @category AST - */ - class Statement extends Node { - constructor() { - super(); - } - } - /** - * @class Function - * @extends Statement - * @category AST - */ - class Function extends Statement { - constructor(name, args, returnType, body) { - super(); - this.name = name; - this.args = args; - this.returnType = returnType; - this.body = body; - } - get astNodeType() { - return "function"; - } - search(callback) { - this.searchBlock(this.body, callback); - } - } - /** - * @class StaticAssert - * @extends Statement - * @category AST - */ - class StaticAssert extends Statement { - constructor(expression) { - super(); - this.expression = expression; - } - get astNodeType() { - return "staticAssert"; - } - search(callback) { - this.expression.search(callback); - } - } - /** - * @class While - * @extends Statement - * @category AST - */ - class While extends Statement { - constructor(condition, body) { - super(); - this.condition = condition; - this.body = body; - } - get astNodeType() { - return "while"; - } - search(callback) { - this.condition.search(callback); - this.searchBlock(this.body, callback); - } - } - /** - * @class Continuing - * @extends Statement - * @category AST - */ - class Continuing extends Statement { - constructor(body) { - super(); - this.body = body; - } - get astNodeType() { - return "continuing"; - } - search(callback) { - this.searchBlock(this.body, callback); - } - } - /** - * @class For - * @extends Statement - * @category AST - */ - class For extends Statement { - constructor(init, condition, increment, body) { - super(); - this.init = init; - this.condition = condition; - this.increment = increment; - this.body = body; - } - get astNodeType() { - return "for"; - } - search(callback) { - var _a, _b, _c; - (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback); - (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback); - (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback); - this.searchBlock(this.body, callback); - } - } - /** - * @class Var - * @extends Statement - * @category AST - */ - class Var extends Statement { - constructor(name, type, storage, access, value) { - super(); - this.name = name; - this.type = type; - this.storage = storage; - this.access = access; - this.value = value; - } - get astNodeType() { - return "var"; - } - search(callback) { - var _a; - callback(this); - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } - } - /** - * @class Override - * @extends Statement - * @category AST - */ - class Override extends Statement { - constructor(name, type, value) { - super(); - this.name = name; - this.type = type; - this.value = value; - } - get astNodeType() { - return "override"; - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } - } - /** - * @class Let - * @extends Statement - * @category AST - */ - class Let extends Statement { - constructor(name, type, storage, access, value) { - super(); - this.name = name; - this.type = type; - this.storage = storage; - this.access = access; - this.value = value; - } - get astNodeType() { - return "let"; - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } - } - /** - * @class Const - * @extends Statement - * @category AST - */ - class Const extends Statement { - constructor(name, type, storage, access, value) { - super(); - this.name = name; - this.type = type; - this.storage = storage; - this.access = access; - this.value = value; - } - get astNodeType() { - return "const"; - } - evaluate(context) { - return this.value.evaluate(context); - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } - } - var IncrementOperator; - (function (IncrementOperator) { - IncrementOperator["increment"] = "++"; - IncrementOperator["decrement"] = "--"; - })(IncrementOperator || (IncrementOperator = {})); - (function (IncrementOperator) { - function parse(val) { - const key = val; - if (key == "parse") - throw new Error("Invalid value for IncrementOperator"); - return IncrementOperator[key]; - } - IncrementOperator.parse = parse; - })(IncrementOperator || (IncrementOperator = {})); - /** - * @class Increment - * @extends Statement - * @category AST - */ - class Increment extends Statement { - constructor(operator, variable) { - super(); - this.operator = operator; - this.variable = variable; - } - get astNodeType() { - return "increment"; - } - search(callback) { - this.variable.search(callback); - } - } - var AssignOperator; - (function (AssignOperator) { - AssignOperator["assign"] = "="; - AssignOperator["addAssign"] = "+="; - AssignOperator["subtractAssin"] = "-="; - AssignOperator["multiplyAssign"] = "*="; - AssignOperator["divideAssign"] = "/="; - AssignOperator["moduloAssign"] = "%="; - AssignOperator["andAssign"] = "&="; - AssignOperator["orAssign"] = "|="; - AssignOperator["xorAssign"] = "^="; - AssignOperator["shiftLeftAssign"] = "<<="; - AssignOperator["shiftRightAssign"] = ">>="; - })(AssignOperator || (AssignOperator = {})); - (function (AssignOperator) { - function parse(val) { - const key = val; - if (key == "parse") { - throw new Error("Invalid value for AssignOperator"); - } - //return AssignOperator[key]; - return key; - } - AssignOperator.parse = parse; - })(AssignOperator || (AssignOperator = {})); - /** - * @class Assign - * @extends Statement - * @category AST - */ - class Assign extends Statement { - constructor(operator, variable, value) { - super(); - this.operator = operator; - this.variable = variable; - this.value = value; - } - get astNodeType() { - return "assign"; - } - search(callback) { - this.value.search(callback); - } - } - /** - * @class Call - * @extends Statement - * @category AST - */ - class Call extends Statement { - constructor(name, args) { - super(); - this.name = name; - this.args = args; - } - get astNodeType() { - return "call"; - } - } - /** - * @class Loop - * @extends Statement - * @category AST - */ - class Loop extends Statement { - constructor(body, continuing) { - super(); - this.body = body; - this.continuing = continuing; - } - get astNodeType() { - return "loop"; - } - } - /** - * @class Switch - * @extends Statement - * @category AST - */ - class Switch extends Statement { - constructor(condition, body) { - super(); - this.condition = condition; - this.body = body; - } - get astNodeType() { - return "body"; - } - } - /** - * @class If - * @extends Statement - * @category AST - */ - class If extends Statement { - constructor(condition, body, elseif, _else) { - super(); - this.condition = condition; - this.body = body; - this.elseif = elseif; - this.else = _else; - } - get astNodeType() { - return "if"; - } - search(callback) { - this.condition.search(callback); - this.searchBlock(this.body, callback); - this.searchBlock(this.elseif, callback); - this.searchBlock(this.else, callback); - } - } - /** - * @class Return - * @extends Statement - * @category AST - */ - class Return extends Statement { - constructor(value) { - super(); - this.value = value; - } - get astNodeType() { - return "return"; - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } - } - /** - * @class Enable - * @extends Statement - * @category AST - */ - class Enable extends Statement { - constructor(name) { - super(); - this.name = name; - } - get astNodeType() { - return "enable"; - } - } - /** - * @class Alias - * @extends Statement - * @category AST - */ - class Alias extends Statement { - constructor(name, type) { - super(); - this.name = name; - this.type = type; - } - get astNodeType() { - return "alias"; - } - } - /** - * @class Discard - * @extends Statement - * @category AST - */ - class Discard extends Statement { - constructor() { - super(); - } - get astNodeType() { - return "discard"; - } - } - /** - * @class Break - * @extends Statement - * @category AST - */ - class Break extends Statement { - constructor() { - super(); - } - get astNodeType() { - return "break"; - } - } - /** - * @class Continue - * @extends Statement - * @category AST - */ - class Continue extends Statement { - constructor() { - super(); - } - get astNodeType() { - return "continue"; - } - } - /** - * @class Type - * @extends Statement - * @category AST - */ - class Type extends Statement { - constructor(name) { - super(); - this.name = name; - } - get astNodeType() { - return "type"; - } - get isStruct() { - return false; - } - get isArray() { - return false; - } - } - /** - * @class StructType - * @extends Type - * @category AST - */ - class Struct extends Type { - constructor(name, members) { - super(name); - this.members = members; - } - get astNodeType() { - return "struct"; - } - get isStruct() { - return true; - } - /// Return the index of the member with the given name, or -1 if not found. - getMemberIndex(name) { - for (let i = 0; i < this.members.length; i++) { - if (this.members[i].name == name) - return i; - } - return -1; - } - } - /** - * @class TemplateType - * @extends Type - * @category AST - */ - class TemplateType extends Type { - constructor(name, format, access) { - super(name); - this.format = format; - this.access = access; - } - get astNodeType() { - return "template"; - } - } - /** - * @class PointerType - * @extends Type - * @category AST - */ - class PointerType extends Type { - constructor(name, storage, type, access) { - super(name); - this.storage = storage; - this.type = type; - this.access = access; - } - get astNodeType() { - return "pointer"; - } - } - /** - * @class ArrayType - * @extends Type - * @category AST - */ - class ArrayType extends Type { - constructor(name, attributes, format, count) { - super(name); - this.attributes = attributes; - this.format = format; - this.count = count; - } - get astNodeType() { - return "array"; - } - get isArray() { - return true; - } - } - /** - * @class SamplerType - * @extends Type - * @category AST - */ - class SamplerType extends Type { - constructor(name, format, access) { - super(name); - this.format = format; - this.access = access; - } - get astNodeType() { - return "sampler"; - } - } - /** - * @class Expression - * @extends Node - * @category AST - */ - class Expression extends Node { - constructor() { - super(); - } - } - /** - * @class StringExpr - * @extends Expression - * @category AST - */ - class StringExpr extends Expression { - constructor(value) { - super(); - this.value = value; - } - get astNodeType() { - return "stringExpr"; - } - toString() { - return this.value; - } - evaluateString() { - return this.value; - } - } - /** - * @class CreateExpr - * @extends Expression - * @category AST - */ - class CreateExpr extends Expression { - constructor(type, args) { - super(); - this.type = type; - this.args = args; - } - get astNodeType() { - return "createExpr"; - } - } - /** - * @class CallExpr - * @extends Expression - * @category AST - */ - class CallExpr extends Expression { - constructor(name, args) { - super(); - this.name = name; - this.args = args; - } - get astNodeType() { - return "callExpr"; - } - evaluate(context) { - switch (this.name) { - case "abs": - return Math.abs(this.args[0].evaluate(context)); - case "acos": - return Math.acos(this.args[0].evaluate(context)); - case "acosh": - return Math.acosh(this.args[0].evaluate(context)); - case "asin": - return Math.asin(this.args[0].evaluate(context)); - case "asinh": - return Math.asinh(this.args[0].evaluate(context)); - case "atan": - return Math.atan(this.args[0].evaluate(context)); - case "atan2": - return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "atanh": - return Math.atanh(this.args[0].evaluate(context)); - case "ceil": - return Math.ceil(this.args[0].evaluate(context)); - case "clamp": - return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context)); - case "cos": - return Math.cos(this.args[0].evaluate(context)); - //case "cross": - //TODO: (x[i] * y[j] - x[j] * y[i]) - case "degrees": - return (this.args[0].evaluate(context) * 180) / Math.PI; - //case "determinant": - //TODO implement - case "distance": - return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2)); - case "dot": - //TODO: (x[i] * y[i]) - case "exp": - return Math.exp(this.args[0].evaluate(context)); - case "exp2": - return Math.pow(2, this.args[0].evaluate(context)); - //case "extractBits": - //TODO: implement - //case "firstLeadingBit": - //TODO: implement - case "floor": - return Math.floor(this.args[0].evaluate(context)); - case "fma": - return (this.args[0].evaluate(context) * this.args[1].evaluate(context) + - this.args[2].evaluate(context)); - case "fract": - return (this.args[0].evaluate(context) - - Math.floor(this.args[0].evaluate(context))); - //case "frexp": - //TODO: implement - case "inverseSqrt": - return 1 / Math.sqrt(this.args[0].evaluate(context)); - //case "length": - //TODO: implement - case "log": - return Math.log(this.args[0].evaluate(context)); - case "log2": - return Math.log2(this.args[0].evaluate(context)); - case "max": - return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "min": - return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "mix": - return (this.args[0].evaluate(context) * - (1 - this.args[2].evaluate(context)) + - this.args[1].evaluate(context) * this.args[2].evaluate(context)); - case "modf": - return (this.args[0].evaluate(context) - - Math.floor(this.args[0].evaluate(context))); - case "pow": - return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "radians": - return (this.args[0].evaluate(context) * Math.PI) / 180; - case "round": - return Math.round(this.args[0].evaluate(context)); - case "sign": - return Math.sign(this.args[0].evaluate(context)); - case "sin": - return Math.sin(this.args[0].evaluate(context)); - case "sinh": - return Math.sinh(this.args[0].evaluate(context)); - case "saturate": - return Math.min(Math.max(this.args[0].evaluate(context), 0), 1); - case "smoothstep": - return (this.args[0].evaluate(context) * - this.args[0].evaluate(context) * - (3 - 2 * this.args[0].evaluate(context))); - case "sqrt": - return Math.sqrt(this.args[0].evaluate(context)); - case "step": - return this.args[0].evaluate(context) < this.args[1].evaluate(context) - ? 0 - : 1; - case "tan": - return Math.tan(this.args[0].evaluate(context)); - case "tanh": - return Math.tanh(this.args[0].evaluate(context)); - case "trunc": - return Math.trunc(this.args[0].evaluate(context)); - default: - throw new Error("Non const function: " + this.name); - } - } - search(callback) { - for (const node of this.args) { - node.search(callback); - } - callback(this); - } - } - /** - * @class VariableExpr - * @extends Expression - * @category AST - */ - class VariableExpr extends Expression { - constructor(name) { - super(); - this.name = name; - } - get astNodeType() { - return "varExpr"; - } - search(callback) { - callback(this); - } - } - /** - * @class ConstExpr - * @extends Expression - * @category AST - */ - class ConstExpr extends Expression { - constructor(name, initializer) { - super(); - this.name = name; - this.initializer = initializer; - } - get astNodeType() { - return "constExpr"; - } - evaluate(context) { - var _a, _b; - if (this.initializer instanceof CreateExpr) { - // This is a struct constant - const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context); - const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name; - const struct = context.structs.get(type); - const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property); - if (memberIndex != -1) { - const value = this.initializer.args[memberIndex].evaluate(context); - return value; - } - console.log(memberIndex); - } - return this.initializer.evaluate(context); - } - search(callback) { - this.initializer.search(callback); - } - } - /** - * @class LiteralExpr - * @extends Expression - * @category AST - */ - class LiteralExpr extends Expression { - constructor(value) { - super(); - this.value = value; - } - get astNodeType() { - return "literalExpr"; - } - evaluate() { - return this.value; - } - } - /** - * @class BitcastExpr - * @extends Expression - * @category AST - */ - class BitcastExpr extends Expression { - constructor(type, value) { - super(); - this.type = type; - this.value = value; - } - get astNodeType() { - return "bitcastExpr"; - } - search(callback) { - this.value.search(callback); - } - } - /** - * @class TypecastExpr - * @extends Expression - * @category AST - */ - class TypecastExpr extends Expression { - constructor(type, args) { - super(); - this.type = type; - this.args = args; - } - get astNodeType() { - return "typecastExpr"; - } - evaluate(context) { - return this.args[0].evaluate(context); - } - search(callback) { - this.searchBlock(this.args, callback); - } - } - /** - * @class GroupingExpr - * @extends Expression - * @category AST - */ - class GroupingExpr extends Expression { - constructor(contents) { - super(); - this.contents = contents; - } - get astNodeType() { - return "groupExpr"; - } - evaluate(context) { - return this.contents[0].evaluate(context); - } - search(callback) { - this.searchBlock(this.contents, callback); - } - } - /** - * @class Operator - * @extends Expression - * @category AST - */ - class Operator extends Expression { - constructor() { - super(); - } - } - /** - * @class UnaryOperator - * @extends Operator - * @category AST - * @property {string} operator +, -, !, ~ - */ - class UnaryOperator extends Operator { - constructor(operator, right) { - super(); - this.operator = operator; - this.right = right; - } - get astNodeType() { - return "unaryOp"; - } - evaluate(context) { - switch (this.operator) { - case "+": - return this.right.evaluate(context); - case "-": - return -this.right.evaluate(context); - case "!": - return this.right.evaluate(context) ? 0 : 1; - case "~": - return ~this.right.evaluate(context); - default: - throw new Error("Unknown unary operator: " + this.operator); - } - } - search(callback) { - this.right.search(callback); - } - } - /** - * @class BinaryOperator - * @extends Operator - * @category AST - * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, || - */ - class BinaryOperator extends Operator { - constructor(operator, left, right) { - super(); - this.operator = operator; - this.left = left; - this.right = right; - } - get astNodeType() { - return "binaryOp"; - } - evaluate(context) { - switch (this.operator) { - case "+": - return this.left.evaluate(context) + this.right.evaluate(context); - case "-": - return this.left.evaluate(context) - this.right.evaluate(context); - case "*": - return this.left.evaluate(context) * this.right.evaluate(context); - case "/": - return this.left.evaluate(context) / this.right.evaluate(context); - case "%": - return this.left.evaluate(context) % this.right.evaluate(context); - case "==": - return this.left.evaluate(context) == this.right.evaluate(context) - ? 1 - : 0; - case "!=": - return this.left.evaluate(context) != this.right.evaluate(context) - ? 1 - : 0; - case "<": - return this.left.evaluate(context) < this.right.evaluate(context) - ? 1 - : 0; - case ">": - return this.left.evaluate(context) > this.right.evaluate(context) - ? 1 - : 0; - case "<=": - return this.left.evaluate(context) <= this.right.evaluate(context) - ? 1 - : 0; - case ">=": - return this.left.evaluate(context) >= this.right.evaluate(context) - ? 1 - : 0; - case "&&": - return this.left.evaluate(context) && this.right.evaluate(context) - ? 1 - : 0; - case "||": - return this.left.evaluate(context) || this.right.evaluate(context) - ? 1 - : 0; - default: - throw new Error(`Unknown operator ${this.operator}`); - } - } - search(callback) { - this.left.search(callback); - this.right.search(callback); - } - } - /** - * @class SwitchCase - * @extends Node - * @category AST - */ - class SwitchCase extends Node { - constructor() { - super(); - } - } - /** - * @class Case - * @extends SwitchCase - * @category AST - */ - class Case extends SwitchCase { - constructor(selector, body) { - super(); - this.selector = selector; - this.body = body; - } - get astNodeType() { - return "case"; - } - search(callback) { - this.searchBlock(this.body, callback); - } - } - /** - * @class Default - * @extends SwitchCase - * @category AST - */ - class Default extends SwitchCase { - constructor(body) { - super(); - this.body = body; - } - get astNodeType() { - return "default"; - } - search(callback) { - this.searchBlock(this.body, callback); - } - } - /** - * @class Argument - * @extends Node - * @category AST - */ - class Argument extends Node { - constructor(name, type, attributes) { - super(); - this.name = name; - this.type = type; - this.attributes = attributes; - } - get astNodeType() { - return "argument"; - } - } - /** - * @class ElseIf - * @extends Node - * @category AST - */ - class ElseIf extends Node { - constructor(condition, body) { - super(); - this.condition = condition; - this.body = body; - } - get astNodeType() { - return "elseif"; - } - search(callback) { - this.condition.search(callback); - this.searchBlock(this.body, callback); - } - } - /** - * @class Member - * @extends Node - * @category AST - */ - class Member extends Node { - constructor(name, type, attributes) { - super(); - this.name = name; - this.type = type; - this.attributes = attributes; - } - get astNodeType() { - return "member"; - } - } - /** - * @class Attribute - * @extends Node - * @category AST - */ - class Attribute extends Node { - constructor(name, value) { - super(); - this.name = name; - this.value = value; - } - get astNodeType() { - return "attribute"; - } - } - - var _a; - var TokenClass; - (function (TokenClass) { - TokenClass[TokenClass["token"] = 0] = "token"; - TokenClass[TokenClass["keyword"] = 1] = "keyword"; - TokenClass[TokenClass["reserved"] = 2] = "reserved"; - })(TokenClass || (TokenClass = {})); - class TokenType { - constructor(name, type, rule) { - this.name = name; - this.type = type; - this.rule = rule; - } - toString() { - return this.name; - } - } - /// Catalog of defined token types, keywords, and reserved words. - class TokenTypes { - } - _a = TokenTypes; - TokenTypes.none = new TokenType("", TokenClass.reserved, ""); - TokenTypes.eof = new TokenType("EOF", TokenClass.token, ""); - TokenTypes.reserved = { - asm: new TokenType("asm", TokenClass.reserved, "asm"), - bf16: new TokenType("bf16", TokenClass.reserved, "bf16"), - do: new TokenType("do", TokenClass.reserved, "do"), - enum: new TokenType("enum", TokenClass.reserved, "enum"), - f16: new TokenType("f16", TokenClass.reserved, "f16"), - f64: new TokenType("f64", TokenClass.reserved, "f64"), - handle: new TokenType("handle", TokenClass.reserved, "handle"), - i8: new TokenType("i8", TokenClass.reserved, "i8"), - i16: new TokenType("i16", TokenClass.reserved, "i16"), - i64: new TokenType("i64", TokenClass.reserved, "i64"), - mat: new TokenType("mat", TokenClass.reserved, "mat"), - premerge: new TokenType("premerge", TokenClass.reserved, "premerge"), - regardless: new TokenType("regardless", TokenClass.reserved, "regardless"), - typedef: new TokenType("typedef", TokenClass.reserved, "typedef"), - u8: new TokenType("u8", TokenClass.reserved, "u8"), - u16: new TokenType("u16", TokenClass.reserved, "u16"), - u64: new TokenType("u64", TokenClass.reserved, "u64"), - unless: new TokenType("unless", TokenClass.reserved, "unless"), - using: new TokenType("using", TokenClass.reserved, "using"), - vec: new TokenType("vec", TokenClass.reserved, "vec"), - void: new TokenType("void", TokenClass.reserved, "void"), - }; - TokenTypes.keywords = { - array: new TokenType("array", TokenClass.keyword, "array"), - atomic: new TokenType("atomic", TokenClass.keyword, "atomic"), - bool: new TokenType("bool", TokenClass.keyword, "bool"), - f32: new TokenType("f32", TokenClass.keyword, "f32"), - i32: new TokenType("i32", TokenClass.keyword, "i32"), - mat2x2: new TokenType("mat2x2", TokenClass.keyword, "mat2x2"), - mat2x3: new TokenType("mat2x3", TokenClass.keyword, "mat2x3"), - mat2x4: new TokenType("mat2x4", TokenClass.keyword, "mat2x4"), - mat3x2: new TokenType("mat3x2", TokenClass.keyword, "mat3x2"), - mat3x3: new TokenType("mat3x3", TokenClass.keyword, "mat3x3"), - mat3x4: new TokenType("mat3x4", TokenClass.keyword, "mat3x4"), - mat4x2: new TokenType("mat4x2", TokenClass.keyword, "mat4x2"), - mat4x3: new TokenType("mat4x3", TokenClass.keyword, "mat4x3"), - mat4x4: new TokenType("mat4x4", TokenClass.keyword, "mat4x4"), - ptr: new TokenType("ptr", TokenClass.keyword, "ptr"), - sampler: new TokenType("sampler", TokenClass.keyword, "sampler"), - sampler_comparison: new TokenType("sampler_comparison", TokenClass.keyword, "sampler_comparison"), - struct: new TokenType("struct", TokenClass.keyword, "struct"), - texture_1d: new TokenType("texture_1d", TokenClass.keyword, "texture_1d"), - texture_2d: new TokenType("texture_2d", TokenClass.keyword, "texture_2d"), - texture_2d_array: new TokenType("texture_2d_array", TokenClass.keyword, "texture_2d_array"), - texture_3d: new TokenType("texture_3d", TokenClass.keyword, "texture_3d"), - texture_cube: new TokenType("texture_cube", TokenClass.keyword, "texture_cube"), - texture_cube_array: new TokenType("texture_cube_array", TokenClass.keyword, "texture_cube_array"), - texture_multisampled_2d: new TokenType("texture_multisampled_2d", TokenClass.keyword, "texture_multisampled_2d"), - texture_storage_1d: new TokenType("texture_storage_1d", TokenClass.keyword, "texture_storage_1d"), - texture_storage_2d: new TokenType("texture_storage_2d", TokenClass.keyword, "texture_storage_2d"), - texture_storage_2d_array: new TokenType("texture_storage_2d_array", TokenClass.keyword, "texture_storage_2d_array"), - texture_storage_3d: new TokenType("texture_storage_3d", TokenClass.keyword, "texture_storage_3d"), - texture_depth_2d: new TokenType("texture_depth_2d", TokenClass.keyword, "texture_depth_2d"), - texture_depth_2d_array: new TokenType("texture_depth_2d_array", TokenClass.keyword, "texture_depth_2d_array"), - texture_depth_cube: new TokenType("texture_depth_cube", TokenClass.keyword, "texture_depth_cube"), - texture_depth_cube_array: new TokenType("texture_depth_cube_array", TokenClass.keyword, "texture_depth_cube_array"), - texture_depth_multisampled_2d: new TokenType("texture_depth_multisampled_2d", TokenClass.keyword, "texture_depth_multisampled_2d"), - texture_external: new TokenType("texture_external", TokenClass.keyword, "texture_external"), - u32: new TokenType("u32", TokenClass.keyword, "u32"), - vec2: new TokenType("vec2", TokenClass.keyword, "vec2"), - vec3: new TokenType("vec3", TokenClass.keyword, "vec3"), - vec4: new TokenType("vec4", TokenClass.keyword, "vec4"), - bitcast: new TokenType("bitcast", TokenClass.keyword, "bitcast"), - block: new TokenType("block", TokenClass.keyword, "block"), - break: new TokenType("break", TokenClass.keyword, "break"), - case: new TokenType("case", TokenClass.keyword, "case"), - continue: new TokenType("continue", TokenClass.keyword, "continue"), - continuing: new TokenType("continuing", TokenClass.keyword, "continuing"), - default: new TokenType("default", TokenClass.keyword, "default"), - discard: new TokenType("discard", TokenClass.keyword, "discard"), - else: new TokenType("else", TokenClass.keyword, "else"), - enable: new TokenType("enable", TokenClass.keyword, "enable"), - fallthrough: new TokenType("fallthrough", TokenClass.keyword, "fallthrough"), - false: new TokenType("false", TokenClass.keyword, "false"), - fn: new TokenType("fn", TokenClass.keyword, "fn"), - for: new TokenType("for", TokenClass.keyword, "for"), - function: new TokenType("function", TokenClass.keyword, "function"), - if: new TokenType("if", TokenClass.keyword, "if"), - let: new TokenType("let", TokenClass.keyword, "let"), - const: new TokenType("const", TokenClass.keyword, "const"), - loop: new TokenType("loop", TokenClass.keyword, "loop"), - while: new TokenType("while", TokenClass.keyword, "while"), - private: new TokenType("private", TokenClass.keyword, "private"), - read: new TokenType("read", TokenClass.keyword, "read"), - read_write: new TokenType("read_write", TokenClass.keyword, "read_write"), - return: new TokenType("return", TokenClass.keyword, "return"), - storage: new TokenType("storage", TokenClass.keyword, "storage"), - switch: new TokenType("switch", TokenClass.keyword, "switch"), - true: new TokenType("true", TokenClass.keyword, "true"), - alias: new TokenType("alias", TokenClass.keyword, "alias"), - type: new TokenType("type", TokenClass.keyword, "type"), - uniform: new TokenType("uniform", TokenClass.keyword, "uniform"), - var: new TokenType("var", TokenClass.keyword, "var"), - override: new TokenType("override", TokenClass.keyword, "override"), - workgroup: new TokenType("workgroup", TokenClass.keyword, "workgroup"), - write: new TokenType("write", TokenClass.keyword, "write"), - r8unorm: new TokenType("r8unorm", TokenClass.keyword, "r8unorm"), - r8snorm: new TokenType("r8snorm", TokenClass.keyword, "r8snorm"), - r8uint: new TokenType("r8uint", TokenClass.keyword, "r8uint"), - r8sint: new TokenType("r8sint", TokenClass.keyword, "r8sint"), - r16uint: new TokenType("r16uint", TokenClass.keyword, "r16uint"), - r16sint: new TokenType("r16sint", TokenClass.keyword, "r16sint"), - r16float: new TokenType("r16float", TokenClass.keyword, "r16float"), - rg8unorm: new TokenType("rg8unorm", TokenClass.keyword, "rg8unorm"), - rg8snorm: new TokenType("rg8snorm", TokenClass.keyword, "rg8snorm"), - rg8uint: new TokenType("rg8uint", TokenClass.keyword, "rg8uint"), - rg8sint: new TokenType("rg8sint", TokenClass.keyword, "rg8sint"), - r32uint: new TokenType("r32uint", TokenClass.keyword, "r32uint"), - r32sint: new TokenType("r32sint", TokenClass.keyword, "r32sint"), - r32float: new TokenType("r32float", TokenClass.keyword, "r32float"), - rg16uint: new TokenType("rg16uint", TokenClass.keyword, "rg16uint"), - rg16sint: new TokenType("rg16sint", TokenClass.keyword, "rg16sint"), - rg16float: new TokenType("rg16float", TokenClass.keyword, "rg16float"), - rgba8unorm: new TokenType("rgba8unorm", TokenClass.keyword, "rgba8unorm"), - rgba8unorm_srgb: new TokenType("rgba8unorm_srgb", TokenClass.keyword, "rgba8unorm_srgb"), - rgba8snorm: new TokenType("rgba8snorm", TokenClass.keyword, "rgba8snorm"), - rgba8uint: new TokenType("rgba8uint", TokenClass.keyword, "rgba8uint"), - rgba8sint: new TokenType("rgba8sint", TokenClass.keyword, "rgba8sint"), - bgra8unorm: new TokenType("bgra8unorm", TokenClass.keyword, "bgra8unorm"), - bgra8unorm_srgb: new TokenType("bgra8unorm_srgb", TokenClass.keyword, "bgra8unorm_srgb"), - rgb10a2unorm: new TokenType("rgb10a2unorm", TokenClass.keyword, "rgb10a2unorm"), - rg11b10float: new TokenType("rg11b10float", TokenClass.keyword, "rg11b10float"), - rg32uint: new TokenType("rg32uint", TokenClass.keyword, "rg32uint"), - rg32sint: new TokenType("rg32sint", TokenClass.keyword, "rg32sint"), - rg32float: new TokenType("rg32float", TokenClass.keyword, "rg32float"), - rgba16uint: new TokenType("rgba16uint", TokenClass.keyword, "rgba16uint"), - rgba16sint: new TokenType("rgba16sint", TokenClass.keyword, "rgba16sint"), - rgba16float: new TokenType("rgba16float", TokenClass.keyword, "rgba16float"), - rgba32uint: new TokenType("rgba32uint", TokenClass.keyword, "rgba32uint"), - rgba32sint: new TokenType("rgba32sint", TokenClass.keyword, "rgba32sint"), - rgba32float: new TokenType("rgba32float", TokenClass.keyword, "rgba32float"), - static_assert: new TokenType("static_assert", TokenClass.keyword, "static_assert"), - // WGSL grammar has a few keywords that have different token names than the strings they - // represent. Aliasing them here. - /*int32: new TokenType("i32", TokenClass.keyword, "i32"), - uint32: new TokenType("u32", TokenClass.keyword, "u32"), - float32: new TokenType("f32", TokenClass.keyword, "f32"), - pointer: new TokenType("ptr", TokenClass.keyword, "ptr"),*/ - }; - TokenTypes.tokens = { - 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)/), - 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?))/), - int_literal: new TokenType("int_literal", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/), - uint_literal: new TokenType("uint_literal", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/), - ident: new TokenType("ident", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/), - and: new TokenType("and", TokenClass.token, "&"), - and_and: new TokenType("and_and", TokenClass.token, "&&"), - arrow: new TokenType("arrow ", TokenClass.token, "->"), - attr: new TokenType("attr", TokenClass.token, "@"), - attr_left: new TokenType("attr_left", TokenClass.token, "[["), - attr_right: new TokenType("attr_right", TokenClass.token, "]]"), - forward_slash: new TokenType("forward_slash", TokenClass.token, "/"), - bang: new TokenType("bang", TokenClass.token, "!"), - bracket_left: new TokenType("bracket_left", TokenClass.token, "["), - bracket_right: new TokenType("bracket_right", TokenClass.token, "]"), - brace_left: new TokenType("brace_left", TokenClass.token, "{"), - brace_right: new TokenType("brace_right", TokenClass.token, "}"), - colon: new TokenType("colon", TokenClass.token, ":"), - comma: new TokenType("comma", TokenClass.token, ","), - equal: new TokenType("equal", TokenClass.token, "="), - equal_equal: new TokenType("equal_equal", TokenClass.token, "=="), - not_equal: new TokenType("not_equal", TokenClass.token, "!="), - greater_than: new TokenType("greater_than", TokenClass.token, ">"), - greater_than_equal: new TokenType("greater_than_equal", TokenClass.token, ">="), - shift_right: new TokenType("shift_right", TokenClass.token, ">>"), - less_than: new TokenType("less_than", TokenClass.token, "<"), - less_than_equal: new TokenType("less_than_equal", TokenClass.token, "<="), - shift_left: new TokenType("shift_left", TokenClass.token, "<<"), - modulo: new TokenType("modulo", TokenClass.token, "%"), - minus: new TokenType("minus", TokenClass.token, "-"), - minus_minus: new TokenType("minus_minus", TokenClass.token, "--"), - period: new TokenType("period", TokenClass.token, "."), - plus: new TokenType("plus", TokenClass.token, "+"), - plus_plus: new TokenType("plus_plus", TokenClass.token, "++"), - or: new TokenType("or", TokenClass.token, "|"), - or_or: new TokenType("or_or", TokenClass.token, "||"), - paren_left: new TokenType("paren_left", TokenClass.token, "("), - paren_right: new TokenType("paren_right", TokenClass.token, ")"), - semicolon: new TokenType("semicolon", TokenClass.token, ";"), - star: new TokenType("star", TokenClass.token, "*"), - tilde: new TokenType("tilde", TokenClass.token, "~"), - underscore: new TokenType("underscore", TokenClass.token, "_"), - xor: new TokenType("xor", TokenClass.token, "^"), - plus_equal: new TokenType("plus_equal", TokenClass.token, "+="), - minus_equal: new TokenType("minus_equal", TokenClass.token, "-="), - times_equal: new TokenType("times_equal", TokenClass.token, "*="), - division_equal: new TokenType("division_equal", TokenClass.token, "/="), - modulo_equal: new TokenType("modulo_equal", TokenClass.token, "%="), - and_equal: new TokenType("and_equal", TokenClass.token, "&="), - or_equal: new TokenType("or_equal", TokenClass.token, "|="), - xor_equal: new TokenType("xor_equal", TokenClass.token, "^="), - shift_right_equal: new TokenType("shift_right_equal", TokenClass.token, ">>="), - shift_left_equal: new TokenType("shift_left_equal", TokenClass.token, "<<="), - }; - TokenTypes.storage_class = [ - _a.keywords.function, - _a.keywords.private, - _a.keywords.workgroup, - _a.keywords.uniform, - _a.keywords.storage, - ]; - TokenTypes.access_mode = [ - _a.keywords.read, - _a.keywords.write, - _a.keywords.read_write, - ]; - TokenTypes.sampler_type = [ - _a.keywords.sampler, - _a.keywords.sampler_comparison, - ]; - TokenTypes.sampled_texture_type = [ - _a.keywords.texture_1d, - _a.keywords.texture_2d, - _a.keywords.texture_2d_array, - _a.keywords.texture_3d, - _a.keywords.texture_cube, - _a.keywords.texture_cube_array, - ]; - TokenTypes.multisampled_texture_type = [ - _a.keywords.texture_multisampled_2d, - ]; - TokenTypes.storage_texture_type = [ - _a.keywords.texture_storage_1d, - _a.keywords.texture_storage_2d, - _a.keywords.texture_storage_2d_array, - _a.keywords.texture_storage_3d, - ]; - TokenTypes.depth_texture_type = [ - _a.keywords.texture_depth_2d, - _a.keywords.texture_depth_2d_array, - _a.keywords.texture_depth_cube, - _a.keywords.texture_depth_cube_array, - _a.keywords.texture_depth_multisampled_2d, - ]; - TokenTypes.texture_external_type = [_a.keywords.texture_external]; - TokenTypes.any_texture_type = [ - ..._a.sampled_texture_type, - ..._a.multisampled_texture_type, - ..._a.storage_texture_type, - ..._a.depth_texture_type, - ..._a.texture_external_type, - ]; - TokenTypes.texel_format = [ - _a.keywords.r8unorm, - _a.keywords.r8snorm, - _a.keywords.r8uint, - _a.keywords.r8sint, - _a.keywords.r16uint, - _a.keywords.r16sint, - _a.keywords.r16float, - _a.keywords.rg8unorm, - _a.keywords.rg8snorm, - _a.keywords.rg8uint, - _a.keywords.rg8sint, - _a.keywords.r32uint, - _a.keywords.r32sint, - _a.keywords.r32float, - _a.keywords.rg16uint, - _a.keywords.rg16sint, - _a.keywords.rg16float, - _a.keywords.rgba8unorm, - _a.keywords.rgba8unorm_srgb, - _a.keywords.rgba8snorm, - _a.keywords.rgba8uint, - _a.keywords.rgba8sint, - _a.keywords.bgra8unorm, - _a.keywords.bgra8unorm_srgb, - _a.keywords.rgb10a2unorm, - _a.keywords.rg11b10float, - _a.keywords.rg32uint, - _a.keywords.rg32sint, - _a.keywords.rg32float, - _a.keywords.rgba16uint, - _a.keywords.rgba16sint, - _a.keywords.rgba16float, - _a.keywords.rgba32uint, - _a.keywords.rgba32sint, - _a.keywords.rgba32float, - ]; - TokenTypes.const_literal = [ - _a.tokens.int_literal, - _a.tokens.uint_literal, - _a.tokens.decimal_float_literal, - _a.tokens.hex_float_literal, - _a.keywords.true, - _a.keywords.false, - ]; - TokenTypes.literal_or_ident = [ - _a.tokens.ident, - _a.tokens.int_literal, - _a.tokens.uint_literal, - _a.tokens.decimal_float_literal, - _a.tokens.hex_float_literal, - ]; - TokenTypes.element_count_expression = [ - _a.tokens.int_literal, - _a.tokens.uint_literal, - _a.tokens.ident, - ]; - TokenTypes.template_types = [ - _a.keywords.vec2, - _a.keywords.vec3, - _a.keywords.vec4, - _a.keywords.mat2x2, - _a.keywords.mat2x3, - _a.keywords.mat2x4, - _a.keywords.mat3x2, - _a.keywords.mat3x3, - _a.keywords.mat3x4, - _a.keywords.mat4x2, - _a.keywords.mat4x3, - _a.keywords.mat4x4, - _a.keywords.atomic, - _a.keywords.bitcast, - ..._a.any_texture_type, - ]; - // The grammar calls out 'block', but attribute grammar is defined to use a 'ident'. - // The attribute grammar should be ident | block. - TokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block]; - TokenTypes.assignment_operators = [ - _a.tokens.equal, - _a.tokens.plus_equal, - _a.tokens.minus_equal, - _a.tokens.times_equal, - _a.tokens.division_equal, - _a.tokens.modulo_equal, - _a.tokens.and_equal, - _a.tokens.or_equal, - _a.tokens.xor_equal, - _a.tokens.shift_right_equal, - _a.tokens.shift_left_equal, - ]; - TokenTypes.increment_operators = [ - _a.tokens.plus_plus, - _a.tokens.minus_minus, - ]; - /// A token parsed by the WgslScanner. - class Token { - constructor(type, lexeme, line) { - this.type = type; - this.lexeme = lexeme; - this.line = line; - } - toString() { - return this.lexeme; - } - isTemplateType() { - return TokenTypes.template_types.indexOf(this.type) != -1; - } - isArrayType() { - return this.type == TokenTypes.keywords.array; - } - isArrayOrTemplateType() { - return this.isArrayType() || this.isTemplateType(); - } - } - /// Lexical scanner for the WGSL language. This takes an input source text and generates a list - /// of Token objects, which can then be fed into the WgslParser to generate an AST. - class WgslScanner { - constructor(source) { - this._tokens = []; - this._start = 0; - this._current = 0; - this._line = 1; - this._source = source !== null && source !== void 0 ? source : ""; - } - /// Scan all tokens from the source. - scanTokens() { - while (!this._isAtEnd()) { - this._start = this._current; - if (!this.scanToken()) - throw `Invalid syntax at line ${this._line}`; - } - this._tokens.push(new Token(TokenTypes.eof, "", this._line)); - return this._tokens; - } - /// Scan a single token from the source. - scanToken() { - // Find the longest consecutive set of characters that match a rule. - let lexeme = this._advance(); - // Skip line-feed, adding to the line counter. - if (lexeme == "\n") { - this._line++; - return true; - } - // Skip whitespace - if (this._isWhitespace(lexeme)) { - return true; - } - if (lexeme == "/") { - // If it's a // comment, skip everything until the next line-feed. - if (this._peekAhead() == "/") { - while (lexeme != "\n") { - if (this._isAtEnd()) - return true; - lexeme = this._advance(); - } - // skip the linefeed - this._line++; - return true; - } - else if (this._peekAhead() == "*") { - // If it's a / * block comment, skip everything until the matching * /, - // allowing for nested block comments. - this._advance(); - let commentLevel = 1; - while (commentLevel > 0) { - if (this._isAtEnd()) - return true; - lexeme = this._advance(); - if (lexeme == "\n") { - this._line++; - } - else if (lexeme == "*") { - if (this._peekAhead() == "/") { - this._advance(); - commentLevel--; - if (commentLevel == 0) { - return true; - } - } - } - else if (lexeme == "/") { - if (this._peekAhead() == "*") { - this._advance(); - commentLevel++; - } - } - } - return true; - } - } - let matchType = TokenTypes.none; - for (;;) { - let matchedType = this._findType(lexeme); - // An exception to "longest lexeme" rule is '>>'. In the case of 1>>2, it's a - // shift_right. - // In the case of array>, it's two greater_than's (one to close the vec4, - // and one to close the array). - // Another ambiguity is '>='. In the case of vec2=vec2(1,2), - // it's a greather_than and an equal, not a greater_than_equal. - // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases - // are predicated on it the > either closing a template, or being part of an operator. - // The solution here is to check if there was a less_than up to some number of tokens - // previously, and the token prior to that is a keyword that requires a '<', then it will be - // split into two operators; otherwise it's a single operator. - const nextLexeme = this._peekAhead(); - if (lexeme == ">" && (nextLexeme == ">" || nextLexeme == "=")) { - let foundLessThan = false; - let ti = this._tokens.length - 1; - for (let count = 0; count < 5 && ti >= 0; ++count, --ti) { - if (this._tokens[ti].type === TokenTypes.tokens.less_than) { - if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) { - foundLessThan = true; - } - break; - } - } - // If there was a less_than in the recent token history, then this is probably a - // greater_than. - if (foundLessThan) { - this._addToken(matchedType); - return true; - } - } - // The current lexeme may not match any rule, but some token types may be invalid for - // part of the string but valid after a few more characters. - // For example, 0x.5 is a hex_float_literal. But as it's being scanned, - // "0" is a int_literal, then "0x" is invalid. If we stopped there, it would return - // the int_literal "0", but that's incorrect. So if we look forward a few characters, - // we'd get "0x.", which is still invalid, followed by "0x.5" which is the correct - // hex_float_literal. So that means if we hit an non-matching string, we should look - // ahead up to two characters to see if the string starts matching a valid rule again. - if (matchedType === TokenTypes.none) { - let lookAheadLexeme = lexeme; - let lookAhead = 0; - const maxLookAhead = 2; - for (let li = 0; li < maxLookAhead; ++li) { - lookAheadLexeme += this._peekAhead(li); - matchedType = this._findType(lookAheadLexeme); - if (matchedType !== TokenTypes.none) { - lookAhead = li; - break; - } - } - if (matchedType === TokenTypes.none) { - if (matchType === TokenTypes.none) - return false; - this._current--; - this._addToken(matchType); - return true; - } - lexeme = lookAheadLexeme; - this._current += lookAhead + 1; - } - matchType = matchedType; - if (this._isAtEnd()) - break; - lexeme += this._advance(); - } - // We got to the end of the input stream. Then the token we've ready so far is it. - if (matchType === TokenTypes.none) - return false; - this._addToken(matchType); - return true; - } - _findType(lexeme) { - for (const name in TokenTypes.keywords) { - const type = TokenTypes.keywords[name]; - if (this._match(lexeme, type.rule)) { - return type; - } - } - for (const name in TokenTypes.tokens) { - const type = TokenTypes.tokens[name]; - if (this._match(lexeme, type.rule)) { - return type; - } - } - return TokenTypes.none; - } - _match(lexeme, rule) { - if (typeof rule === "string") { - if (rule == lexeme) { - return true; - } - } - else { - // regex - const match = rule.exec(lexeme); - if (match && match.index == 0 && match[0] == lexeme) - return true; - } - return false; - } - _isAtEnd() { - return this._current >= this._source.length; - } - _isWhitespace(c) { - return c == " " || c == "\t" || c == "\r"; - } - _advance(amount = 0) { - let c = this._source[this._current]; - amount = amount || 0; - amount++; - this._current += amount; - return c; - } - _peekAhead(offset = 0) { - offset = offset || 0; - if (this._current + offset >= this._source.length) - return "\0"; - return this._source[this._current + offset]; - } - _addToken(type) { - const text = this._source.substring(this._start, this._current); - this._tokens.push(new Token(type, text, this._line)); - } - } - - /** - * @author Brendan Duncan / https://github.com/brendan-duncan - */ - /// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST). - class WgslParser { - constructor() { - this._tokens = []; - this._current = 0; - this._context = new ParseContext(); - } - parse(tokensOrCode) { - this._initialize(tokensOrCode); - let statements = []; - while (!this._isAtEnd()) { - const statement = this._global_decl_or_directive(); - if (!statement) - break; - statements.push(statement); - } - return statements; - } - _initialize(tokensOrCode) { - if (tokensOrCode) { - if (typeof tokensOrCode == "string") { - const scanner = new WgslScanner(tokensOrCode); - this._tokens = scanner.scanTokens(); - } - else { - this._tokens = tokensOrCode; - } - } - else { - this._tokens = []; - } - this._current = 0; - } - _error(token, message) { - console.error(token, message); - return { - token, - message, - toString: function () { - return `${message}`; - }, - }; - } - _isAtEnd() { - return (this._current >= this._tokens.length || - this._peek().type == TokenTypes.eof); - } - _match(types) { - if (types instanceof TokenType) { - if (this._check(types)) { - this._advance(); - return true; - } - return false; - } - for (let i = 0, l = types.length; i < l; ++i) { - const type = types[i]; - if (this._check(type)) { - this._advance(); - return true; - } - } - return false; - } - _consume(types, message) { - if (this._check(types)) - return this._advance(); - throw this._error(this._peek(), message); - } - _check(types) { - if (this._isAtEnd()) - return false; - const tk = this._peek(); - if (types instanceof Array) { - let t = tk.type; - let index = types.indexOf(t); - return index != -1; - } - return tk.type == types; - } - _advance() { - if (!this._isAtEnd()) - this._current++; - return this._previous(); - } - _peek() { - return this._tokens[this._current]; - } - _previous() { - return this._tokens[this._current - 1]; - } - _global_decl_or_directive() { - // semicolon - // global_variable_decl semicolon - // global_constant_decl semicolon - // type_alias semicolon - // struct_decl - // function_decl - // enable_directive - // Ignore any stand-alone semicolons - while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd()) - ; - if (this._match(TokenTypes.keywords.alias)) { - const type = this._type_alias(); - this._consume(TokenTypes.tokens.semicolon, "Expected ';'"); - return type; - } - if (this._match(TokenTypes.keywords.enable)) { - const enable = this._enable_directive(); - this._consume(TokenTypes.tokens.semicolon, "Expected ';'"); - return enable; - } - // The following statements have an optional attribute* - const attrs = this._attribute(); - if (this._check(TokenTypes.keywords.var)) { - const _var = this._global_variable_decl(); - if (_var != null) - _var.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _var; - } - if (this._check(TokenTypes.keywords.override)) { - const _override = this._override_variable_decl(); - if (_override != null) - _override.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _override; - } - if (this._check(TokenTypes.keywords.let)) { - const _let = this._global_let_decl(); - if (_let != null) - _let.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _let; - } - if (this._check(TokenTypes.keywords.const)) { - const _const = this._global_const_decl(); - if (_const != null) - _const.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _const; - } - if (this._check(TokenTypes.keywords.struct)) { - const _struct = this._struct_decl(); - if (_struct != null) - _struct.attributes = attrs; - return _struct; - } - if (this._check(TokenTypes.keywords.fn)) { - const _fn = this._function_decl(); - if (_fn != null) - _fn.attributes = attrs; - return _fn; - } - return null; - } - _function_decl() { - // attribute* function_header compound_statement - // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)? - if (!this._match(TokenTypes.keywords.fn)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected function name.").toString(); - this._consume(TokenTypes.tokens.paren_left, "Expected '(' for function arguments."); - const args = []; - if (!this._check(TokenTypes.tokens.paren_right)) { - do { - if (this._check(TokenTypes.tokens.paren_right)) - break; - const argAttrs = this._attribute(); - const name = this._consume(TokenTypes.tokens.ident, "Expected argument name.").toString(); - this._consume(TokenTypes.tokens.colon, "Expected ':' for argument type."); - const typeAttrs = this._attribute(); - const type = this._type_decl(); - if (type != null) { - type.attributes = typeAttrs; - args.push(new Argument(name, type, argAttrs)); - } - } while (this._match(TokenTypes.tokens.comma)); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')' after function arguments."); - let _return = null; - if (this._match(TokenTypes.tokens.arrow)) { - const attrs = this._attribute(); - _return = this._type_decl(); - if (_return != null) - _return.attributes = attrs; - } - const body = this._compound_statement(); - return new Function(name, args, _return, body); - } - _compound_statement() { - // brace_left statement* brace_right - const statements = []; - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for block."); - while (!this._check(TokenTypes.tokens.brace_right)) { - const statement = this._statement(); - if (statement !== null) - statements.push(statement); - } - this._consume(TokenTypes.tokens.brace_right, "Expected '}' for block."); - return statements; - } - _statement() { - // semicolon - // return_statement semicolon - // if_statement - // switch_statement - // loop_statement - // for_statement - // func_call_statement semicolon - // variable_statement semicolon - // break_statement semicolon - // continue_statement semicolon - // continuing_statement compound_statement - // discard semicolon - // assignment_statement semicolon - // compound_statement - // increment_statement semicolon - // decrement_statement semicolon - // static_assert_statement semicolon - // Ignore any stand-alone semicolons - while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd()) - ; - if (this._check(TokenTypes.keywords.if)) - return this._if_statement(); - if (this._check(TokenTypes.keywords.switch)) - return this._switch_statement(); - if (this._check(TokenTypes.keywords.loop)) - return this._loop_statement(); - if (this._check(TokenTypes.keywords.for)) - return this._for_statement(); - if (this._check(TokenTypes.keywords.while)) - return this._while_statement(); - if (this._check(TokenTypes.keywords.continuing)) - return this._continuing_statement(); - if (this._check(TokenTypes.keywords.static_assert)) - return this._static_assert_statement(); - if (this._check(TokenTypes.tokens.brace_left)) - return this._compound_statement(); - let result = null; - if (this._check(TokenTypes.keywords.return)) - result = this._return_statement(); - else if (this._check([ - TokenTypes.keywords.var, - TokenTypes.keywords.let, - TokenTypes.keywords.const, - ])) - result = this._variable_statement(); - else if (this._match(TokenTypes.keywords.discard)) - result = new Discard(); - else if (this._match(TokenTypes.keywords.break)) - result = new Break(); - else if (this._match(TokenTypes.keywords.continue)) - result = new Continue(); - else - result = - this._increment_decrement_statement() || - this._func_call_statement() || - this._assignment_statement(); - if (result != null) - this._consume(TokenTypes.tokens.semicolon, "Expected ';' after statement."); - return result; - } - _static_assert_statement() { - if (!this._match(TokenTypes.keywords.static_assert)) - return null; - let expression = this._optional_paren_expression(); - return new StaticAssert(expression); - } - _while_statement() { - if (!this._match(TokenTypes.keywords.while)) - return null; - let condition = this._optional_paren_expression(); - const block = this._compound_statement(); - return new While(condition, block); - } - _continuing_statement() { - if (!this._match(TokenTypes.keywords.continuing)) - return null; - const block = this._compound_statement(); - return new Continuing(block); - } - _for_statement() { - // for paren_left for_header paren_right compound_statement - if (!this._match(TokenTypes.keywords.for)) - return null; - this._consume(TokenTypes.tokens.paren_left, "Expected '('."); - // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)? - const init = !this._check(TokenTypes.tokens.semicolon) - ? this._for_init() - : null; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - const condition = !this._check(TokenTypes.tokens.semicolon) - ? this._short_circuit_or_expression() - : null; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - const increment = !this._check(TokenTypes.tokens.paren_right) - ? this._for_increment() - : null; - this._consume(TokenTypes.tokens.paren_right, "Expected ')'."); - const body = this._compound_statement(); - return new For(init, condition, increment, body); - } - _for_init() { - // (variable_statement assignment_statement func_call_statement)? - return (this._variable_statement() || - this._func_call_statement() || - this._assignment_statement()); - } - _for_increment() { - // (assignment_statement func_call_statement increment_statement)? - return (this._func_call_statement() || - this._increment_decrement_statement() || - this._assignment_statement()); - } - _variable_statement() { - // variable_decl - // variable_decl equal short_circuit_or_expression - // let (ident variable_ident_decl) equal short_circuit_or_expression - // const (ident variable_ident_decl) equal short_circuit_or_expression - if (this._check(TokenTypes.keywords.var)) { - const _var = this._variable_decl(); - if (_var === null) - throw this._error(this._peek(), "Variable declaration expected."); - let value = null; - if (this._match(TokenTypes.tokens.equal)) - value = this._short_circuit_or_expression(); - return new Var(_var.name, _var.type, _var.storage, _var.access, value); - } - if (this._match(TokenTypes.keywords.let)) { - const name = this._consume(TokenTypes.tokens.ident, "Expected name for let.").toString(); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const typeAttrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = typeAttrs; - } - this._consume(TokenTypes.tokens.equal, "Expected '=' for let."); - const value = this._short_circuit_or_expression(); - return new Let(name, type, null, null, value); - } - if (this._match(TokenTypes.keywords.const)) { - const name = this._consume(TokenTypes.tokens.ident, "Expected name for const.").toString(); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const typeAttrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = typeAttrs; - } - this._consume(TokenTypes.tokens.equal, "Expected '=' for const."); - const value = this._short_circuit_or_expression(); - return new Const(name, type, null, null, value); - } - return null; - } - _increment_decrement_statement() { - const savedPos = this._current; - const _var = this._unary_expression(); - if (_var == null) - return null; - if (!this._check(TokenTypes.increment_operators)) { - this._current = savedPos; - return null; - } - const token = this._consume(TokenTypes.increment_operators, "Expected increment operator"); - return new Increment(token.type === TokenTypes.tokens.plus_plus - ? IncrementOperator.increment - : IncrementOperator.decrement, _var); - } - _assignment_statement() { - // (unary_expression underscore) equal short_circuit_or_expression - let _var = null; - if (this._check(TokenTypes.tokens.brace_right)) { - return null; - } - let isUnderscore = this._match(TokenTypes.tokens.underscore); - if (!isUnderscore) { - _var = this._unary_expression(); - } - if (!isUnderscore && _var == null) { - return null; - } - const type = this._consume(TokenTypes.assignment_operators, "Expected assignment operator."); - const value = this._short_circuit_or_expression(); - return new Assign(AssignOperator.parse(type.lexeme), _var, value); - } - _func_call_statement() { - // ident argument_expression_list - if (!this._check(TokenTypes.tokens.ident)) - return null; - const savedPos = this._current; - const name = this._consume(TokenTypes.tokens.ident, "Expected function name."); - const args = this._argument_expression_list(); - if (args === null) { - this._current = savedPos; - return null; - } - return new Call(name.lexeme, args); - } - _loop_statement() { - // loop brace_left statement* continuing_statement? brace_right - if (!this._match(TokenTypes.keywords.loop)) - return null; - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for loop."); - // statement* - const statements = []; - let statement = this._statement(); - while (statement !== null) { - if (Array.isArray(statement)) { - for (let s of statement) { - statements.push(s); - } - } - else { - statements.push(statement); - } - statement = this._statement(); - } - // continuing_statement: continuing compound_statement - let continuing = null; - if (this._match(TokenTypes.keywords.continuing)) - continuing = this._compound_statement(); - this._consume(TokenTypes.tokens.brace_right, "Expected '}' for loop."); - return new Loop(statements, continuing); - } - _switch_statement() { - // switch optional_paren_expression brace_left switch_body+ brace_right - if (!this._match(TokenTypes.keywords.switch)) - return null; - const condition = this._optional_paren_expression(); - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for switch."); - const body = this._switch_body(); - if (body == null || body.length == 0) - throw this._error(this._previous(), "Expected 'case' or 'default'."); - this._consume(TokenTypes.tokens.brace_right, "Expected '}' for switch."); - return new Switch(condition, body); - } - _switch_body() { - // case case_selectors colon brace_left case_body? brace_right - // default colon brace_left case_body? brace_right - const cases = []; - if (this._match(TokenTypes.keywords.case)) { - const selector = this._case_selectors(); - this._match(TokenTypes.tokens.colon); // colon is optional - this._consume(TokenTypes.tokens.brace_left, "Exected '{' for switch case."); - const body = this._case_body(); - this._consume(TokenTypes.tokens.brace_right, "Exected '}' for switch case."); - cases.push(new Case(selector, body)); - } - if (this._match(TokenTypes.keywords.default)) { - this._match(TokenTypes.tokens.colon); // colon is optional - this._consume(TokenTypes.tokens.brace_left, "Exected '{' for switch default."); - const body = this._case_body(); - this._consume(TokenTypes.tokens.brace_right, "Exected '}' for switch default."); - cases.push(new Default(body)); - } - if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) { - const _cases = this._switch_body(); - cases.push(_cases[0]); - } - return cases; - } - _case_selectors() { - var _a, _b, _c, _d; - // const_literal (comma const_literal)* comma? - const selectors = [ - (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : "", - ]; - while (this._match(TokenTypes.tokens.comma)) { - selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : ""); - } - return selectors; - } - _case_body() { - // statement case_body? - // fallthrough semicolon - if (this._match(TokenTypes.keywords.fallthrough)) { - this._consume(TokenTypes.tokens.semicolon, "Expected ';'"); - return []; - } - let statement = this._statement(); - if (statement == null) - return []; - if (!(statement instanceof Array)) { - statement = [statement]; - } - const nextStatement = this._case_body(); - if (nextStatement.length == 0) - return statement; - return [...statement, nextStatement[0]]; - } - _if_statement() { - // if optional_paren_expression compound_statement elseif_statement? else_statement? - if (!this._match(TokenTypes.keywords.if)) - return null; - const condition = this._optional_paren_expression(); - const block = this._compound_statement(); - let elseif = []; - if (this._match_elseif()) { - elseif = this._elseif_statement(elseif); - } - let _else = null; - if (this._match(TokenTypes.keywords.else)) - _else = this._compound_statement(); - return new If(condition, block, elseif, _else); - } - _match_elseif() { - if (this._tokens[this._current].type === TokenTypes.keywords.else && - this._tokens[this._current + 1].type === TokenTypes.keywords.if) { - this._advance(); - this._advance(); - return true; - } - return false; - } - _elseif_statement(elseif = []) { - // else_if optional_paren_expression compound_statement elseif_statement? - const condition = this._optional_paren_expression(); - const block = this._compound_statement(); - elseif.push(new ElseIf(condition, block)); - if (this._match_elseif()) { - this._elseif_statement(elseif); - } - return elseif; - } - _return_statement() { - // return short_circuit_or_expression? - if (!this._match(TokenTypes.keywords.return)) - return null; - const value = this._short_circuit_or_expression(); - return new Return(value); - } - _short_circuit_or_expression() { - // short_circuit_and_expression - // short_circuit_or_expression or_or short_circuit_and_expression - let expr = this._short_circuit_and_expr(); - while (this._match(TokenTypes.tokens.or_or)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr()); - } - return expr; - } - _short_circuit_and_expr() { - // inclusive_or_expression - // short_circuit_and_expression and_and inclusive_or_expression - let expr = this._inclusive_or_expression(); - while (this._match(TokenTypes.tokens.and_and)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression()); - } - return expr; - } - _inclusive_or_expression() { - // exclusive_or_expression - // inclusive_or_expression or exclusive_or_expression - let expr = this._exclusive_or_expression(); - while (this._match(TokenTypes.tokens.or)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression()); - } - return expr; - } - _exclusive_or_expression() { - // and_expression - // exclusive_or_expression xor and_expression - let expr = this._and_expression(); - while (this._match(TokenTypes.tokens.xor)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression()); - } - return expr; - } - _and_expression() { - // equality_expression - // and_expression and equality_expression - let expr = this._equality_expression(); - while (this._match(TokenTypes.tokens.and)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression()); - } - return expr; - } - _equality_expression() { - // relational_expression - // relational_expression equal_equal relational_expression - // relational_expression not_equal relational_expression - const expr = this._relational_expression(); - if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) { - return new BinaryOperator(this._previous().toString(), expr, this._relational_expression()); - } - return expr; - } - _relational_expression() { - // shift_expression - // relational_expression less_than shift_expression - // relational_expression greater_than shift_expression - // relational_expression less_than_equal shift_expression - // relational_expression greater_than_equal shift_expression - let expr = this._shift_expression(); - while (this._match([ - TokenTypes.tokens.less_than, - TokenTypes.tokens.greater_than, - TokenTypes.tokens.less_than_equal, - TokenTypes.tokens.greater_than_equal, - ])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression()); - } - return expr; - } - _shift_expression() { - // additive_expression - // shift_expression shift_left additive_expression - // shift_expression shift_right additive_expression - let expr = this._additive_expression(); - while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression()); - } - return expr; - } - _additive_expression() { - // multiplicative_expression - // additive_expression plus multiplicative_expression - // additive_expression minus multiplicative_expression - let expr = this._multiplicative_expression(); - while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression()); - } - return expr; - } - _multiplicative_expression() { - // unary_expression - // multiplicative_expression star unary_expression - // multiplicative_expression forward_slash unary_expression - // multiplicative_expression modulo unary_expression - let expr = this._unary_expression(); - while (this._match([ - TokenTypes.tokens.star, - TokenTypes.tokens.forward_slash, - TokenTypes.tokens.modulo, - ])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression()); - } - return expr; - } - _unary_expression() { - // singular_expression - // minus unary_expression - // bang unary_expression - // tilde unary_expression - // star unary_expression - // and unary_expression - if (this._match([ - TokenTypes.tokens.minus, - TokenTypes.tokens.bang, - TokenTypes.tokens.tilde, - TokenTypes.tokens.star, - TokenTypes.tokens.and, - ])) { - return new UnaryOperator(this._previous().toString(), this._unary_expression()); - } - return this._singular_expression(); - } - _singular_expression() { - // primary_expression postfix_expression ? - const expr = this._primary_expression(); - const p = this._postfix_expression(); - if (p) - expr.postfix = p; - return expr; - } - _postfix_expression() { - // bracket_left short_circuit_or_expression bracket_right postfix_expression? - if (this._match(TokenTypes.tokens.bracket_left)) { - const expr = this._short_circuit_or_expression(); - this._consume(TokenTypes.tokens.bracket_right, "Expected ']'."); - const p = this._postfix_expression(); - if (p) - expr.postfix = p; - return expr; - } - // period ident postfix_expression? - if (this._match(TokenTypes.tokens.period)) { - const name = this._consume(TokenTypes.tokens.ident, "Expected member name."); - const p = this._postfix_expression(); - const expr = new StringExpr(name.lexeme); - if (p) - expr.postfix = p; - return expr; - } - return null; - } - _getStruct(name) { - if (this._context.aliases.has(name)) { - const alias = this._context.aliases.get(name).type; - return alias; - } - if (this._context.structs.has(name)) { - const struct = this._context.structs.get(name); - return struct; - } - return null; - } - _primary_expression() { - // ident argument_expression_list? - if (this._match(TokenTypes.tokens.ident)) { - const name = this._previous().toString(); - if (this._check(TokenTypes.tokens.paren_left)) { - const args = this._argument_expression_list(); - const struct = this._getStruct(name); - if (struct != null) { - return new CreateExpr(struct, args); - } - return new CallExpr(name, args); - } - if (this._context.constants.has(name)) { - const c = this._context.constants.get(name); - return new ConstExpr(name, c.value); - } - return new VariableExpr(name); - } - // const_literal - if (this._match(TokenTypes.const_literal)) { - return new LiteralExpr(parseFloat(this._previous().toString())); - } - // paren_expression - if (this._check(TokenTypes.tokens.paren_left)) { - return this._paren_expression(); - } - // bitcast less_than type_decl greater_than paren_expression - if (this._match(TokenTypes.keywords.bitcast)) { - this._consume(TokenTypes.tokens.less_than, "Expected '<'."); - const type = this._type_decl(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>'."); - const value = this._paren_expression(); - return new BitcastExpr(type, value); - } - // type_decl argument_expression_list - const type = this._type_decl(); - const args = this._argument_expression_list(); - return new TypecastExpr(type, args); - } - _argument_expression_list() { - // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right - if (!this._match(TokenTypes.tokens.paren_left)) - return null; - const args = []; - do { - if (this._check(TokenTypes.tokens.paren_right)) - break; - const arg = this._short_circuit_or_expression(); - args.push(arg); - } while (this._match(TokenTypes.tokens.comma)); - this._consume(TokenTypes.tokens.paren_right, "Expected ')' for agument list"); - return args; - } - _optional_paren_expression() { - // [paren_left] short_circuit_or_expression [paren_right] - this._match(TokenTypes.tokens.paren_left); - const expr = this._short_circuit_or_expression(); - this._match(TokenTypes.tokens.paren_right); - return new GroupingExpr([expr]); - } - _paren_expression() { - // paren_left short_circuit_or_expression paren_right - this._consume(TokenTypes.tokens.paren_left, "Expected '('."); - const expr = this._short_circuit_or_expression(); - this._consume(TokenTypes.tokens.paren_right, "Expected ')'."); - return new GroupingExpr([expr]); - } - _struct_decl() { - // attribute* struct ident struct_body_decl - if (!this._match(TokenTypes.keywords.struct)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected name for struct.").toString(); - // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for struct body."); - const members = []; - while (!this._check(TokenTypes.tokens.brace_right)) { - // struct_member: attribute* variable_ident_decl - const memberAttrs = this._attribute(); - const memberName = this._consume(TokenTypes.tokens.ident, "Expected variable name.").toString(); - this._consume(TokenTypes.tokens.colon, "Expected ':' for struct member type."); - const typeAttrs = this._attribute(); - const memberType = this._type_decl(); - if (memberType != null) - memberType.attributes = typeAttrs; - if (!this._check(TokenTypes.tokens.brace_right)) - this._consume(TokenTypes.tokens.comma, "Expected ',' for struct member."); - else - this._match(TokenTypes.tokens.comma); // trailing comma optional. - members.push(new Member(memberName, memberType, memberAttrs)); - } - this._consume(TokenTypes.tokens.brace_right, "Expected '}' after struct body."); - const structNode = new Struct(name, members); - this._context.structs.set(name, structNode); - return structNode; - } - _global_variable_decl() { - // attribute* variable_decl (equal const_expression)? - const _var = this._variable_decl(); - if (_var && this._match(TokenTypes.tokens.equal)) - _var.value = this._const_expression(); - return _var; - } - _override_variable_decl() { - // attribute* override_decl (equal const_expression)? - const _override = this._override_decl(); - if (_override && this._match(TokenTypes.tokens.equal)) - _override.value = this._const_expression(); - return _override; - } - _global_const_decl() { - // attribute* const (ident variable_ident_decl) global_const_initializer? - if (!this._match(TokenTypes.keywords.const)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - let value = null; - if (this._match(TokenTypes.tokens.equal)) { - const valueExpr = this._short_circuit_or_expression(); - if (valueExpr instanceof CreateExpr) { - value = valueExpr; - } - else if (valueExpr instanceof ConstExpr && - valueExpr.initializer instanceof CreateExpr) { - value = valueExpr.initializer; - } - else { - try { - const constValue = valueExpr.evaluate(this._context); - value = new LiteralExpr(constValue); - } - catch (_a) { - value = valueExpr; - } - } - } - const c = new Const(name.toString(), type, "", "", value); - this._context.constants.set(c.name, c); - return c; - } - _global_let_decl() { - // attribute* let (ident variable_ident_decl) global_const_initializer? - if (!this._match(TokenTypes.keywords.let)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - let value = null; - if (this._match(TokenTypes.tokens.equal)) { - value = this._const_expression(); - } - return new Let(name.toString(), type, "", "", value); - } - _const_expression() { - // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right - // const_literal - if (this._match(TokenTypes.const_literal)) - return new StringExpr(this._previous().toString()); - const type = this._type_decl(); - this._consume(TokenTypes.tokens.paren_left, "Expected '('."); - let args = []; - while (!this._check(TokenTypes.tokens.paren_right)) { - args.push(this._const_expression()); - if (!this._check(TokenTypes.tokens.comma)) - break; - this._advance(); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')'."); - return new CreateExpr(type, args); - } - _variable_decl() { - // var variable_qualifier? (ident variable_ident_decl) - if (!this._match(TokenTypes.keywords.var)) - return null; - // variable_qualifier: less_than storage_class (comma access_mode)? greater_than - let storage = ""; - let access = ""; - if (this._match(TokenTypes.tokens.less_than)) { - storage = this._consume(TokenTypes.storage_class, "Expected storage_class.").toString(); - if (this._match(TokenTypes.tokens.comma)) - access = this._consume(TokenTypes.access_mode, "Expected access_mode.").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>'."); - } - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - return new Var(name.toString(), type, storage, access, null); - } - _override_decl() { - // override (ident variable_ident_decl) - if (!this._match(TokenTypes.keywords.override)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - return new Override(name.toString(), type, null); - } - _enable_directive() { - // enable ident semicolon - const name = this._consume(TokenTypes.tokens.ident, "identity expected."); - return new Enable(name.toString()); - } - _type_alias() { - // type ident equal type_decl - const name = this._consume(TokenTypes.tokens.ident, "identity expected."); - this._consume(TokenTypes.tokens.equal, "Expected '=' for type alias."); - let aliasType = this._type_decl(); - if (aliasType === null) { - throw this._error(this._peek(), "Expected Type for Alias."); - } - if (this._context.aliases.has(aliasType.name)) { - aliasType = this._context.aliases.get(aliasType.name).type; - } - const aliasNode = new Alias(name.toString(), aliasType); - this._context.aliases.set(aliasNode.name, aliasNode); - return aliasNode; - } - _type_decl() { - // ident - // bool - // float32 - // int32 - // uint32 - // vec2 less_than type_decl greater_than - // vec3 less_than type_decl greater_than - // vec4 less_than type_decl greater_than - // mat2x2 less_than type_decl greater_than - // mat2x3 less_than type_decl greater_than - // mat2x4 less_than type_decl greater_than - // mat3x2 less_than type_decl greater_than - // mat3x3 less_than type_decl greater_than - // mat3x4 less_than type_decl greater_than - // mat4x2 less_than type_decl greater_than - // mat4x3 less_than type_decl greater_than - // mat4x4 less_than type_decl greater_than - // atomic less_than type_decl greater_than - // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than - // array_type_decl - // texture_sampler_types - if (this._check([ - TokenTypes.tokens.ident, - ...TokenTypes.texel_format, - TokenTypes.keywords.bool, - TokenTypes.keywords.f32, - TokenTypes.keywords.i32, - TokenTypes.keywords.u32, - ])) { - const type = this._advance(); - const typeName = type.toString(); - if (this._context.structs.has(typeName)) { - return this._context.structs.get(typeName); - } - if (this._context.aliases.has(typeName)) { - return this._context.aliases.get(typeName).type; - } - return new Type(type.toString()); - } - // texture_sampler_types - let type = this._texture_sampler_types(); - if (type) - return type; - if (this._check(TokenTypes.template_types)) { - let type = this._advance().toString(); - let format = null; - let access = null; - if (this._match(TokenTypes.tokens.less_than)) { - format = this._type_decl(); - access = null; - if (this._match(TokenTypes.tokens.comma)) - access = this._consume(TokenTypes.access_mode, "Expected access_mode for pointer").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for type."); - } - return new TemplateType(type, format, access); - } - // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than - if (this._match(TokenTypes.keywords.ptr)) { - let pointer = this._previous().toString(); - this._consume(TokenTypes.tokens.less_than, "Expected '<' for pointer."); - const storage = this._consume(TokenTypes.storage_class, "Expected storage_class for pointer"); - this._consume(TokenTypes.tokens.comma, "Expected ',' for pointer."); - const decl = this._type_decl(); - let access = null; - if (this._match(TokenTypes.tokens.comma)) - access = this._consume(TokenTypes.access_mode, "Expected access_mode for pointer").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for pointer."); - return new PointerType(pointer, storage.toString(), decl, access); - } - // The following type_decl's have an optional attribyte_list* - const attrs = this._attribute(); - // attribute* array - // attribute* array less_than type_decl (comma element_count_expression)? greater_than - if (this._match(TokenTypes.keywords.array)) { - let format = null; - let countInt = -1; - const array = this._previous(); - if (this._match(TokenTypes.tokens.less_than)) { - format = this._type_decl(); - if (this._context.aliases.has(format.name)) { - format = this._context.aliases.get(format.name).type; - } - let count = ""; - if (this._match(TokenTypes.tokens.comma)) { - let c = this._shift_expression(); - count = c.evaluate(this._context).toString(); - } - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for array."); - countInt = count ? parseInt(count) : 0; - } - return new ArrayType(array.toString(), attrs, format, countInt); - } - return null; - } - _texture_sampler_types() { - // sampler_type - if (this._match(TokenTypes.sampler_type)) - return new SamplerType(this._previous().toString(), null, null); - // depth_texture_type - if (this._match(TokenTypes.depth_texture_type)) - return new SamplerType(this._previous().toString(), null, null); - // sampled_texture_type less_than type_decl greater_than - // multisampled_texture_type less_than type_decl greater_than - if (this._match(TokenTypes.sampled_texture_type) || - this._match(TokenTypes.multisampled_texture_type)) { - const sampler = this._previous(); - this._consume(TokenTypes.tokens.less_than, "Expected '<' for sampler type."); - const format = this._type_decl(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for sampler type."); - return new SamplerType(sampler.toString(), format, null); - } - // storage_texture_type less_than texel_format comma access_mode greater_than - if (this._match(TokenTypes.storage_texture_type)) { - const sampler = this._previous(); - this._consume(TokenTypes.tokens.less_than, "Expected '<' for sampler type."); - const format = this._consume(TokenTypes.texel_format, "Invalid texel format.").toString(); - this._consume(TokenTypes.tokens.comma, "Expected ',' after texel format."); - const access = this._consume(TokenTypes.access_mode, "Expected access mode for storage texture type.").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for sampler type."); - return new SamplerType(sampler.toString(), format, access); - } - return null; - } - _attribute() { - // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right - // attr ident - let attributes = []; - while (this._match(TokenTypes.tokens.attr)) { - const name = this._consume(TokenTypes.attribute_name, "Expected attribute name"); - const attr = new Attribute(name.toString(), null); - if (this._match(TokenTypes.tokens.paren_left)) { - // literal_or_ident - attr.value = this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(); - if (this._check(TokenTypes.tokens.comma)) { - this._advance(); - do { - const v = this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(); - if (!(attr.value instanceof Array)) { - attr.value = [attr.value]; - } - attr.value.push(v); - } while (this._match(TokenTypes.tokens.comma)); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')'"); - } - attributes.push(attr); - } - // Deprecated: - // attr_left (attribute comma)* attribute attr_right - while (this._match(TokenTypes.tokens.attr_left)) { - if (!this._check(TokenTypes.tokens.attr_right)) { - do { - const name = this._consume(TokenTypes.attribute_name, "Expected attribute name"); - const attr = new Attribute(name.toString(), null); - if (this._match(TokenTypes.tokens.paren_left)) { - // literal_or_ident - attr.value = [ - this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(), - ]; - if (this._check(TokenTypes.tokens.comma)) { - this._advance(); - do { - const v = this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(); - attr.value.push(v); - } while (this._match(TokenTypes.tokens.comma)); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')'"); - } - attributes.push(attr); - } while (this._match(TokenTypes.tokens.comma)); - } - // Consume ]] - this._consume(TokenTypes.tokens.attr_right, "Expected ']]' after attribute declarations"); - } - if (attributes.length == 0) - return null; - return attributes; - } - } - - /** - * @author Brendan Duncan / https://github.com/brendan-duncan - */ - class TypeInfo { - constructor(name, attributes) { - this.name = name; - this.attributes = attributes; - this.size = 0; - } - get isArray() { - return false; - } - get isStruct() { - return false; - } - get isTemplate() { - return false; - } - } - class MemberInfo { - constructor(name, type, attributes) { - this.name = name; - this.type = type; - this.attributes = attributes; - this.offset = 0; - this.size = 0; - } - get isArray() { - return this.type.isArray; - } - get isStruct() { - return this.type.isStruct; - } - get isTemplate() { - return this.type.isTemplate; - } - get align() { - return this.type.isStruct ? this.type.align : 0; - } - get members() { - return this.type.isStruct ? this.type.members : null; - } - get format() { - return this.type.isArray - ? this.type.format - : this.type.isTemplate - ? this.type.format - : null; - } - get count() { - return this.type.isArray ? this.type.count : 0; - } - get stride() { - return this.type.isArray ? this.type.stride : this.size; - } - } - class StructInfo extends TypeInfo { - constructor(name, attributes) { - super(name, attributes); - this.members = []; - this.align = 0; - } - get isStruct() { - return true; - } - } - class ArrayInfo extends TypeInfo { - constructor(name, attributes) { - super(name, attributes); - this.count = 0; - this.stride = 0; - } - get isArray() { - return true; - } - } - class TemplateInfo extends TypeInfo { - constructor(name, format, attributes, access) { - super(name, attributes); - this.format = format; - this.access = access; - } - get isTemplate() { - return true; - } - } - var ResourceType; - (function (ResourceType) { - ResourceType[ResourceType["Uniform"] = 0] = "Uniform"; - ResourceType[ResourceType["Storage"] = 1] = "Storage"; - ResourceType[ResourceType["Texture"] = 2] = "Texture"; - ResourceType[ResourceType["Sampler"] = 3] = "Sampler"; - ResourceType[ResourceType["StorageTexture"] = 4] = "StorageTexture"; - })(ResourceType || (ResourceType = {})); - class VariableInfo { - constructor(name, type, group, binding, attributes, resourceType, access) { - this.name = name; - this.type = type; - this.group = group; - this.binding = binding; - this.attributes = attributes; - this.resourceType = resourceType; - this.access = access; - } - get isArray() { - return this.type.isArray; - } - get isStruct() { - return this.type.isStruct; - } - get isTemplate() { - return this.type.isTemplate; - } - get size() { - return this.type.size; - } - get align() { - return this.type.isStruct ? this.type.align : 0; - } - get members() { - return this.type.isStruct ? this.type.members : null; - } - get format() { - return this.type.isArray - ? this.type.format - : this.type.isTemplate - ? this.type.format - : null; - } - get count() { - return this.type.isArray ? this.type.count : 0; - } - get stride() { - return this.type.isArray ? this.type.stride : this.size; - } - } - class AliasInfo { - constructor(name, type) { - this.name = name; - this.type = type; - } - } - class _TypeSize { - constructor(align, size) { - this.align = align; - this.size = size; - } - } - class InputInfo { - constructor(name, type, locationType, location) { - this.name = name; - this.type = type; - this.locationType = locationType; - this.location = location; - this.interpolation = null; - } - } - class OutputInfo { - constructor(name, type, locationType, location) { - this.name = name; - this.type = type; - this.locationType = locationType; - this.location = location; - } - } - class FunctionInfo { - constructor(name, stage = null) { - this.stage = null; - this.inputs = []; - this.outputs = []; - this.resources = []; - this.name = name; - this.stage = stage; - } - } - class EntryFunctions { - constructor() { - this.vertex = []; - this.fragment = []; - this.compute = []; - } - } - class OverrideInfo { - constructor(name, type, attributes, id) { - this.name = name; - this.type = type; - this.attributes = attributes; - this.id = id; - } - } - class _FunctionResources { - constructor(node) { - this.resources = null; - this.node = node; - } - } - class WgslReflect { - constructor(code) { - /// All top-level uniform vars in the shader. - this.uniforms = []; - /// All top-level storage vars in the shader. - this.storage = []; - /// All top-level texture vars in the shader; - this.textures = []; - // All top-level sampler vars in the shader. - this.samplers = []; - /// All top-level type aliases in the shader. - this.aliases = []; - /// All top-level overrides in the shader. - this.overrides = []; - /// All top-level structs in the shader. - this.structs = []; - /// All entry functions in the shader: vertex, fragment, and/or compute. - this.entry = new EntryFunctions(); - this._types = new Map(); - this._functions = new Map(); - if (code) { - this.update(code); - } - } - _isStorageTexture(type) { - return (type.name == "texture_storage_1d" || - type.name == "texture_storage_2d" || - type.name == "texture_storage_2d_array" || - type.name == "texture_storage_3d"); - } - update(code) { - const parser = new WgslParser(); - const ast = parser.parse(code); - for (const node of ast) { - if (node instanceof Function) { - this._functions.set(node.name, new _FunctionResources(node)); - } - } - for (const node of ast) { - if (node instanceof Struct) { - const info = this._getTypeInfo(node, null); - if (info instanceof StructInfo) { - this.structs.push(info); - } - continue; - } - if (node instanceof Alias) { - this.aliases.push(this._getAliasInfo(node)); - continue; - } - if (node instanceof Override) { - const v = node; - const id = this._getAttributeNum(v.attributes, "id", 0); - const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null; - this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id)); - continue; - } - if (this._isUniformVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access); - this.uniforms.push(varInfo); - continue; - } - if (this._isStorageVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const isStorageTexture = this._isStorageTexture(type); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access); - this.storage.push(varInfo); - continue; - } - if (this._isTextureVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const isStorageTexture = this._isStorageTexture(type); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access); - if (isStorageTexture) { - this.storage.push(varInfo); - } - else { - this.textures.push(varInfo); - } - continue; - } - if (this._isSamplerVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access); - this.samplers.push(varInfo); - continue; - } - if (node instanceof Function) { - const vertexStage = this._getAttribute(node, "vertex"); - const fragmentStage = this._getAttribute(node, "fragment"); - const computeStage = this._getAttribute(node, "compute"); - const stage = vertexStage || fragmentStage || computeStage; - if (stage) { - const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name); - fn.inputs = this._getInputs(node.args); - fn.outputs = this._getOutputs(node.returnType); - fn.resources = this._findResources(node); - this.entry[stage.name].push(fn); - } - continue; - } - } - } - _findResource(name) { - for (const u of this.uniforms) { - if (u.name == name) { - return u; - } - } - for (const s of this.storage) { - if (s.name == name) { - return s; - } - } - for (const t of this.textures) { - if (t.name == name) { - return t; - } - } - for (const s of this.samplers) { - if (s.name == name) { - return s; - } - } - return null; - } - _findResources(fn) { - const resources = []; - const self = this; - const varStack = []; - fn.search((node) => { - if (node instanceof _BlockStart) { - varStack.push({}); - } - else if (node instanceof _BlockEnd) { - varStack.pop(); - } - else if (node instanceof Var) { - if (varStack.length > 0) { - const v = node; - varStack[varStack.length - 1][v.name] = v; - } - } - else if (node instanceof Let) { - if (varStack.length > 0) { - const v = node; - varStack[varStack.length - 1][v.name] = v; - } - } - else if (node instanceof VariableExpr) { - const v = node; - // Check to see if the variable is a local variable before checking to see if it's - // a resource. - if (varStack.length > 0) { - const varInfo = varStack[varStack.length - 1][v.name]; - if (varInfo) { - return; - } - } - const varInfo = self._findResource(v.name); - if (varInfo) { - resources.push(varInfo); - } - } - else if (node instanceof CallExpr) { - const c = node; - const fn = self._functions.get(c.name); - if (fn) { - if (fn.resources === null) { - fn.resources = self._findResources(fn.node); - } - resources.push(...fn.resources); - } - } - }); - return [...new Map(resources.map(r => [r.name, r])).values()]; - } - getBindGroups() { - const groups = []; - function _makeRoom(group, binding) { - if (group >= groups.length) - groups.length = group + 1; - if (groups[group] === undefined) - groups[group] = []; - if (binding >= groups[group].length) - groups[group].length = binding + 1; - } - for (const u of this.uniforms) { - _makeRoom(u.group, u.binding); - const group = groups[u.group]; - group[u.binding] = u; - } - for (const u of this.storage) { - _makeRoom(u.group, u.binding); - const group = groups[u.group]; - group[u.binding] = u; - } - for (const t of this.textures) { - _makeRoom(t.group, t.binding); - const group = groups[t.group]; - group[t.binding] = t; - } - for (const t of this.samplers) { - _makeRoom(t.group, t.binding); - const group = groups[t.group]; - group[t.binding] = t; - } - return groups; - } - _getOutputs(type, outputs = undefined) { - if (outputs === undefined) - outputs = []; - if (type instanceof Struct) { - this._getStructOutputs(type, outputs); - } - else { - const output = this._getOutputInfo(type); - if (output !== null) - outputs.push(output); - } - return outputs; - } - _getStructOutputs(struct, outputs) { - for (const m of struct.members) { - if (m.type instanceof Struct) { - this._getStructOutputs(m.type, outputs); - } - else { - const location = this._getAttribute(m, "location") || this._getAttribute(m, "builtin"); - if (location !== null) { - const typeInfo = this._getTypeInfo(m.type, m.type.attributes); - const locationValue = this._parseInt(location.value); - const info = new OutputInfo(m.name, typeInfo, location.name, locationValue); - outputs.push(info); - } - } - } - } - _getOutputInfo(type) { - const location = this._getAttribute(type, "location") || - this._getAttribute(type, "builtin"); - if (location !== null) { - const typeInfo = this._getTypeInfo(type, type.attributes); - const locationValue = this._parseInt(location.value); - const info = new OutputInfo("", typeInfo, location.name, locationValue); - return info; - } - return null; - } - _getInputs(args, inputs = undefined) { - if (inputs === undefined) - inputs = []; - for (const arg of args) { - if (arg.type instanceof Struct) { - this._getStructInputs(arg.type, inputs); - } - else { - const input = this._getInputInfo(arg); - if (input !== null) - inputs.push(input); - } - } - return inputs; - } - _getStructInputs(struct, inputs) { - for (const m of struct.members) { - if (m.type instanceof Struct) { - this._getStructInputs(m.type, inputs); - } - else { - const input = this._getInputInfo(m); - if (input !== null) - inputs.push(input); - } - } - } - _getInputInfo(node) { - const location = this._getAttribute(node, "location") || - this._getAttribute(node, "builtin"); - if (location !== null) { - const interpolation = this._getAttribute(node, "interpolation"); - const type = this._getTypeInfo(node.type, node.attributes); - const locationValue = this._parseInt(location.value); - const info = new InputInfo(node.name, type, location.name, locationValue); - if (interpolation !== null) { - info.interpolation = this._parseString(interpolation.value); - } - return info; - } - return null; - } - _parseString(s) { - if (s instanceof Array) { - s = s[0]; - } - return s; - } - _parseInt(s) { - if (s instanceof Array) { - s = s[0]; - } - const n = parseInt(s); - return isNaN(n) ? s : n; - } - _getAlias(name) { - for (const a of this.aliases) { - if (a.name == name) - return a.type; - } - return null; - } - _getAliasInfo(node) { - return new AliasInfo(node.name, this._getTypeInfo(node.type, null)); - } - _getTypeInfo(type, attributes) { - if (this._types.has(type)) { - return this._types.get(type); - } - if (type instanceof ArrayType) { - const a = type; - const t = this._getTypeInfo(a.format, a.attributes); - const info = new ArrayInfo(a.name, attributes); - info.format = t; - info.count = a.count; - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - if (type instanceof Struct) { - const s = type; - const info = new StructInfo(s.name, attributes); - for (const m of s.members) { - const t = this._getTypeInfo(m.type, m.attributes); - info.members.push(new MemberInfo(m.name, t, m.attributes)); - } - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - if (type instanceof SamplerType) { - const s = type; - const formatIsType = s.format instanceof Type; - const format = s.format - ? formatIsType - ? this._getTypeInfo(s.format, null) - : new TypeInfo(s.format, null) - : null; - const info = new TemplateInfo(s.name, format, attributes, s.access); - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - if (type instanceof TemplateType) { - const t = type; - const format = t.format ? this._getTypeInfo(t.format, null) : null; - const info = new TemplateInfo(t.name, format, attributes, t.access); - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - const info = new TypeInfo(type.name, attributes); - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - _updateTypeInfo(type) { - var _a, _b; - const typeSize = this._getTypeSize(type); - type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0; - if (type instanceof ArrayInfo) { - const formatInfo = this._getTypeSize(type["format"]); - type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0; - this._updateTypeInfo(type["format"]); - } - if (type instanceof StructInfo) { - this._updateStructInfo(type); - } - } - _updateStructInfo(struct) { - var _a; - let offset = 0; - let lastSize = 0; - let lastOffset = 0; - let structAlign = 0; - for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) { - const member = struct.members[mi]; - const sizeInfo = this._getTypeSize(member); - if (!sizeInfo) - continue; - (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type; - const align = sizeInfo.align; - const size = sizeInfo.size; - offset = this._roundUp(align, offset + lastSize); - lastSize = size; - lastOffset = offset; - structAlign = Math.max(structAlign, align); - member.offset = offset; - member.size = size; - this._updateTypeInfo(member.type); - } - struct.size = this._roundUp(structAlign, lastOffset + lastSize); - struct.align = structAlign; - } - _getTypeSize(type) { - var _a; - if (type === null || type === undefined) - return null; - const explicitSize = this._getAttributeNum(type.attributes, "size", 0); - const explicitAlign = this._getAttributeNum(type.attributes, "align", 0); - if (type instanceof MemberInfo) - type = type.type; - if (type instanceof TypeInfo) { - const alias = this._getAlias(type.name); - if (alias !== null) { - type = alias; - } - } - { - const info = WgslReflect._typeInfo[type.name]; - if (info !== undefined) { - const divisor = type["format"] === "f16" ? 2 : 1; - return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor)); - } - } - { - const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)]; - if (info) { - const divisor = type.name[type.name.length - 1] === "h" ? 2 : 1; - return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor)); - } - } - if (type instanceof ArrayInfo) { - let arrayType = type; - let align = 8; - let size = 8; - // Type AlignOf(T) Sizeof(T) - // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) - // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime) - // - // @stride(Q) - // array AlignOf(E) N * Q - // - // @stride(Q) - // array AlignOf(E) Nruntime * Q - //const E = type.format.name; - const E = this._getTypeSize(arrayType.format); - if (E !== null) { - size = E.size; - align = E.align; - } - const N = arrayType.count; - 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)); - size = N * stride; - if (explicitSize) - size = explicitSize; - return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size)); - } - if (type instanceof StructInfo) { - let align = 0; - let size = 0; - // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN)) - // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L)) - // Where L is the last member of the structure - let offset = 0; - let lastSize = 0; - let lastOffset = 0; - for (const m of type.members) { - const mi = this._getTypeSize(m.type); - if (mi !== null) { - align = Math.max(mi.align, align); - offset = this._roundUp(mi.align, offset + lastSize); - lastSize = mi.size; - lastOffset = offset; - } - } - size = this._roundUp(align, lastOffset + lastSize); - return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size)); - } - return null; - } - _isUniformVar(node) { - return node instanceof Var && node.storage == "uniform"; - } - _isStorageVar(node) { - return node instanceof Var && node.storage == "storage"; - } - _isTextureVar(node) { - return (node instanceof Var && - node.type !== null && - WgslReflect._textureTypes.indexOf(node.type.name) != -1); - } - _isSamplerVar(node) { - return (node instanceof Var && - node.type !== null && - WgslReflect._samplerTypes.indexOf(node.type.name) != -1); - } - _getAttribute(node, name) { - const obj = node; - if (!obj || !obj["attributes"]) - return null; - const attrs = obj["attributes"]; - for (let a of attrs) { - if (a.name == name) - return a; - } - return null; - } - _getAttributeNum(attributes, name, defaultValue) { - if (attributes === null) - return defaultValue; - for (let a of attributes) { - if (a.name == name) { - let v = a !== null && a.value !== null ? a.value : defaultValue; - if (v instanceof Array) { - v = v[0]; - } - if (typeof v === "number") { - return v; - } - if (typeof v === "string") { - return parseInt(v); - } - return defaultValue; - } - } - return defaultValue; - } - _roundUp(k, n) { - return Math.ceil(n / k) * k; - } - } - // Type AlignOf(T) Sizeof(T) - // i32, u32, or f32 4 4 - // atomic 4 4 - // vec2 8 8 - // vec3 16 12 - // vec4 16 16 - // mat2x2 8 16 - // mat3x2 8 24 - // mat4x2 8 32 - // mat2x3 16 32 - // mat3x3 16 48 - // mat4x3 16 64 - // mat2x4 16 32 - // mat3x4 16 48 - // mat4x4 16 64 - WgslReflect._typeInfo = { - f16: { align: 2, size: 2 }, - i32: { align: 4, size: 4 }, - u32: { align: 4, size: 4 }, - f32: { align: 4, size: 4 }, - atomic: { align: 4, size: 4 }, - vec2: { align: 8, size: 8 }, - vec3: { align: 16, size: 12 }, - vec4: { align: 16, size: 16 }, - mat2x2: { align: 8, size: 16 }, - mat3x2: { align: 8, size: 24 }, - mat4x2: { align: 8, size: 32 }, - mat2x3: { align: 16, size: 32 }, - mat3x3: { align: 16, size: 48 }, - mat4x3: { align: 16, size: 64 }, - mat2x4: { align: 16, size: 32 }, - mat3x4: { align: 16, size: 48 }, - mat4x4: { align: 16, size: 64 }, - }; - WgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => { - return t.name; - }); - WgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => { - return t.name; - }); - - function getEntryPointForStage(defs, stage, stageFlags) { - const { entryPoint: entryPointName } = stage; - if (entryPointName) { - const ep = defs.entryPoints[entryPointName]; - return (ep && ep.stage === stageFlags) ? ep : undefined; - } - return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0]; - } - function getStageResources(defs, stage, stageFlags) { - if (!stage) { - return []; - } - const entryPoint = getEntryPointForStage(defs, stage, stageFlags); - return entryPoint?.resources || []; - } - const byBinding = (a, b) => Math.sign(a.binding - b.binding); - /** - * Gets GPUBindGroupLayoutDescriptors for the given pipeline. - * - * Important: Assumes you pipeline is valid (it doesn't check for errors). - * - * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float - * sampler can not be derived since it is unknown at compile time pipeline creation time - * which texture you'll use. - * - * MAINTENANCE_TODO: Add example - * - * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as - * returned from @link {makeShaderDataDefinitions}. If an array more than 1 - * definition it's assumed the vertex shader is in the first and the fragment - * shader in the second. - * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed - * to `createRenderPipeline` or `createComputePipeline`. - * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to - * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group - * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding. - */ - function makeBindGroupLayoutDescriptors(defs, desc) { - defs = Array.isArray(defs) ? defs : [defs]; - const resources = [ - ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX), - ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT), - ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE), - ]; - const bindGroupLayoutDescriptorsByGroupByBinding = []; - for (const resource of resources) { - const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map(); - bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry; - // Should we error here if the 2 don't match? - const entry = bindingsToBindGroupEntry.get(resource.entry.binding); - bindingsToBindGroupEntry.set(resource.entry.binding, { - ...resource.entry, - visibility: resource.entry.visibility | (entry?.visibility || 0), - }); - } - return bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({ entries: [...v.values()].sort(byBinding) })); - } - function getNamedVariables(reflect, variables) { - return Object.fromEntries(variables.map(v => { - const typeDefinition = addType(reflect, v.type, 0); - return [ - v.name, - { - typeDefinition, - group: v.group, - binding: v.binding, - size: typeDefinition.size, - }, - ]; - })); - } - function makeStructDefinition(reflect, structInfo, offset) { - // StructDefinition - const fields = Object.fromEntries(structInfo.members.map(m => { - return [ - m.name, - { - offset: m.offset, - type: addType(reflect, m.type, 0), - }, - ]; - })); - return { - fields, - size: structInfo.size, - offset, - }; - } - function getTextureSampleType(type) { - if (type.name.includes('depth')) { - return 'depth'; - } - // unfiltered-float - switch (type.format?.name) { - case 'f32': return 'float'; - case 'i32': return 'sint'; - case 'u32': return 'uint'; - default: - throw new Error('unknown texture sample type'); - } - } - function getViewDimension(type) { - if (type.name.includes('2d_array')) { - return '2d-array'; - } - if (type.name.includes('cube_array')) { - return 'cube-array'; - } - if (type.name.includes('3d')) { - return '3d'; - } - if (type.name.includes('1d')) { - return '1d'; - } - if (type.name.includes('cube')) { - return 'cube'; - } - return '2d'; - } - function getStorageTextureAccess(type) { - switch (type.access) { - case 'read': return 'read-only'; - case 'write': return 'write-only'; - case 'read_write': return 'read-write'; - default: - throw new Error('unknonw storage texture access'); - } - } - function getSamplerType(type) { - // "non-filtering" can only be specified manually. - return type.name.endsWith('_comparison') - ? 'comparison' - : 'filtering'; - } - function getBindGroupLayoutEntry(resource, visibility) { - const { binding, access, type } = resource; - switch (resource.resourceType) { - case ResourceType.Uniform: - return { - binding, - visibility, - buffer: {}, - }; - case ResourceType.Storage: - return { - binding, - visibility, - buffer: { - type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage', - }, - }; - case ResourceType.Texture: { - if (type.name === 'texture_external') { - return { - binding, - visibility, - externalTexture: {}, - }; - } - const multisampled = type.name.includes('multisampled'); - return { - binding, - visibility, - texture: { - sampleType: getTextureSampleType(type), - viewDimension: getViewDimension(type), - multisampled, - }, - }; - } - case ResourceType.Sampler: - return { - binding, - visibility, - sampler: { - type: getSamplerType(type), - }, - }; - case ResourceType.StorageTexture: - return { - binding, - visibility, - storageTexture: { - access: getStorageTextureAccess(type), - format: type.format.name, - viewDimension: getViewDimension(type), - }, - }; - default: - throw new Error('unknown resource type'); - } - } - function addEntryPoints(funcInfos, stage) { - const entryPoints = {}; - for (const info of funcInfos) { - entryPoints[info.name] = { - stage, - resources: info.resources.map(resource => { - const { name, group } = resource; - return { - name, - group, - entry: getBindGroupLayoutEntry(resource, stage), - }; - }), - }; - } - return entryPoints; - } - /** - * Given a WGSL shader, returns data definitions for structures, - * uniforms, and storage buffers - * - * Example: - * - * ```js - * const code = ` - * struct MyStruct { - * color: vec4f, - * brightness: f32, - * kernel: array, - * }; - * @group(0) @binding(0) var myUniforms: MyUniforms; - * `; - * const defs = makeShaderDataDefinitions(code); - * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms); - * - * myUniformValues.set({ - * color: [1, 0, 1, 1], - * brightness: 0.8, - * kernel: [ - * 1, 0, -1, - * 2, 0, -2, - * 1, 0, -1, - * ], - * }); - * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer); - * ``` - * - * @param code WGSL shader. Note: it is not required for this to be a complete shader - * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView} - */ - function makeShaderDataDefinitions(code) { - const reflect = new WgslReflect(code); - const structs = Object.fromEntries(reflect.structs.map(structInfo => { - return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)]; - })); - const uniforms = getNamedVariables(reflect, reflect.uniforms); - const storages = getNamedVariables(reflect, reflect.storage); - const entryPoints = { - ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX), - ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT), - ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE), - }; - return { - structs, - storages, - uniforms, - entryPoints, - }; - } - function assert(cond, msg = '') { - if (!cond) { - throw new Error(msg); - } - } - /* - write down what I want for a given type - - struct VSUniforms { - foo: u32, - }; - @group(4) @binding(1) var uni1: f32; - @group(3) @binding(2) var uni2: array; - @group(2) @binding(3) var uni3: VSUniforms; - @group(1) @binding(4) var uni4: array; - - uni1: { - type: 'f32', - numElements: undefined - }, - uni2: { - type: 'array', - elementType: 'f32' - numElements: 5, - }, - uni3: { - type: 'struct', - fields: { - foo: { - type: 'f32', - numElements: undefined - } - }, - }, - uni4: { - type: 'array', - elementType: - fields: { - foo: { - type: 'f32', - numElements: undefined - } - }, - fields: { - foo: { - type: 'f32', - numElements: undefined - } - }, - ... - ] - - */ - function addType(reflect, typeInfo, offset) { - if (typeInfo.isArray) { - assert(!typeInfo.isStruct, 'struct array is invalid'); - assert(!typeInfo.isStruct, 'template array is invalid'); - const arrayInfo = typeInfo; - // ArrayDefinition - return { - size: arrayInfo.size, - elementType: addType(reflect, arrayInfo.format, offset), - numElements: arrayInfo.count, - }; - } - else if (typeInfo.isStruct) { - assert(!typeInfo.isTemplate, 'template struct is invalid'); - const structInfo = typeInfo; - return makeStructDefinition(reflect, structInfo, offset); - } - else { - // template is like vec4 or mat4x4 - const asTemplateInfo = typeInfo; - const type = typeInfo.isTemplate - ? `${asTemplateInfo.name}<${asTemplateInfo.format.name}>` - : typeInfo.name; - // IntrinsicDefinition - return { - size: typeInfo.size, - type, - }; - } - } - - function guessTextureBindingViewDimensionForTexture(texture) { - switch (texture.dimension) { - case '1d': - return '1d'; - case '3d': - return '3d'; - default: // to shut up TS - case '2d': - return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d'; - } - } - function normalizeGPUExtent3Dict(size) { - return [size.width, size.height || 1, size.depthOrArrayLayers || 1]; - } - /** - * Converts a `GPUExtent3D` into an array of numbers - * - * `GPUExtent3D` has two forms `[width, height?, depth?]` or - * `{width: number, height?: number, depthOrArrayLayers?: number}` - * - * You pass one of those in here and it returns an array of 3 numbers - * so that your code doesn't have to deal with multiple forms. - * - * @param size - * @returns an array of 3 numbers, [width, height, depthOrArrayLayers] - */ - function normalizeGPUExtent3D(size) { - return (Array.isArray(size) || isTypedArray(size)) - ? [...size, 1, 1].slice(0, 3) - : normalizeGPUExtent3Dict(size); - } - /** - * Given a GPUExtent3D returns the number of mip levels needed - * - * @param size - * @returns number of mip levels needed for the given size - */ - function numMipLevels(size, dimension) { - const sizes = normalizeGPUExtent3D(size); - const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2)); - return 1 + Math.log2(maxSize) | 0; - } - function getMipmapGenerationWGSL(textureBindingViewDimension) { - let textureSnippet; - let sampleSnippet; - switch (textureBindingViewDimension) { - case '2d': - textureSnippet = 'texture_2d'; - sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)'; - break; - case '2d-array': - textureSnippet = 'texture_2d_array'; - sampleSnippet = ` - textureSample( - ourTexture, - ourSampler, - fsInput.texcoord, - uni.layer)`; - break; - case 'cube': - textureSnippet = 'texture_cube'; - sampleSnippet = ` - textureSample( - ourTexture, - ourSampler, - faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`; - break; - case 'cube-array': - textureSnippet = 'texture_cube_array'; - sampleSnippet = ` - textureSample( - ourTexture, - ourSampler, - faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`; - break; - default: - throw new Error(`unsupported view: ${textureBindingViewDimension}`); - } - return ` - const faceMat = array( - mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x - mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x - mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y - mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y - mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z - mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z - - struct VSOutput { - @builtin(position) position: vec4f, - @location(0) texcoord: vec2f, - }; - - @vertex fn vs( - @builtin(vertex_index) vertexIndex : u32 - ) -> VSOutput { - var pos = array( - vec2f(-1.0, -1.0), - vec2f(-1.0, 3.0), - vec2f( 3.0, -1.0), - ); - - var vsOutput: VSOutput; - let xy = pos[vertexIndex]; - vsOutput.position = vec4f(xy, 0.0, 1.0); - vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5); - return vsOutput; - } - - struct Uniforms { - layer: u32, - }; - - @group(0) @binding(0) var ourSampler: sampler; - @group(0) @binding(1) var ourTexture: ${textureSnippet}; - @group(0) @binding(2) var uni: Uniforms; - - @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f { - _ = uni.layer; // make sure this is used so all pipelines have the same bindings - return ${sampleSnippet}; - } - `; - } - // Use a WeakMap so the device can be destroyed and/or lost - const byDevice = new WeakMap(); - /** - * Generates mip levels from level 0 to the last mip for an existing texture - * - * The texture must have been created with TEXTURE_BINDING and RENDER_ATTACHMENT - * and been created with mip levels - * - * @param device A GPUDevice - * @param texture The texture to create mips for - * @param textureBindingViewDimension This is only needed in compatibility mode - * and it is only needed when the texture is going to be used as a cube map. - */ - function generateMipmap(device, texture, textureBindingViewDimension) { - let perDeviceInfo = byDevice.get(device); - if (!perDeviceInfo) { - perDeviceInfo = { - pipelineByFormatAndView: {}, - moduleByViewType: {}, - }; - byDevice.set(device, perDeviceInfo); - } - let { sampler, uniformBuffer, uniformValues, } = perDeviceInfo; - const { pipelineByFormatAndView, moduleByViewType, } = perDeviceInfo; - textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture); - let module = moduleByViewType[textureBindingViewDimension]; - if (!module) { - const code = getMipmapGenerationWGSL(textureBindingViewDimension); - module = device.createShaderModule({ - label: `mip level generation for ${textureBindingViewDimension}`, - code, - }); - moduleByViewType[textureBindingViewDimension] = module; - } - if (!sampler) { - sampler = device.createSampler({ - minFilter: 'linear', - magFilter: 'linear', - }); - uniformBuffer = device.createBuffer({ - size: 16, - usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, - }); - uniformValues = new Uint32Array(1); - Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues }); - } - const id = `${texture.format}.${textureBindingViewDimension}`; - if (!pipelineByFormatAndView[id]) { - pipelineByFormatAndView[id] = device.createRenderPipeline({ - label: `mip level generator pipeline for ${textureBindingViewDimension}`, - layout: 'auto', - vertex: { - module, - entryPoint: 'vs', - }, - fragment: { - module, - entryPoint: 'fs', - targets: [{ format: texture.format }], - }, - }); - } - const pipeline = pipelineByFormatAndView[id]; - for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) { - for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) { - uniformValues[0] = baseArrayLayer; - device.queue.writeBuffer(uniformBuffer, 0, uniformValues); - const bindGroup = device.createBindGroup({ - layout: pipeline.getBindGroupLayout(0), - entries: [ - { binding: 0, resource: sampler }, - { - binding: 1, - resource: texture.createView({ - dimension: textureBindingViewDimension, - baseMipLevel: baseMipLevel - 1, - mipLevelCount: 1, - }), - }, - { binding: 2, resource: { buffer: uniformBuffer } }, - ], - }); - const renderPassDescriptor = { - label: 'mip gen renderPass', - colorAttachments: [ - { - view: texture.createView({ - dimension: '2d', - baseMipLevel, - mipLevelCount: 1, - baseArrayLayer, - arrayLayerCount: 1, - }), - loadOp: 'clear', - storeOp: 'store', - }, - ], - }; - const encoder = device.createCommandEncoder({ - label: 'mip gen encoder', - }); - const pass = encoder.beginRenderPass(renderPassDescriptor); - pass.setPipeline(pipeline); - pass.setBindGroup(0, bindGroup); - pass.draw(3); - pass.end(); - const commandBuffer = encoder.finish(); - device.queue.submit([commandBuffer]); - } - } - } - - const kTypedArrayToAttribFormat = new Map([ - [Int8Array, { formats: ['sint8', 'snorm8'], defaultForType: 1 }], - [Uint8Array, { formats: ['uint8', 'unorm8'], defaultForType: 1 }], - [Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 }], - [Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 }], - [Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 }], - [Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 }], - [Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 }], - // TODO: Add Float16Array - ]); - const kVertexFormatPrefixToType = new Map([...kTypedArrayToAttribFormat.entries()].map(([Type, { formats: [s1, s2] }]) => [[s1, Type], [s2, Type]]).flat()); - function isIndices(name) { - return name === "indices"; - } - function makeTypedArrayFromArrayUnion(array, name) { - if (isTypedArray(array)) { - return array; - } - let asFullSpec = array; - if (isTypedArray(asFullSpec.data)) { - return asFullSpec.data; - } - if (Array.isArray(array) || typeof array === 'number') { - asFullSpec = { - data: array, - }; - } - let Type = asFullSpec.type; - if (!Type) { - if (isIndices(name)) { - Type = Uint32Array; - } - else { - Type = Float32Array; - } - } - return new Type(asFullSpec.data); // ugh! - } - function getArray(array) { - const arr = array.length ? array : array.data; - return arr; - } - const kNameToNumComponents = [ - { re: /coord|texture|uv/i, numComponents: 2 }, - { re: /color|colour/i, numComponents: 4 }, - ]; - function guessNumComponentsFromNameImpl(name) { - for (const { re, numComponents } of kNameToNumComponents) { - if (re.test(name)) { - return numComponents; - } - } - return 3; - } - function guessNumComponentsFromName(name, length) { - const numComponents = guessNumComponentsFromNameImpl(name); - if (length % numComponents > 0) { - 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.`); - } - return numComponents; - } - function getNumComponents(array, arrayName) { - return array.numComponents || guessNumComponentsFromName(arrayName, getArray(array).length); - } - const kVertexFormatRE = /(\w+)(?:x(\d))$/; - function numComponentsAndTypeFromVertexFormat(format) { - const m = kVertexFormatRE.exec(format); - const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1]; - return { - Type: kVertexFormatPrefixToType.get(prefix), - numComponents, - }; - } - function createTypedArrayOfSameType(typedArray, arrayBuffer) { - const Ctor = Object.getPrototypeOf(typedArray).constructor; - return new Ctor(arrayBuffer); - } - /** - * Given a set of named arrays, generates an array `GPUBufferLayout`s - * - * Examples: - * - * ```js - * const arrays = { - * 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], - * 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], - * 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], - * }; - * - * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays); - * ``` - * - * results in `bufferLayouts` being - * - * ```js - * [ - * { - * stepMode: 'vertex', - * arrayStride: 32, - * attributes: [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ], - * }, - * ] - * ``` - * - * and `typedArrays` being - * - * ``` - * [ - * someFloat32Array0, - * someFloat32Array1, - * someFloat32Array2, - * ] - * ``` - * - * See {@link Arrays} for details on the various types of arrays. - * - * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made) - */ - function createBufferLayoutsFromArrays(arrays, options = {}) { - const interleave = options.interleave === undefined ? true : options.interleave; - const stepMode = options.stepMode || 'vertex'; - const shaderLocations = options.shaderLocation - ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation]) - : [0]; - let currentOffset = 0; - const bufferLayouts = []; - const attributes = []; - const typedArrays = []; - Object.keys(arrays) - .filter(arrayName => !isIndices(arrayName)) - .forEach(arrayName => { - const array = arrays[arrayName]; - const data = makeTypedArrayFromArrayUnion(array, arrayName); - const totalNumComponents = getNumComponents(array, arrayName); - // if totalNumComponents > 4 then we clearly need to split this into multiple - // attributes - // (a) <= 4 doesn't mean don't split and - // (b) how to split? We could divide by 4 and if it's not even then divide by 3 - // as a guess? - // 5 is error? or 1x4 + 1x1? - // 6 is 2x3 - // 7 is error? or 1x4 + 1x3? - // 8 is 2x4 - // 9 is 3x3 - // 10 is error? or 2x4 + 1x2? - // 11 is error? or 2x4 + 1x3? - // 12 is 3x4 or 4x3? - // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1? - // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2? - // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3? - // 16 is 4x4 - const by4 = totalNumComponents / 4; - const by3 = totalNumComponents / 3; - const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4); - for (let component = 0; component < totalNumComponents; component += step) { - const numComponents = Math.min(step, totalNumComponents - component); - const offset = currentOffset; - currentOffset += numComponents * data.BYTES_PER_ELEMENT; - const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor); - const normalize = array.normalize; - const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0); - const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}`; - // TODO: cleanup with generator? - const shaderLocation = shaderLocations.shift(); - if (shaderLocations.length === 0) { - shaderLocations.push(shaderLocation + 1); - } - attributes.push({ - offset, - format, - shaderLocation, - }); - typedArrays.push({ - data, - offset: component, - stride: totalNumComponents, - }); - } - if (!interleave) { - bufferLayouts.push({ - stepMode, - arrayStride: currentOffset, - attributes: attributes.slice(), - }); - currentOffset = 0; - attributes.length = 0; - } - }); - if (attributes.length) { - bufferLayouts.push({ - stepMode, - arrayStride: currentOffset, - attributes: attributes, - }); - } - return { - bufferLayouts, - typedArrays, - }; - } - function getTypedArrayWithOffsetAndStride(ta, numComponents) { - return (isTypedArray(ta) - ? { data: ta, offset: 0, stride: numComponents } - : ta); - } - /** - * Given an array of `GPUVertexAttribute`s and a corresponding array - * of TypedArrays, interleaves the contents of the typed arrays - * into the given ArrayBuffer - * - * example: - * - * ```js - * const attributes: GPUVertexAttribute[] = [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ]; - * const typedArrays = [ - * 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]), - * 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]), - * 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]), - * ]; - * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv - * const arrayBuffer = new ArrayBuffer(arrayStride * 24) - * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer) - * ``` - * - * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved - * - * See {@link Arrays} for details on the various types of arrays. - * - * Note: You can generate `attributes` and `typedArrays` above by calling - * {@link createBufferLayoutsFromArrays} - */ - function interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer) { - const views = new Map(); - const getView = (typedArray) => { - const Ctor = Object.getPrototypeOf(typedArray).constructor; - const view = views.get(Ctor); - if (view) { - return view; - } - const newView = new Ctor(arrayBuffer); - views.set(Ctor, newView); - return newView; - }; - attributes.forEach((attribute, ndx) => { - const { offset, format } = attribute; - const { numComponents } = numComponentsAndTypeFromVertexFormat(format); - const { data, offset: srcOffset, stride, } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents); - const view = getView(data); - for (let i = 0; i < data.length; i += stride) { - const ndx = i / stride; - const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT; - const srcOff = i + srcOffset; - const s = data.subarray(srcOff, srcOff + numComponents); - view.set(s, dstOffset); - } - }); - } - /** - * Given arrays, create buffers, fills the buffers with data if provided, optionally - * interleaves the data (the default). - * - * Example: - * - * ```js - * const { - * buffers, - * bufferLayouts, - * indexBuffer, - * indexFormat, - * numElements, - * } = createBuffersAndAttributesFromArrays(device, { - * 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], - * 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], - * 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], - * 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], - * }); - * ``` - * - * Where `bufferLayouts` will be - * - * ```js - * [ - * { - * stepMode: 'vertex', - * arrayStride: 32, - * attributes: [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ], - * }, - * ] - * ``` - * - * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX` - * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX` - * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices) - * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no - * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays}) - * - * See {@link Arrays} for details on the various types of arrays. - * Also see the cube and instancing examples. - */ - function createBuffersAndAttributesFromArrays(device, arrays, options = {}) { - const usage = (options.usage || 0); - const { bufferLayouts, typedArrays, } = createBufferLayoutsFromArrays(arrays, options); - const buffers = []; - let numElements = -1; - let bufferNdx = 0; - for (const { attributes, arrayStride } of bufferLayouts) { - const attribs = attributes; - const attrib0 = attribs[0]; - const { numComponents } = numComponentsAndTypeFromVertexFormat(attrib0.format); - const { data: data0, stride, } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents); - if (numElements < 0) { - numElements = data0.length / stride; - } - const size = arrayStride * numElements; - const buffer = device.createBuffer({ - usage: usage | GPUBufferUsage.VERTEX, - size, - mappedAtCreation: true, - }); - const arrayBuffer = buffer.getMappedRange(); - if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) { - const view = createTypedArrayOfSameType(data0, arrayBuffer); - view.set(data0); - } - else { - interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer); - } - buffer.unmap(); - buffers.push(buffer); - bufferNdx += attribs.length; - } - const buffersAndAttributes = { - numElements, - bufferLayouts, - buffers, - }; - const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName)); - if (indicesEntry) { - const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices'); - const indexBuffer = device.createBuffer({ - size: indices.byteLength, - usage: GPUBufferUsage.INDEX | usage, - mappedAtCreation: true, - }); - const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange()); - dst.set(indices); - indexBuffer.unmap(); - buffersAndAttributes.indexBuffer = indexBuffer; - buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32'; - buffersAndAttributes.numElements = indices.length; - } - return buffersAndAttributes; - } - /** - * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer` - * for the buffers specified in `buffersAndAttributes`. - * - * This is extremely simple function. It is equivalent to - * - * ```js - * buffersAndAttributes.buffers.forEach((buffer, i) => { - * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer); - * }); - * - * if (buffersAndAttributes.indexBuffer) { - * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!); - * } - * ``` - * - * It exists solely for simple cases. If you have a complex case, call the passEncoder - * yourself as appropriate. - * - * @param passEncoder a render pass encoder - * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays} - * @param firstVertexBufferIndex The first vertex buffer index. default = 0. - */ - function setVertexAndIndexBuffers(passEncoder, buffersAndAttributes, firstVertexBufferIndex = 0) { - buffersAndAttributes.buffers.forEach((buffer, i) => { - passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer); - }); - if (buffersAndAttributes.indexBuffer) { - passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat); - } - } - /** - * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed` - * - * This is an extremely simple function. See {@link setVertexAndIndexBuffers}. - * If you need something more complex, call pass encoder functions yourself as appropriate. - * - * @param passEncoder a render pass encoder - * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays} - */ - function drawArrays(passEncoder, buffersAndAttributes) { - setVertexAndIndexBuffers(passEncoder, buffersAndAttributes); - if (buffersAndAttributes.indexBuffer) { - passEncoder.drawIndexed(buffersAndAttributes.numElements); - } - else { - passEncoder.draw(buffersAndAttributes.numElements); - } - } - - function isTextureData(source) { - const src = source; - return isTypedArray(src.data) || Array.isArray(src.data); - } - function isTextureRawDataSource(source) { - return isTypedArray(source) || Array.isArray(source) || isTextureData(source); - } - function toTypedArray(v, format) { - if (isTypedArray(v)) { - return v; - } - const { Type } = getTextureFormatInfo(format); - return new Type(v); - } - function guessDimensions(width, height, numElements, dimension = '2d') { - if (numElements % 1 !== 0) { - throw new Error("can't guess dimensions"); - } - if (!width && !height) { - const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1)); - if (size % 1 === 0) { - width = size; - height = size; - } - else { - width = numElements; - height = 1; - } - } - else if (!height) { - height = numElements / width; - if (height % 1) { - throw new Error("can't guess dimensions"); - } - } - else if (!width) { - width = numElements / height; - if (width % 1) { - throw new Error("can't guess dimensions"); - } - } - const depth = numElements / width / height; - if (depth % 1) { - throw new Error("can't guess dimensions"); - } - return [width, height, depth]; - } - function textureViewDimensionToDimension(viewDimension) { - switch (viewDimension) { - case '1d': return '1d'; - case '3d': return '3d'; - default: return '2d'; - } - } - const kFormatToTypedArray = { - '8snorm': Int8Array, - '8unorm': Uint8Array, - '8sint': Int8Array, - '8uint': Uint8Array, - '16snorm': Int16Array, - '16unorm': Uint16Array, - '16sint': Int16Array, - '16uint': Uint16Array, - '32snorm': Int32Array, - '32unorm': Uint32Array, - '32sint': Int32Array, - '32uint': Uint32Array, - '16float': Uint16Array, - '32float': Float32Array, - }; - const kTextureFormatRE = /([a-z]+)(\d+)([a-z]+)/; - function getTextureFormatInfo(format) { - // this is a hack! It will only work for common formats - const [, channels, bits, typeName] = kTextureFormatRE.exec(format); - // TODO: if the regex fails, use table for other formats? - const numChannels = channels.length; - const bytesPerChannel = parseInt(bits) / 8; - const bytesPerElement = numChannels * bytesPerChannel; - const Type = kFormatToTypedArray[`${bits}${typeName}`]; - return { - channels, - numChannels, - bytesPerChannel, - bytesPerElement, - Type, - }; - } - /** - * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers] - */ - function getSizeForMipFromTexture(texture, mipLevel) { - return [ - texture.width, - texture.height, - texture.depthOrArrayLayers, - ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel))); - } - /** - * Uploads Data to a texture - */ - function uploadDataToTexture(device, texture, source, options) { - const data = toTypedArray(source.data || source, texture.format); - const mipLevel = 0; - const size = getSizeForMipFromTexture(texture, mipLevel); - const { bytesPerElement } = getTextureFormatInfo(texture.format); - const origin = options.origin || [0, 0, 0]; - device.queue.writeTexture({ texture, origin }, data, { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] }, size); - } - /** - * Copies a an array of "sources" (Video, Canvas, OffscreenCanvas, ImageBitmap) - * to a texture and then optionally generates mip levels - */ - function copySourcesToTexture(device, texture, sources, options = {}) { - sources.forEach((source, layer) => { - const origin = [0, 0, layer + (options.baseArrayLayer || 0)]; - if (isTextureRawDataSource(source)) { - uploadDataToTexture(device, texture, source, { origin }); - } - else { - const s = source; - const { flipY, premultipliedAlpha, colorSpace } = options; - device.queue.copyExternalImageToTexture({ source: s, flipY, }, { texture, premultipliedAlpha, colorSpace, origin }, getSizeFromSource(s, options)); - } - }); - if (texture.mipLevelCount > 1) { - generateMipmap(device, texture); - } - } - /** - * Copies a "source" (Video, Canvas, OffscreenCanvas, ImageBitmap) - * to a texture and then optionally generates mip levels - */ - function copySourceToTexture(device, texture, source, options = {}) { - copySourcesToTexture(device, texture, [source], options); - } - /** - * Gets the size from a source. This is to smooth out the fact that different - * sources have a different way to get their size. - */ - function getSizeFromSource(source, options) { - if (source instanceof HTMLVideoElement) { - return [source.videoWidth, source.videoHeight, 1]; - } - else { - const maybeHasWidthAndHeight = source; - const { width, height } = maybeHasWidthAndHeight; - if (width > 0 && height > 0 && !isTextureRawDataSource(source)) { - // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData - return [width, height, 1]; - } - const format = options.format || 'rgba8unorm'; - const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format); - const data = isTypedArray(source) || Array.isArray(source) - ? source - : source.data; - const numBytes = isTypedArray(data) - ? data.byteLength - : (data.length * bytesPerChannel); - const numElements = numBytes / bytesPerElement; - return guessDimensions(width, height, numElements); - } - } - /** - * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap) - * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount - * then it will automatically make the correct number of mip levels. - * - * Example: - * - * ```js - * const texture = createTextureFromSource( - * device, - * [ - * someCanvasOrVideoOrImageImageBitmap0, - * someCanvasOrVideoOrImageImageBitmap1, - * ], - * { - * usage: GPUTextureUsage.TEXTURE_BINDING | - * GPUTextureUsage.RENDER_ATTACHMENT | - * GPUTextureUsage.COPY_DST, - * mips: true, - * } - * ); - * ``` - */ - function createTextureFromSources(device, sources, options = {}) { - // NOTE: We assume all the sizes are the same. If they are not you'll get - // an error. - const size = getSizeFromSource(sources[0], options); - size[2] = size[2] > 1 ? size[2] : sources.length; - const texture = device.createTexture({ - dimension: textureViewDimensionToDimension(options.dimension), - format: options.format || 'rgba8unorm', - mipLevelCount: options.mipLevelCount - ? options.mipLevelCount - : options.mips ? numMipLevels(size) : 1, - size, - usage: (options.usage ?? 0) | - GPUTextureUsage.TEXTURE_BINDING | - GPUTextureUsage.COPY_DST | - GPUTextureUsage.RENDER_ATTACHMENT, - }); - copySourcesToTexture(device, texture, sources, options); - return texture; - } - /** - * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap) - * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount - * then it will automatically make the correct number of mip levels. - * - * Example: - * - * ```js - * const texture = createTextureFromSource( - * device, - * someCanvasOrVideoOrImageImageBitmap, - * { - * usage: GPUTextureUsage.TEXTURE_BINDING | - * GPUTextureUsage.RENDER_ATTACHMENT | - * GPUTextureUsage.COPY_DST, - * mips: true, - * } - * ); - * ``` - */ - function createTextureFromSource(device, source, options = {}) { - return createTextureFromSources(device, [source], options); - } - /** - * Load an ImageBitmap - * @param url - * @param options - * @returns the loaded ImageBitmap - */ - async function loadImageBitmap(url, options = {}) { - const res = await fetch(url); - const blob = await res.blob(); - const opt = { - ...options, - ...(options.colorSpaceConversion !== undefined && { colorSpaceConversion: 'none' }), - }; - return await createImageBitmap(blob, opt); - } - /** - * Load images and create a texture from them, optionally generating mip levels - * - * Assumes all the urls reference images of the same size. - * - * Example: - * - * ```js - * const texture = await createTextureFromImage( - * device, - * [ - * 'https://someimage1.url', - * 'https://someimage2.url', - * ], - * { - * mips: true, - * flipY: true, - * }, - * ); - * ``` - */ - async function createTextureFromImages(device, urls, options = {}) { - // TODO: start once we've loaded one? - // We need at least 1 to know the size of the texture to create - const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url))); - return createTextureFromSources(device, imgBitmaps, options); - } - /** - * Load an image and create a texture from it, optionally generating mip levels - * - * Example: - * - * ```js - * const texture = await createTextureFromImage(device, 'https://someimage.url', { - * mips: true, - * flipY: true, - * }); - * ``` - */ - async function createTextureFromImage(device, url, options = {}) { - return createTextureFromImages(device, [url], options); - } - - /* - * Copyright 2023 Gregg Tavares - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - /** - * A class to provide `push` on a typed array. - * - * example: - * - * ```js - * const positions = new TypedArrayWrapper(new Float32Array(300), 3); - * positions.push(1, 2, 3); // add a position - * positions.push([4, 5, 6]); // add a position - * positions.push(new Float32Array(6)); // add 2 positions - * const data = positions.typedArray; - * ``` - */ - class TypedArrayWrapper { - typedArray; - cursor = 0; - numComponents; - constructor(arr, numComponents) { - this.typedArray = arr; - this.numComponents = numComponents; - } - get numElements() { - return this.typedArray.length / this.numComponents; - } - push(...data) { - for (const value of data) { - if (Array.isArray(value) || isTypedArray(value)) { - const asArray = data; - this.typedArray.set(asArray, this.cursor); - this.cursor += asArray.length; - } - else { - this.typedArray[this.cursor++] = value; - } - } - } - reset(index = 0) { - this.cursor = index; - } - } - /** - * creates a typed array with a `push` function attached - * so that you can easily *push* values. - * - * `push` can take multiple arguments. If an argument is an array each element - * of the array will be added to the typed array. - * - * Example: - * - * const array = createAugmentedTypedArray(3, 2, Float32Array); - * array.push(1, 2, 3); - * array.push([4, 5, 6]); - * // array now contains [1, 2, 3, 4, 5, 6] - * - * Also has `numComponents` and `numElements` properties. - * - * @param numComponents number of components - * @param numElements number of elements. The total size of the array will be `numComponents * numElements`. - * @param Type A constructor for the type. Default = `Float32Array`. - */ - function createAugmentedTypedArray(numComponents, numElements, Type) { - return new TypedArrayWrapper(new Type(numComponents * numElements), numComponents); - } - /** - * Creates XY quad vertices - * - * The default with no parameters will return a 2x2 quad with values from -1 to +1. - * If you want a unit quad with that goes from 0 to 1 you'd call it with - * - * createXYQuadVertices(1, 0.5, 0.5); - * - * If you want a unit quad centered above 0,0 you'd call it with - * - * primitives.createXYQuadVertices(1, 0, 0.5); - * - * @param params - * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 - * @param params.xOffset the amount to offset the quad in X. Default = 0 - * @param params.yOffset the amount to offset the quad in Y. Default = 0 - * @return the created XY Quad vertices - */ - function createXYQuadVertices({ size: inSize = 2, xOffset = 0, yOffset = 0 } = {}) { - const size = inSize * 0.5; - return { - position: { - numComponents: 2, - data: [ - xOffset + -1 * size, yOffset + -1 * size, - xOffset + 1 * size, yOffset + -1 * size, - xOffset + -1 * size, yOffset + 1 * size, - xOffset + 1 * size, yOffset + 1 * size, - ], - }, - normal: [ - 0, 0, 1, - 0, 0, 1, - 0, 0, 1, - 0, 0, 1, - ], - texcoord: [ - 0, 0, - 1, 0, - 0, 1, - 1, 1, - ], - indices: [0, 1, 2, 2, 1, 3], - }; - } - /** - * Creates XZ plane vertices. - * - * The created plane has position, normal, and texcoord data - * - * @param params - * @param params.width Width of the plane. Default = 1 - * @param params.depth Depth of the plane. Default = 1 - * @param params.subdivisionsWidth Number of steps across the plane. Default = 1 - * @param params.subdivisionsDepth Number of steps down the plane. Default = 1 - * @return The created plane vertices. - */ - function createPlaneVertices({ width = 1, depth = 1, subdivisionsWidth = 1, subdivisionsDepth = 1, } = {}) { - const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - for (let z = 0; z <= subdivisionsDepth; z++) { - for (let x = 0; x <= subdivisionsWidth; x++) { - const u = x / subdivisionsWidth; - const v = z / subdivisionsDepth; - positions.push(width * u - width * 0.5, 0, depth * v - depth * 0.5); - normals.push(0, 1, 0); - texcoords.push(u, v); - } - } - const numVertsAcross = subdivisionsWidth + 1; - const indices = createAugmentedTypedArray(3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array); - for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line - for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line - // Make triangle 1 of quad. - indices.push((z + 0) * numVertsAcross + x, (z + 1) * numVertsAcross + x, (z + 0) * numVertsAcross + x + 1); - // Make triangle 2 of quad. - indices.push((z + 1) * numVertsAcross + x, (z + 1) * numVertsAcross + x + 1, (z + 0) * numVertsAcross + x + 1); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - /** - * Creates sphere vertices. - * - * The created sphere has position, normal, and texcoord data - * - * @param params - * @param params.radius radius of the sphere. Default = 1 - * @param params.subdivisionsAxis number of steps around the sphere. Default = 24 - * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12 - * @param params.startLatitudeInRadians where to start the - * top of the sphere. Default = 0 - * @param params.endLatitudeInRadians Where to end the - * bottom of the sphere. Default = π - * @param params.startLongitudeInRadians where to start - * wrapping the sphere. Default = 0 - * @param params.endLongitudeInRadians where to end - * wrapping the sphere. Default = 2π - * @return The created sphere vertices. - */ - function createSphereVertices({ radius = 1, subdivisionsAxis = 24, subdivisionsHeight = 12, startLatitudeInRadians = 0, endLatitudeInRadians = Math.PI, startLongitudeInRadians = 0, endLongitudeInRadians = Math.PI * 2, } = {}) { - if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) { - throw new Error('subdivisionAxis and subdivisionHeight must be > 0'); - } - const latRange = endLatitudeInRadians - startLatitudeInRadians; - const longRange = endLongitudeInRadians - startLongitudeInRadians; - // We are going to generate our sphere by iterating through its - // spherical coordinates and generating 2 triangles for each quad on a - // ring of the sphere. - const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - // Generate the individual vertices in our vertex buffer. - for (let y = 0; y <= subdivisionsHeight; y++) { - for (let x = 0; x <= subdivisionsAxis; x++) { - // Generate a vertex based on its spherical coordinates - const u = x / subdivisionsAxis; - const v = y / subdivisionsHeight; - const theta = longRange * u + startLongitudeInRadians; - const phi = latRange * v + startLatitudeInRadians; - const sinTheta = Math.sin(theta); - const cosTheta = Math.cos(theta); - const sinPhi = Math.sin(phi); - const cosPhi = Math.cos(phi); - const ux = cosTheta * sinPhi; - const uy = cosPhi; - const uz = sinTheta * sinPhi; - positions.push(radius * ux, radius * uy, radius * uz); - normals.push(ux, uy, uz); - texcoords.push(1 - u, v); - } - } - const numVertsAround = subdivisionsAxis + 1; - const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array); - for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line - for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line - // Make triangle 1 of quad. - indices.push((y + 0) * numVertsAround + x, (y + 0) * numVertsAround + x + 1, (y + 1) * numVertsAround + x); - // Make triangle 2 of quad. - indices.push((y + 1) * numVertsAround + x, (y + 0) * numVertsAround + x + 1, (y + 1) * numVertsAround + x + 1); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - /** - * Array of the indices of corners of each face of a cube. - */ - const CUBE_FACE_INDICES = [ - [3, 7, 5, 1], - [6, 2, 0, 4], - [6, 7, 3, 2], - [0, 1, 5, 4], - [7, 6, 4, 5], - [2, 3, 1, 0], // back - ]; - /** - * Creates the vertices and indices for a cube. - * - * The cube is created around the origin. (-size / 2, size / 2). - * - * @param params - * @param params.size width, height and depth of the cube. Default = 1 - * @return The created vertices. - */ - function createCubeVertices({ size = 1 } = {}) { - const k = size / 2; - const cornerVertices = [ - [-k, -k, -k], - [+k, -k, -k], - [-k, +k, -k], - [+k, +k, -k], - [-k, -k, +k], - [+k, -k, +k], - [-k, +k, +k], - [+k, +k, +k], - ]; - const faceNormals = [ - [+1, +0, +0], - [-1, +0, +0], - [+0, +1, +0], - [+0, -1, +0], - [+0, +0, +1], - [+0, +0, -1], - ]; - const uvCoords = [ - [1, 0], - [0, 0], - [0, 1], - [1, 1], - ]; - const numVertices = 6 * 4; - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array); - for (let f = 0; f < 6; ++f) { - const faceIndices = CUBE_FACE_INDICES[f]; - for (let v = 0; v < 4; ++v) { - const position = cornerVertices[faceIndices[v]]; - const normal = faceNormals[f]; - const uv = uvCoords[v]; - // Each face needs all four vertices because the normals and texture - // coordinates are not all the same. - positions.push(...position); - normals.push(...normal); - texcoords.push(...uv); - } - // Two triangles make a square face. - const offset = 4 * f; - indices.push(offset + 0, offset + 1, offset + 2); - indices.push(offset + 0, offset + 2, offset + 3); - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - /** - * Creates vertices for a truncated cone, which is like a cylinder - * except that it has different top and bottom radii. A truncated cone - * can also be used to create cylinders and regular cones. The - * truncated cone will be created centered about the origin, with the - * y axis as its vertical axis. . - * - * @param bottomRadius Bottom radius of truncated cone. Default = 1 - * @param topRadius Top radius of truncated cone. Default = 0 - * @param height Height of truncated cone. Default = 1 - * @param radialSubdivisions The number of subdivisions around the - * truncated cone. Default = 24 - * @param verticalSubdivisions The number of subdivisions down the - * truncated cone. Default = 1 - * @param topCap Create top cap. Default = true. - * @param bottomCap Create bottom cap. Default = true. - * @return The created cone vertices. - */ - function createTruncatedConeVertices({ bottomRadius = 1, topRadius = 0, height = 1, radialSubdivisions = 24, verticalSubdivisions = 1, topCap = true, bottomCap = true, } = {}) { - if (radialSubdivisions < 3) { - throw new Error('radialSubdivisions must be 3 or greater'); - } - if (verticalSubdivisions < 1) { - throw new Error('verticalSubdivisions must be 1 or greater'); - } - const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0); - const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array); - const vertsAroundEdge = radialSubdivisions + 1; - // The slant of the cone is constant across its surface - const slant = Math.atan2(bottomRadius - topRadius, height); - const cosSlant = Math.cos(slant); - const sinSlant = Math.sin(slant); - const start = topCap ? -2 : 0; - const end = verticalSubdivisions + (bottomCap ? 2 : 0); - for (let yy = start; yy <= end; ++yy) { - let v = yy / verticalSubdivisions; - let y = height * v; - let ringRadius; - if (yy < 0) { - y = 0; - v = 1; - ringRadius = bottomRadius; - } - else if (yy > verticalSubdivisions) { - y = height; - v = 1; - ringRadius = topRadius; - } - else { - ringRadius = bottomRadius + - (topRadius - bottomRadius) * (yy / verticalSubdivisions); - } - if (yy === -2 || yy === verticalSubdivisions + 2) { - ringRadius = 0; - v = 0; - } - y -= height / 2; - for (let ii = 0; ii < vertsAroundEdge; ++ii) { - const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions); - const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions); - positions.push(sin * ringRadius, y, cos * ringRadius); - if (yy < 0) { - normals.push(0, -1, 0); - } - else if (yy > verticalSubdivisions) { - normals.push(0, 1, 0); - } - else if (ringRadius === 0.0) { - normals.push(0, 0, 0); - } - else { - normals.push(sin * cosSlant, sinSlant, cos * cosSlant); - } - texcoords.push((ii / radialSubdivisions), 1 - v); - } - } - for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line - if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) { - continue; - } - for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line - indices.push(vertsAroundEdge * (yy + 0) + 0 + ii, vertsAroundEdge * (yy + 0) + 1 + ii, vertsAroundEdge * (yy + 1) + 1 + ii); - indices.push(vertsAroundEdge * (yy + 0) + 0 + ii, vertsAroundEdge * (yy + 1) + 1 + ii, vertsAroundEdge * (yy + 1) + 0 + ii); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - /** - * Expands RLE data - * @param rleData data in format of run-length, x, y, z, run-length, x, y, z - * @param padding value to add each entry with. - * @return the expanded rleData - */ - function expandRLEData(rleData, padding = []) { - padding = padding || []; - const data = []; - for (let ii = 0; ii < rleData.length; ii += 4) { - const runLength = rleData[ii]; - const element = rleData.slice(ii + 1, ii + 4); - element.push(...padding); - for (let jj = 0; jj < runLength; ++jj) { - data.push(...element); - } - } - return data; - } - /** - * Creates 3D 'F' vertices. - * An 'F' is useful because you can easily tell which way it is oriented. - * The created 'F' has position, normal, texcoord, and color arrays. - * - * @return The created vertices. - */ - function create3DFVertices() { - const positions = [ - // left column front - 0, 0, 0, - 0, 150, 0, - 30, 0, 0, - 0, 150, 0, - 30, 150, 0, - 30, 0, 0, - // top rung front - 30, 0, 0, - 30, 30, 0, - 100, 0, 0, - 30, 30, 0, - 100, 30, 0, - 100, 0, 0, - // middle rung front - 30, 60, 0, - 30, 90, 0, - 67, 60, 0, - 30, 90, 0, - 67, 90, 0, - 67, 60, 0, - // left column back - 0, 0, 30, - 30, 0, 30, - 0, 150, 30, - 0, 150, 30, - 30, 0, 30, - 30, 150, 30, - // top rung back - 30, 0, 30, - 100, 0, 30, - 30, 30, 30, - 30, 30, 30, - 100, 0, 30, - 100, 30, 30, - // middle rung back - 30, 60, 30, - 67, 60, 30, - 30, 90, 30, - 30, 90, 30, - 67, 60, 30, - 67, 90, 30, - // top - 0, 0, 0, - 100, 0, 0, - 100, 0, 30, - 0, 0, 0, - 100, 0, 30, - 0, 0, 30, - // top rung front - 100, 0, 0, - 100, 30, 0, - 100, 30, 30, - 100, 0, 0, - 100, 30, 30, - 100, 0, 30, - // under top rung - 30, 30, 0, - 30, 30, 30, - 100, 30, 30, - 30, 30, 0, - 100, 30, 30, - 100, 30, 0, - // between top rung and middle - 30, 30, 0, - 30, 60, 30, - 30, 30, 30, - 30, 30, 0, - 30, 60, 0, - 30, 60, 30, - // top of middle rung - 30, 60, 0, - 67, 60, 30, - 30, 60, 30, - 30, 60, 0, - 67, 60, 0, - 67, 60, 30, - // front of middle rung - 67, 60, 0, - 67, 90, 30, - 67, 60, 30, - 67, 60, 0, - 67, 90, 0, - 67, 90, 30, - // bottom of middle rung. - 30, 90, 0, - 30, 90, 30, - 67, 90, 30, - 30, 90, 0, - 67, 90, 30, - 67, 90, 0, - // front of bottom - 30, 90, 0, - 30, 150, 30, - 30, 90, 30, - 30, 90, 0, - 30, 150, 0, - 30, 150, 30, - // bottom - 0, 150, 0, - 0, 150, 30, - 30, 150, 30, - 0, 150, 0, - 30, 150, 30, - 30, 150, 0, - // left side - 0, 0, 0, - 0, 0, 30, - 0, 150, 30, - 0, 0, 0, - 0, 150, 30, - 0, 150, 0, - ]; - const texcoords = [ - // left column front - 0.22, 0.19, - 0.22, 0.79, - 0.34, 0.19, - 0.22, 0.79, - 0.34, 0.79, - 0.34, 0.19, - // top rung front - 0.34, 0.19, - 0.34, 0.31, - 0.62, 0.19, - 0.34, 0.31, - 0.62, 0.31, - 0.62, 0.19, - // middle rung front - 0.34, 0.43, - 0.34, 0.55, - 0.49, 0.43, - 0.34, 0.55, - 0.49, 0.55, - 0.49, 0.43, - // left column back - 0, 0, - 1, 0, - 0, 1, - 0, 1, - 1, 0, - 1, 1, - // top rung back - 0, 0, - 1, 0, - 0, 1, - 0, 1, - 1, 0, - 1, 1, - // middle rung back - 0, 0, - 1, 0, - 0, 1, - 0, 1, - 1, 0, - 1, 1, - // top - 0, 0, - 1, 0, - 1, 1, - 0, 0, - 1, 1, - 0, 1, - // top rung front - 0, 0, - 1, 0, - 1, 1, - 0, 0, - 1, 1, - 0, 1, - // under top rung - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - // between top rung and middle - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // top of middle rung - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // front of middle rung - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // bottom of middle rung. - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - // front of bottom - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // bottom - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - // left side - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - ]; - const normals = expandRLEData([ - // left column front - // top rung front - // middle rung front - 18, 0, 0, 1, - // left column back - // top rung back - // middle rung back - 18, 0, 0, -1, - // top - 6, 0, 1, 0, - // top rung front - 6, 1, 0, 0, - // under top rung - 6, 0, -1, 0, - // between top rung and middle - 6, 1, 0, 0, - // top of middle rung - 6, 0, 1, 0, - // front of middle rung - 6, 1, 0, 0, - // bottom of middle rung. - 6, 0, -1, 0, - // front of bottom - 6, 1, 0, 0, - // bottom - 6, 0, -1, 0, - // left side - 6, -1, 0, 0, - ]); - const colors = expandRLEData([ - // left column front - // top rung front - // middle rung front - 18, 200, 70, 120, - // left column back - // top rung back - // middle rung back - 18, 80, 70, 200, - // top - 6, 70, 200, 210, - // top rung front - 6, 200, 200, 70, - // under top rung - 6, 210, 100, 70, - // between top rung and middle - 6, 210, 160, 70, - // top of middle rung - 6, 70, 180, 210, - // front of middle rung - 6, 100, 70, 210, - // bottom of middle rung. - 6, 76, 210, 100, - // front of bottom - 6, 140, 210, 80, - // bottom - 6, 90, 130, 110, - // left side - 6, 160, 160, 220, - ], [255]); - const numVerts = positions.length / 3; - const arrays = { - position: createAugmentedTypedArray(3, numVerts, Float32Array), - texcoord: createAugmentedTypedArray(2, numVerts, Float32Array), - normal: createAugmentedTypedArray(3, numVerts, Float32Array), - color: createAugmentedTypedArray(4, numVerts, Uint8Array), - indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array), - }; - arrays.position.push(positions); - arrays.texcoord.push(texcoords); - arrays.normal.push(normals); - arrays.color.push(colors); - for (let ii = 0; ii < numVerts; ++ii) { - arrays.indices.push(ii); - } - return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray])); - } - /** - * Creates crescent vertices. - * - * @param params - * @param params.verticalRadius The vertical radius of the crescent. Default = 2 - * @param params.outerRadius The outer radius of the crescent. Default = 1 - * @param params.innerRadius The inner radius of the crescent. Default = 0 - * @param params.thickness The thickness of the crescent. Default = 1 - * @param params.subdivisionsDown number of steps around the crescent. Default = 12 - * @param params.startOffset Where to start arc. Default 0. Default = 0 - * @param params.endOffset Where to end arg. Default 1. Default = 1 - * @return The created vertices. - */ - function createCrescentVertices({ verticalRadius = 2, outerRadius = 1, innerRadius = 0, thickness = 1, subdivisionsDown = 12, startOffset = 0, endOffset = 1, } = {}) { - if (subdivisionsDown <= 0) { - throw new Error('subdivisionDown must be > 0'); - } - const subdivisionsThick = 2; - const offsetRange = endOffset - startOffset; - const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - function lerp(a, b, s) { - return a + (b - a) * s; - } - function vAdd(a, b) { - return a.map((v, i) => v + b[i]); - } - function vMultiply(a, b) { - return a.map((v, i) => v * b[i]); - } - function createArc(arcRadius, x, normalMult, normalAdd, uMult, uAdd) { - for (let z = 0; z <= subdivisionsDown; z++) { - const uBack = x / (subdivisionsThick - 1); - const v = z / subdivisionsDown; - const xBack = (uBack - 0.5) * 2; - const angle = (startOffset + (v * offsetRange)) * Math.PI; - const s = Math.sin(angle); - const c = Math.cos(angle); - const radius = lerp(verticalRadius, arcRadius, s); - const px = xBack * thickness; - const py = c * verticalRadius; - const pz = s * radius; - positions.push(px, py, pz); - const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd); - normals.push(n); - texcoords.push(uBack * uMult + uAdd, v); - } - } - // Generate the individual vertices in our vertex buffer. - for (let x = 0; x < subdivisionsThick; x++) { - const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2; - createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); - createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0); - createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); - createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1); - } - // Do outer surface. - const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array); - function createSurface(leftArcOffset, rightArcOffset) { - for (let z = 0; z < subdivisionsDown; ++z) { - // Make triangle 1 of quad. - indices.push(leftArcOffset + z + 0, leftArcOffset + z + 1, rightArcOffset + z + 0); - // Make triangle 2 of quad. - indices.push(leftArcOffset + z + 1, rightArcOffset + z + 1, rightArcOffset + z + 0); - } - } - const numVerticesDown = subdivisionsDown + 1; - // front - createSurface(numVerticesDown * 0, numVerticesDown * 4); - // right - createSurface(numVerticesDown * 5, numVerticesDown * 7); - // back - createSurface(numVerticesDown * 6, numVerticesDown * 2); - // left - createSurface(numVerticesDown * 3, numVerticesDown * 1); - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - /** - * Creates cylinder vertices. The cylinder will be created around the origin - * along the y-axis. - * - * @param params - * @param params.radius Radius of cylinder. Default = 1 - * @param params.height Height of cylinder. Default = 1 - * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24 - * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1 - * @param params.topCap Create top cap. Default = true. - * @param params.bottomCap Create bottom cap. Default = true. - * @return The created vertices. - */ - function createCylinderVertices({ radius = 1, height = 1, radialSubdivisions = 24, verticalSubdivisions = 1, topCap = true, bottomCap = true, } = {}) { - return createTruncatedConeVertices({ - bottomRadius: radius, - topRadius: radius, - height, - radialSubdivisions, - verticalSubdivisions, - topCap, - bottomCap, - }); - } - /** - * Creates vertices for a torus - * - * @param params - * @param params.radius radius of center of torus circle. Default = 1 - * @param params.thickness radius of torus ring. Default = 0.24 - * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24 - * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12 - * @param params.startAngle start angle in radians. Default = 0. - * @param params.endAngle end angle in radians. Default = Math.PI * 2. - * @return The created vertices. - */ - function createTorusVertices({ radius = 1, thickness = 0.24, radialSubdivisions = 24, bodySubdivisions = 12, startAngle = 0, endAngle = Math.PI * 2, } = {}) { - if (radialSubdivisions < 3) { - throw new Error('radialSubdivisions must be 3 or greater'); - } - if (bodySubdivisions < 3) { - throw new Error('verticalSubdivisions must be 3 or greater'); - } - const range = endAngle - startAngle; - const radialParts = radialSubdivisions + 1; - const bodyParts = bodySubdivisions + 1; - const numVertices = radialParts * bodyParts; - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array); - for (let slice = 0; slice < bodyParts; ++slice) { - const v = slice / bodySubdivisions; - const sliceAngle = v * Math.PI * 2; - const sliceSin = Math.sin(sliceAngle); - const ringRadius = radius + sliceSin * thickness; - const ny = Math.cos(sliceAngle); - const y = ny * thickness; - for (let ring = 0; ring < radialParts; ++ring) { - const u = ring / radialSubdivisions; - const ringAngle = startAngle + u * range; - const xSin = Math.sin(ringAngle); - const zCos = Math.cos(ringAngle); - const x = xSin * ringRadius; - const z = zCos * ringRadius; - const nx = xSin * sliceSin; - const nz = zCos * sliceSin; - positions.push(x, y, z); - normals.push(nx, ny, nz); - texcoords.push(u, 1 - v); - } - } - for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line - for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line - const nextRingIndex = 1 + ring; - const nextSliceIndex = 1 + slice; - indices.push(radialParts * slice + ring, radialParts * nextSliceIndex + ring, radialParts * slice + nextRingIndex); - indices.push(radialParts * nextSliceIndex + ring, radialParts * nextSliceIndex + nextRingIndex, radialParts * slice + nextRingIndex); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - /** - * Creates disc vertices. The disc will be in the xz plane, centered at - * the origin. When creating, at least 3 divisions, or pie - * pieces, need to be specified, otherwise the triangles making - * up the disc will be degenerate. You can also specify the - * number of radial pieces `stacks`. A value of 1 for - * stacks will give you a simple disc of pie pieces. If you - * want to create an annulus you can set `innerRadius` to a - * value > 0. Finally, `stackPower` allows you to have the widths - * increase or decrease as you move away from the center. This - * is particularly useful when using the disc as a ground plane - * with a fixed camera such that you don't need the resolution - * of small triangles near the perimeter. For example, a value - * of 2 will produce stacks whose outside radius increases with - * the square of the stack index. A value of 1 will give uniform - * stacks. - * - * @param params - * @param params.radius Radius of the ground plane. Default = 1 - * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24 - * @param params.stacks Number of radial divisions. Default = 1 - * @param params.innerRadius Default = 0 - * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1 - * @return The created vertices. - */ - function createDiscVertices({ radius = 1, divisions = 24, stacks = 1, innerRadius = 0, stackPower = 1, } = {}) { - if (divisions < 3) { - throw new Error('divisions must be at least 3'); - } - // Note: We don't share the center vertex because that would - // mess up texture coordinates. - const numVertices = (divisions + 1) * (stacks + 1); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array); - let firstIndex = 0; - const radiusSpan = radius - innerRadius; - const pointsPerStack = divisions + 1; - // Build the disk one stack at a time. - for (let stack = 0; stack <= stacks; ++stack) { - const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower); - for (let i = 0; i <= divisions; ++i) { - const theta = 2.0 * Math.PI * i / divisions; - const x = stackRadius * Math.cos(theta); - const z = stackRadius * Math.sin(theta); - positions.push(x, 0, z); - normals.push(0, 1, 0); - texcoords.push(1 - (i / divisions), stack / stacks); - if (stack > 0 && i !== divisions) { - // a, b, c and d are the indices of the vertices of a quad. unless - // the current stack is the one closest to the center, in which case - // the vertices a and b connect to the center vertex. - const a = firstIndex + (i + 1); - const b = firstIndex + i; - const c = firstIndex + i - pointsPerStack; - const d = firstIndex + (i + 1) - pointsPerStack; - // Make a quad of the vertices a, b, c, d. - indices.push(a, b, c); - indices.push(a, c, d); - } - } - firstIndex += divisions + 1; - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; - } - - var primitives = /*#__PURE__*/Object.freeze({ - __proto__: null, - TypedArrayWrapper: TypedArrayWrapper, - create3DFVertices: create3DFVertices, - createCrescentVertices: createCrescentVertices, - createCubeVertices: createCubeVertices, - createCylinderVertices: createCylinderVertices, - createDiscVertices: createDiscVertices, - createPlaneVertices: createPlaneVertices, - createSphereVertices: createSphereVertices, - createTorusVertices: createTorusVertices, - createTruncatedConeVertices: createTruncatedConeVertices, - createXYQuadVertices: createXYQuadVertices - }); - - exports.TypedArrayViewGenerator = TypedArrayViewGenerator; - exports.copySourceToTexture = copySourceToTexture; - exports.copySourcesToTexture = copySourcesToTexture; - exports.createBufferLayoutsFromArrays = createBufferLayoutsFromArrays; - exports.createBuffersAndAttributesFromArrays = createBuffersAndAttributesFromArrays; - exports.createTextureFromImage = createTextureFromImage; - exports.createTextureFromImages = createTextureFromImages; - exports.createTextureFromSource = createTextureFromSource; - exports.createTextureFromSources = createTextureFromSources; - exports.drawArrays = drawArrays; - exports.generateMipmap = generateMipmap; - exports.getSizeAndAlignmentOfUnsizedArrayElement = getSizeAndAlignmentOfUnsizedArrayElement; - exports.getSizeForMipFromTexture = getSizeForMipFromTexture; - exports.getSizeFromSource = getSizeFromSource; - exports.interleaveVertexData = interleaveVertexData; - exports.isTypedArray = isTypedArray; - exports.kTypes = kTypes; - exports.loadImageBitmap = loadImageBitmap; - exports.makeBindGroupLayoutDescriptors = makeBindGroupLayoutDescriptors; - exports.makeShaderDataDefinitions = makeShaderDataDefinitions; - exports.makeStructuredView = makeStructuredView; - exports.makeTypedArrayViews = makeTypedArrayViews; - exports.normalizeGPUExtent3D = normalizeGPUExtent3D; - exports.numMipLevels = numMipLevels; - exports.primitives = primitives; - exports.setIntrinsicsToView = setIntrinsicsToView; - exports.setStructuredValues = setStructuredValues; - exports.setStructuredView = setStructuredView; - exports.setTypedValues = setTypedValues; - exports.setVertexAndIndexBuffers = setVertexAndIndexBuffers; - exports.subarray = subarray; - -})); -//# sourceMappingURL=webgpu-utils.js.map diff --git a/dist/1.x/webgpu-utils.js.map b/dist/1.x/webgpu-utils.js.map deleted file mode 100644 index 69b2cc4..0000000 --- a/dist/1.x/webgpu-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webgpu-utils.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created. 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 kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {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 = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param 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 } = typeInfo[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) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n 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 (_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 (_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.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}\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 Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n 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 }\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 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 discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right)) {\n return null;\n }\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 const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.resources = [];\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.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 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 continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n fn.resources = this._findResources(node);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\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 _findResources(fn) {\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 if (varStack.length > 0) {\n const v = node;\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof Let) {\n if (varStack.length > 0) {\n const v = node;\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 fn = self._functions.get(c.name);\n if (fn) {\n if (fn.resources === null) {\n fn.resources = self._findResources(fn.node);\n }\n resources.push(...fn.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 if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While, _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';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\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\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: 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 return bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\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 };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\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);\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 structs,\n storages,\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 */\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n","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) {\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\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n\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) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param 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 } = {}) {\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} = {}) {\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} = {}) {\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} = {}) {\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} = {}) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param params\n * @param params.verticalRadius The vertical radius of the crescent. Default = 2\n * @param params.outerRadius The outer radius of the crescent. Default = 1\n * @param params.innerRadius The inner radius of the crescent. Default = 0\n * @param params.thickness The thickness of the crescent. Default = 1\n * @param params.subdivisionsDown number of steps around the crescent. Default = 12\n * @param params.startOffset Where to start arc. Default 0. Default = 0\n * @param params.endOffset Where to end arg. Default 1. Default = 1\n * @return The created vertices.\n */\nexport function createCrescentVertices({\n verticalRadius = 2,\n outerRadius = 1,\n innerRadius = 0,\n thickness = 1,\n subdivisionsDown = 12,\n startOffset = 0,\n endOffset = 1,\n} = {}) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param 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} = {}) {\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} = {}) {\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} = {}) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";;;;;;;IAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,CAAC;IAE/G,SAAU,MAAM,CAAmB,GAA0B,EAAA;IACjE,IAAA,OAAQ,MAAM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_google_ignoreList":[3]} \ No newline at end of file diff --git a/dist/1.x/webgpu-utils.min.js b/dist/1.x/webgpu-utils.min.js deleted file mode 100644 index b3f47f5..0000000 --- a/dist/1.x/webgpu-utils.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).webgpuUtils={})}(this,(function(e){"use strict";const t=(e,t)=>((e+t-1)/t|0)*t;const r=e=>e&&"number"==typeof e.length&&e.buffer instanceof ArrayBuffer&&"number"==typeof e.byteLength,s={i32:{numElements:1,align:4,size:4,type:"i32",View:Int32Array},u32:{numElements:1,align:4,size:4,type:"u32",View:Uint32Array},f32:{numElements:1,align:4,size:4,type:"f32",View:Float32Array},f16:{numElements:1,align:2,size:2,type:"u16",View:Uint16Array},vec2f:{numElements:2,align:8,size:8,type:"f32",View:Float32Array},vec2i:{numElements:2,align:8,size:8,type:"i32",View:Int32Array},vec2u:{numElements:2,align:8,size:8,type:"u32",View:Uint32Array},vec2h:{numElements:2,align:4,size:4,type:"u16",View:Uint16Array},vec3i:{numElements:3,align:16,size:12,type:"i32",View:Int32Array},vec3u:{numElements:3,align:16,size:12,type:"u32",View:Uint32Array},vec3f:{numElements:3,align:16,size:12,type:"f32",View:Float32Array},vec3h:{numElements:3,align:8,size:6,type:"u16",View:Uint16Array},vec4i:{numElements:4,align:16,size:16,type:"i32",View:Int32Array},vec4u:{numElements:4,align:16,size:16,type:"u32",View:Uint32Array},vec4f:{numElements:4,align:16,size:16,type:"f32",View:Float32Array},vec4h:{numElements:4,align:8,size:8,type:"u16",View:Uint16Array},mat2x2f:{numElements:4,align:8,size:16,type:"f32",View:Float32Array},mat2x2h:{numElements:4,align:4,size:8,type:"u16",View:Uint16Array},mat3x2f:{numElements:6,align:8,size:24,type:"f32",View:Float32Array},mat3x2h:{numElements:6,align:4,size:12,type:"u16",View:Uint16Array},mat4x2f:{numElements:8,align:8,size:32,type:"f32",View:Float32Array},mat4x2h:{numElements:8,align:4,size:16,type:"u16",View:Uint16Array},mat2x3f:{numElements:8,align:16,size:32,pad:[3,1],type:"f32",View:Float32Array},mat2x3h:{numElements:8,align:8,size:16,pad:[3,1],type:"u16",View:Uint16Array},mat3x3f:{numElements:12,align:16,size:48,pad:[3,1],type:"f32",View:Float32Array},mat3x3h:{numElements:12,align:8,size:24,pad:[3,1],type:"u16",View:Uint16Array},mat4x3f:{numElements:16,align:16,size:64,pad:[3,1],type:"f32",View:Float32Array},mat4x3h:{numElements:16,align:8,size:32,pad:[3,1],type:"u16",View:Uint16Array},mat2x4f:{numElements:8,align:16,size:32,type:"f32",View:Float32Array},mat2x4h:{numElements:8,align:8,size:16,type:"u16",View:Uint16Array},mat3x4f:{numElements:12,align:16,size:48,pad:[3,1],type:"f32",View:Float32Array},mat3x4h:{numElements:12,align:8,size:24,pad:[3,1],type:"u16",View:Uint16Array},mat4x4f:{numElements:16,align:16,size:64,type:"f32",View:Float32Array},mat4x4h:{numElements:16,align:8,size:32,type:"u16",View:Uint16Array},bool:{numElements:0,align:1,size:0,type:"bool",View:Uint32Array}},n={...s,"vec2":s.vec2i,"vec2":s.vec2u,"vec2":s.vec2f,"vec2":s.vec2h,"vec3":s.vec3i,"vec3":s.vec3u,"vec3":s.vec3f,"vec3":s.vec3h,"vec4":s.vec4i,"vec4":s.vec4u,"vec4":s.vec4f,"vec4":s.vec4h,"mat2x2":s.mat2x2f,"mat2x2":s.mat2x2h,"mat3x2":s.mat3x2f,"mat3x2":s.mat3x2h,"mat4x2":s.mat4x2f,"mat4x2":s.mat4x2h,"mat2x3":s.mat2x3f,"mat2x3":s.mat2x3h,"mat3x3":s.mat3x3f,"mat3x3":s.mat3x3h,"mat4x3":s.mat4x3f,"mat4x3":s.mat4x3h,"mat2x4":s.mat2x4f,"mat2x4":s.mat2x4h,"mat3x4":s.mat3x4f,"mat3x4":s.mat3x4h,"mat4x4":s.mat4x4f,"mat4x4":s.mat4x4h},i=(a=n,Object.keys(a));var a;function o(e=[],t){const r=new Set;for(const s of i){const i=n[s];r.has(i)||(r.add(i),i.flatten=e.includes(s)?t:!t)}}function u(e,r,s,i){const{size:a,type:o}=e;try{const{View:e,align:u}=n[o],c=void 0!==i,l=c?t(a,u):a,h=l/e.BYTES_PER_ELEMENT;return new e(r,s,h*(c?0===i?(r.byteLength-s)/l:i:1))}catch{throw new Error(`unknown type: ${o}`)}}function c(e){return!e.fields&&!e.elementType}function l(e,r,s){const i=s||0,a=r||new ArrayBuffer(function(e){const r=e;if(r.elementType)return r.size;{const s=e,i=r.numElements||1;if(s.fields)return e.size*i;{const r=e,{align:s}=n[r.type];return i>1?t(e.size,s)*i:e.size}}}(e)),o=(e,t)=>{const r=e,s=r.elementType;if(s){if(c(s)&&n[s.type].flatten)return u(s,a,t,r.numElements);{const{size:n}=y(e),u=0===r.numElements?(a.byteLength-t)/n:r.numElements;return i=e=>o(s,t+n*e),new Array(u).fill(0).map(((e,t)=>i(t)))}}if("string"==typeof e)throw Error("unreachable");{const r=e.fields;if(r){const e={};for(const[s,{type:n,offset:i}]of Object.entries(r))e[s]=o(n,t+i);return e}return u(e,a,t)}var i};return{views:o(e,i),arrayBuffer:a}}function h(e,t){if(void 0!==e)if(r(t)){const s=t;if(1===s.length&&"number"==typeof e)s[0]=e;else if(Array.isArray(e[0])||r(e[0])){const t=e[0].length,r=3===t?4:t;for(let t=0;t{h(e,r[t])}))}else{const r=t;for(const[t,s]of Object.entries(e)){const e=r[t];e&&h(s,e)}}}o();const _=new WeakMap;function d(e,t){const r=function(e){let t=_.get(e);return t||(t=new Map,_.set(e,t)),t}(e);let s=r.get(t);return s||(s=new t(e),r.set(t,s)),s}function p(e,t,r,s){const i=d(r,n[e.type].View),a=s/i.BYTES_PER_ELEMENT;"number"==typeof t?i[a]=t:i.set(t,a)}function f(e,t,s,n=0){const i=e.elementType;if(i){if(c(i)){const e=i;if(function(e){return r(e)||Array.isArray(e)&&"number"==typeof e[0]}(t))return void p(e,t,s,n)}return void t.forEach(((e,t)=>{f(i,e,s,n+i.size*t)}))}const a=e.fields;if(a)for(const[e,r]of Object.entries(t)){const t=a[e];t&&f(t.type,r,s,n+t.offset)}else p(e,t,s,n)}function m(e){const t=e.elementType;if(t)return m(t);const r=e.fields;if(r)return Object.values(r).reduce(((e,{type:t})=>Math.max(e,m(t))),0);const{type:s}=e,{align:i}=n[s];return i}function y(e){const r=e.elementType;if(r){const e=r.size,s=m(r);return{unalignedSize:e,align:s,size:t(e,s)}}const s=e.fields;if(s){const e=Object.values(s).pop();if(0===e.type.size)return y(e.type)}return{size:0,unalignedSize:0,align:1}}class g{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class w{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(e){throw new Error("Cannot evaluate node")}evaluateString(e){return this.evaluate(e).toString()}search(e){}searchBlock(e,t){if(e){t(k.instance);for(const r of e)r instanceof Array?this.searchBlock(r,t):r.search(t);t(x.instance)}}}class k extends w{}k.instance=new k;class x extends w{}x.instance=new x;class b extends w{constructor(){super()}}class v extends b{constructor(e,t,r,s){super(),this.name=e,this.args=t,this.returnType=r,this.body=s}get astNodeType(){return"function"}search(e){this.searchBlock(this.body,e)}}class A extends b{constructor(e){super(),this.expression=e}get astNodeType(){return"staticAssert"}search(e){this.expression.search(e)}}class E extends b{constructor(e,t){super(),this.condition=e,this.body=t}get astNodeType(){return"while"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class T extends b{constructor(e){super(),this.body=e}get astNodeType(){return"continuing"}search(e){this.searchBlock(this.body,e)}}class S extends b{constructor(e,t,r,s){super(),this.init=e,this.condition=t,this.increment=r,this.body=s}get astNodeType(){return"for"}search(e){var t,r,s;null===(t=this.init)||void 0===t||t.search(e),null===(r=this.condition)||void 0===r||r.search(e),null===(s=this.increment)||void 0===s||s.search(e),this.searchBlock(this.body,e)}}class z extends b{constructor(e,t,r,s,n){super(),this.name=e,this.type=t,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"var"}search(e){var t;e(this),null===(t=this.value)||void 0===t||t.search(e)}}class M extends b{constructor(e,t,r){super(),this.name=e,this.type=t,this.value=r}get astNodeType(){return"override"}search(e){var t;null===(t=this.value)||void 0===t||t.search(e)}}class I extends b{constructor(e,t,r,s,n){super(),this.name=e,this.type=t,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"let"}search(e){var t;null===(t=this.value)||void 0===t||t.search(e)}}class U extends b{constructor(e,t,r,s,n){super(),this.name=e,this.type=t,this.storage=r,this.access=s,this.value=n}get astNodeType(){return"const"}evaluate(e){return this.value.evaluate(e)}search(e){var t;null===(t=this.value)||void 0===t||t.search(e)}}var V,F,N,O,q;!function(e){e.increment="++",e.decrement="--"}(V||(V={})),function(e){e.parse=function(t){const r=t;if("parse"==r)throw new Error("Invalid value for IncrementOperator");return e[r]}}(V||(V={}));class P extends b{constructor(e,t){super(),this.operator=e,this.variable=t}get astNodeType(){return"increment"}search(e){this.variable.search(e)}}!function(e){e.assign="=",e.addAssign="+=",e.subtractAssin="-=",e.multiplyAssign="*=",e.divideAssign="/=",e.moduloAssign="%=",e.andAssign="&=",e.orAssign="|=",e.xorAssign="^=",e.shiftLeftAssign="<<=",e.shiftRightAssign=">>="}(F||(F={})),function(e){e.parse=function(e){const t=e;if("parse"==t)throw new Error("Invalid value for AssignOperator");return t}}(F||(F={}));class B extends b{constructor(e,t,r){super(),this.operator=e,this.variable=t,this.value=r}get astNodeType(){return"assign"}search(e){this.value.search(e)}}class C extends b{constructor(e,t){super(),this.name=e,this.args=t}get astNodeType(){return"call"}}class L extends b{constructor(e,t){super(),this.body=e,this.continuing=t}get astNodeType(){return"loop"}}class R extends b{constructor(e,t){super(),this.condition=e,this.body=t}get astNodeType(){return"body"}}class G extends b{constructor(e,t,r,s){super(),this.condition=e,this.body=t,this.elseif=r,this.else=s}get astNodeType(){return"if"}search(e){this.condition.search(e),this.searchBlock(this.body,e),this.searchBlock(this.elseif,e),this.searchBlock(this.else,e)}}class $ extends b{constructor(e){super(),this.value=e}get astNodeType(){return"return"}search(e){var t;null===(t=this.value)||void 0===t||t.search(e)}}class D extends b{constructor(e){super(),this.name=e}get astNodeType(){return"enable"}}class j extends b{constructor(e,t){super(),this.name=e,this.type=t}get astNodeType(){return"alias"}}class Y extends b{constructor(){super()}get astNodeType(){return"discard"}}class W extends b{constructor(){super()}get astNodeType(){return"break"}}class X extends b{constructor(){super()}get astNodeType(){return"continue"}}class H extends b{constructor(e){super(),this.name=e}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class Z extends H{constructor(e,t){super(e),this.members=t}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(e){for(let t=0;t":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class pe extends w{constructor(){super()}}class fe extends pe{constructor(e,t){super(),this.selector=e,this.body=t}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class me extends pe{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class ye extends w{constructor(e,t,r){super(),this.name=e,this.type=t,this.attributes=r}get astNodeType(){return"argument"}}class ge extends w{constructor(e,t){super(),this.condition=e,this.body=t}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class we extends w{constructor(e,t,r){super(),this.name=e,this.type=t,this.attributes=r}get astNodeType(){return"member"}}class ke extends w{constructor(e,t){super(),this.name=e,this.value=t}get astNodeType(){return"attribute"}}!function(e){e[e.token=0]="token",e[e.keyword=1]="keyword",e[e.reserved=2]="reserved"}(O||(O={}));class xe{constructor(e,t,r){this.name=e,this.type=t,this.rule=r}toString(){return this.name}}class be{}N=be,be.none=new xe("",O.reserved,""),be.eof=new xe("EOF",O.token,""),be.reserved={asm:new xe("asm",O.reserved,"asm"),bf16:new xe("bf16",O.reserved,"bf16"),do:new xe("do",O.reserved,"do"),enum:new xe("enum",O.reserved,"enum"),f16:new xe("f16",O.reserved,"f16"),f64:new xe("f64",O.reserved,"f64"),handle:new xe("handle",O.reserved,"handle"),i8:new xe("i8",O.reserved,"i8"),i16:new xe("i16",O.reserved,"i16"),i64:new xe("i64",O.reserved,"i64"),mat:new xe("mat",O.reserved,"mat"),premerge:new xe("premerge",O.reserved,"premerge"),regardless:new xe("regardless",O.reserved,"regardless"),typedef:new xe("typedef",O.reserved,"typedef"),u8:new xe("u8",O.reserved,"u8"),u16:new xe("u16",O.reserved,"u16"),u64:new xe("u64",O.reserved,"u64"),unless:new xe("unless",O.reserved,"unless"),using:new xe("using",O.reserved,"using"),vec:new xe("vec",O.reserved,"vec"),void:new xe("void",O.reserved,"void")},be.keywords={array:new xe("array",O.keyword,"array"),atomic:new xe("atomic",O.keyword,"atomic"),bool:new xe("bool",O.keyword,"bool"),f32:new xe("f32",O.keyword,"f32"),i32:new xe("i32",O.keyword,"i32"),mat2x2:new xe("mat2x2",O.keyword,"mat2x2"),mat2x3:new xe("mat2x3",O.keyword,"mat2x3"),mat2x4:new xe("mat2x4",O.keyword,"mat2x4"),mat3x2:new xe("mat3x2",O.keyword,"mat3x2"),mat3x3:new xe("mat3x3",O.keyword,"mat3x3"),mat3x4:new xe("mat3x4",O.keyword,"mat3x4"),mat4x2:new xe("mat4x2",O.keyword,"mat4x2"),mat4x3:new xe("mat4x3",O.keyword,"mat4x3"),mat4x4:new xe("mat4x4",O.keyword,"mat4x4"),ptr:new xe("ptr",O.keyword,"ptr"),sampler:new xe("sampler",O.keyword,"sampler"),sampler_comparison:new xe("sampler_comparison",O.keyword,"sampler_comparison"),struct:new xe("struct",O.keyword,"struct"),texture_1d:new xe("texture_1d",O.keyword,"texture_1d"),texture_2d:new xe("texture_2d",O.keyword,"texture_2d"),texture_2d_array:new xe("texture_2d_array",O.keyword,"texture_2d_array"),texture_3d:new xe("texture_3d",O.keyword,"texture_3d"),texture_cube:new xe("texture_cube",O.keyword,"texture_cube"),texture_cube_array:new xe("texture_cube_array",O.keyword,"texture_cube_array"),texture_multisampled_2d:new xe("texture_multisampled_2d",O.keyword,"texture_multisampled_2d"),texture_storage_1d:new xe("texture_storage_1d",O.keyword,"texture_storage_1d"),texture_storage_2d:new xe("texture_storage_2d",O.keyword,"texture_storage_2d"),texture_storage_2d_array:new xe("texture_storage_2d_array",O.keyword,"texture_storage_2d_array"),texture_storage_3d:new xe("texture_storage_3d",O.keyword,"texture_storage_3d"),texture_depth_2d:new xe("texture_depth_2d",O.keyword,"texture_depth_2d"),texture_depth_2d_array:new xe("texture_depth_2d_array",O.keyword,"texture_depth_2d_array"),texture_depth_cube:new xe("texture_depth_cube",O.keyword,"texture_depth_cube"),texture_depth_cube_array:new xe("texture_depth_cube_array",O.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new xe("texture_depth_multisampled_2d",O.keyword,"texture_depth_multisampled_2d"),texture_external:new xe("texture_external",O.keyword,"texture_external"),u32:new xe("u32",O.keyword,"u32"),vec2:new xe("vec2",O.keyword,"vec2"),vec3:new xe("vec3",O.keyword,"vec3"),vec4:new xe("vec4",O.keyword,"vec4"),bitcast:new xe("bitcast",O.keyword,"bitcast"),block:new xe("block",O.keyword,"block"),break:new xe("break",O.keyword,"break"),case:new xe("case",O.keyword,"case"),continue:new xe("continue",O.keyword,"continue"),continuing:new xe("continuing",O.keyword,"continuing"),default:new xe("default",O.keyword,"default"),discard:new xe("discard",O.keyword,"discard"),else:new xe("else",O.keyword,"else"),enable:new xe("enable",O.keyword,"enable"),fallthrough:new xe("fallthrough",O.keyword,"fallthrough"),false:new xe("false",O.keyword,"false"),fn:new xe("fn",O.keyword,"fn"),for:new xe("for",O.keyword,"for"),function:new xe("function",O.keyword,"function"),if:new xe("if",O.keyword,"if"),let:new xe("let",O.keyword,"let"),const:new xe("const",O.keyword,"const"),loop:new xe("loop",O.keyword,"loop"),while:new xe("while",O.keyword,"while"),private:new xe("private",O.keyword,"private"),read:new xe("read",O.keyword,"read"),read_write:new xe("read_write",O.keyword,"read_write"),return:new xe("return",O.keyword,"return"),storage:new xe("storage",O.keyword,"storage"),switch:new xe("switch",O.keyword,"switch"),true:new xe("true",O.keyword,"true"),alias:new xe("alias",O.keyword,"alias"),type:new xe("type",O.keyword,"type"),uniform:new xe("uniform",O.keyword,"uniform"),var:new xe("var",O.keyword,"var"),override:new xe("override",O.keyword,"override"),workgroup:new xe("workgroup",O.keyword,"workgroup"),write:new xe("write",O.keyword,"write"),r8unorm:new xe("r8unorm",O.keyword,"r8unorm"),r8snorm:new xe("r8snorm",O.keyword,"r8snorm"),r8uint:new xe("r8uint",O.keyword,"r8uint"),r8sint:new xe("r8sint",O.keyword,"r8sint"),r16uint:new xe("r16uint",O.keyword,"r16uint"),r16sint:new xe("r16sint",O.keyword,"r16sint"),r16float:new xe("r16float",O.keyword,"r16float"),rg8unorm:new xe("rg8unorm",O.keyword,"rg8unorm"),rg8snorm:new xe("rg8snorm",O.keyword,"rg8snorm"),rg8uint:new xe("rg8uint",O.keyword,"rg8uint"),rg8sint:new xe("rg8sint",O.keyword,"rg8sint"),r32uint:new xe("r32uint",O.keyword,"r32uint"),r32sint:new xe("r32sint",O.keyword,"r32sint"),r32float:new xe("r32float",O.keyword,"r32float"),rg16uint:new xe("rg16uint",O.keyword,"rg16uint"),rg16sint:new xe("rg16sint",O.keyword,"rg16sint"),rg16float:new xe("rg16float",O.keyword,"rg16float"),rgba8unorm:new xe("rgba8unorm",O.keyword,"rgba8unorm"),rgba8unorm_srgb:new xe("rgba8unorm_srgb",O.keyword,"rgba8unorm_srgb"),rgba8snorm:new xe("rgba8snorm",O.keyword,"rgba8snorm"),rgba8uint:new xe("rgba8uint",O.keyword,"rgba8uint"),rgba8sint:new xe("rgba8sint",O.keyword,"rgba8sint"),bgra8unorm:new xe("bgra8unorm",O.keyword,"bgra8unorm"),bgra8unorm_srgb:new xe("bgra8unorm_srgb",O.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new xe("rgb10a2unorm",O.keyword,"rgb10a2unorm"),rg11b10float:new xe("rg11b10float",O.keyword,"rg11b10float"),rg32uint:new xe("rg32uint",O.keyword,"rg32uint"),rg32sint:new xe("rg32sint",O.keyword,"rg32sint"),rg32float:new xe("rg32float",O.keyword,"rg32float"),rgba16uint:new xe("rgba16uint",O.keyword,"rgba16uint"),rgba16sint:new xe("rgba16sint",O.keyword,"rgba16sint"),rgba16float:new xe("rgba16float",O.keyword,"rgba16float"),rgba32uint:new xe("rgba32uint",O.keyword,"rgba32uint"),rgba32sint:new xe("rgba32sint",O.keyword,"rgba32sint"),rgba32float:new xe("rgba32float",O.keyword,"rgba32float"),static_assert:new xe("static_assert",O.keyword,"static_assert")},be.tokens={decimal_float_literal:new xe("decimal_float_literal",O.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new xe("hex_float_literal",O.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?))/),int_literal:new xe("int_literal",O.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new xe("uint_literal",O.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new xe("ident",O.token,/[a-zA-Z][0-9a-zA-Z_]*/),and:new xe("and",O.token,"&"),and_and:new xe("and_and",O.token,"&&"),arrow:new xe("arrow ",O.token,"->"),attr:new xe("attr",O.token,"@"),attr_left:new xe("attr_left",O.token,"[["),attr_right:new xe("attr_right",O.token,"]]"),forward_slash:new xe("forward_slash",O.token,"/"),bang:new xe("bang",O.token,"!"),bracket_left:new xe("bracket_left",O.token,"["),bracket_right:new xe("bracket_right",O.token,"]"),brace_left:new xe("brace_left",O.token,"{"),brace_right:new xe("brace_right",O.token,"}"),colon:new xe("colon",O.token,":"),comma:new xe("comma",O.token,","),equal:new xe("equal",O.token,"="),equal_equal:new xe("equal_equal",O.token,"=="),not_equal:new xe("not_equal",O.token,"!="),greater_than:new xe("greater_than",O.token,">"),greater_than_equal:new xe("greater_than_equal",O.token,">="),shift_right:new xe("shift_right",O.token,">>"),less_than:new xe("less_than",O.token,"<"),less_than_equal:new xe("less_than_equal",O.token,"<="),shift_left:new xe("shift_left",O.token,"<<"),modulo:new xe("modulo",O.token,"%"),minus:new xe("minus",O.token,"-"),minus_minus:new xe("minus_minus",O.token,"--"),period:new xe("period",O.token,"."),plus:new xe("plus",O.token,"+"),plus_plus:new xe("plus_plus",O.token,"++"),or:new xe("or",O.token,"|"),or_or:new xe("or_or",O.token,"||"),paren_left:new xe("paren_left",O.token,"("),paren_right:new xe("paren_right",O.token,")"),semicolon:new xe("semicolon",O.token,";"),star:new xe("star",O.token,"*"),tilde:new xe("tilde",O.token,"~"),underscore:new xe("underscore",O.token,"_"),xor:new xe("xor",O.token,"^"),plus_equal:new xe("plus_equal",O.token,"+="),minus_equal:new xe("minus_equal",O.token,"-="),times_equal:new xe("times_equal",O.token,"*="),division_equal:new xe("division_equal",O.token,"/="),modulo_equal:new xe("modulo_equal",O.token,"%="),and_equal:new xe("and_equal",O.token,"&="),or_equal:new xe("or_equal",O.token,"|="),xor_equal:new xe("xor_equal",O.token,"^="),shift_right_equal:new xe("shift_right_equal",O.token,">>="),shift_left_equal:new xe("shift_left_equal",O.token,"<<=")},be.storage_class=[N.keywords.function,N.keywords.private,N.keywords.workgroup,N.keywords.uniform,N.keywords.storage],be.access_mode=[N.keywords.read,N.keywords.write,N.keywords.read_write],be.sampler_type=[N.keywords.sampler,N.keywords.sampler_comparison],be.sampled_texture_type=[N.keywords.texture_1d,N.keywords.texture_2d,N.keywords.texture_2d_array,N.keywords.texture_3d,N.keywords.texture_cube,N.keywords.texture_cube_array],be.multisampled_texture_type=[N.keywords.texture_multisampled_2d],be.storage_texture_type=[N.keywords.texture_storage_1d,N.keywords.texture_storage_2d,N.keywords.texture_storage_2d_array,N.keywords.texture_storage_3d],be.depth_texture_type=[N.keywords.texture_depth_2d,N.keywords.texture_depth_2d_array,N.keywords.texture_depth_cube,N.keywords.texture_depth_cube_array,N.keywords.texture_depth_multisampled_2d],be.texture_external_type=[N.keywords.texture_external],be.any_texture_type=[...N.sampled_texture_type,...N.multisampled_texture_type,...N.storage_texture_type,...N.depth_texture_type,...N.texture_external_type],be.texel_format=[N.keywords.r8unorm,N.keywords.r8snorm,N.keywords.r8uint,N.keywords.r8sint,N.keywords.r16uint,N.keywords.r16sint,N.keywords.r16float,N.keywords.rg8unorm,N.keywords.rg8snorm,N.keywords.rg8uint,N.keywords.rg8sint,N.keywords.r32uint,N.keywords.r32sint,N.keywords.r32float,N.keywords.rg16uint,N.keywords.rg16sint,N.keywords.rg16float,N.keywords.rgba8unorm,N.keywords.rgba8unorm_srgb,N.keywords.rgba8snorm,N.keywords.rgba8uint,N.keywords.rgba8sint,N.keywords.bgra8unorm,N.keywords.bgra8unorm_srgb,N.keywords.rgb10a2unorm,N.keywords.rg11b10float,N.keywords.rg32uint,N.keywords.rg32sint,N.keywords.rg32float,N.keywords.rgba16uint,N.keywords.rgba16sint,N.keywords.rgba16float,N.keywords.rgba32uint,N.keywords.rgba32sint,N.keywords.rgba32float],be.const_literal=[N.tokens.int_literal,N.tokens.uint_literal,N.tokens.decimal_float_literal,N.tokens.hex_float_literal,N.keywords.true,N.keywords.false],be.literal_or_ident=[N.tokens.ident,N.tokens.int_literal,N.tokens.uint_literal,N.tokens.decimal_float_literal,N.tokens.hex_float_literal],be.element_count_expression=[N.tokens.int_literal,N.tokens.uint_literal,N.tokens.ident],be.template_types=[N.keywords.vec2,N.keywords.vec3,N.keywords.vec4,N.keywords.mat2x2,N.keywords.mat2x3,N.keywords.mat2x4,N.keywords.mat3x2,N.keywords.mat3x3,N.keywords.mat3x4,N.keywords.mat4x2,N.keywords.mat4x3,N.keywords.mat4x4,N.keywords.atomic,N.keywords.bitcast,...N.any_texture_type],be.attribute_name=[N.tokens.ident,N.keywords.block],be.assignment_operators=[N.tokens.equal,N.tokens.plus_equal,N.tokens.minus_equal,N.tokens.times_equal,N.tokens.division_equal,N.tokens.modulo_equal,N.tokens.and_equal,N.tokens.or_equal,N.tokens.xor_equal,N.tokens.shift_right_equal,N.tokens.shift_left_equal],be.increment_operators=[N.tokens.plus_plus,N.tokens.minus_minus];class ve{constructor(e,t,r){this.type=e,this.lexeme=t,this.line=r}toString(){return this.lexeme}isTemplateType(){return-1!=be.template_types.indexOf(this.type)}isArrayType(){return this.type==be.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class Ae{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=null!=e?e:""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new ve(be.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if("\n"==e)return this._line++,!0;if(this._isWhitespace(e))return!0;if("/"==e){if("/"==this._peekAhead()){for(;"\n"!=e;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}if("*"==this._peekAhead()){this._advance();let t=1;for(;t>0;){if(this._isAtEnd())return!0;if(e=this._advance(),"\n"==e)this._line++;else if("*"==e){if("/"==this._peekAhead()&&(this._advance(),t--,0==t))return!0}else"/"==e&&"*"==this._peekAhead()&&(this._advance(),t++)}return!0}}let t=be.none;for(;;){let r=this._findType(e);const s=this._peekAhead();if(">"==e&&(">"==s||"="==s)){let e=!1,t=this._tokens.length-1;for(let r=0;r<5&&t>=0;++r,--t)if(this._tokens[t].type===be.tokens.less_than){t>0&&this._tokens[t-1].isArrayOrTemplateType()&&(e=!0);break}if(e)return this._addToken(r),!0}if(r===be.none){let s=e,n=0;const i=2;for(let e=0;e=this._source.length}_isWhitespace(e){return" "==e||"\t"==e||"\r"==e}_advance(e=0){let t=this._source[this._current];return e=e||0,e++,this._current+=e,t}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const t=this._source.substring(this._start,this._current);this._tokens.push(new ve(e,t,this._line))}}class Ee{constructor(){this._tokens=[],this._current=0,this._context=new g}parse(e){this._initialize(e);let t=[];for(;!this._isAtEnd();){const e=this._global_decl_or_directive();if(!e)break;t.push(e)}return t}_initialize(e){if(e)if("string"==typeof e){const t=new Ae(e);this._tokens=t.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,t){return console.error(e,t),{token:e,message:t,toString:function(){return`${t}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==be.eof}_match(e){if(e instanceof xe)return!!this._check(e)&&(this._advance(),!0);for(let t=0,r=e.length;t'.");const t=this._paren_expression();return new ue(e,t)}const e=this._type_decl(),t=this._argument_expression_list();return new ce(e,t)}_argument_expression_list(){if(!this._match(be.tokens.paren_left))return null;const e=[];do{if(this._check(be.tokens.paren_right))break;const t=this._short_circuit_or_expression();e.push(t)}while(this._match(be.tokens.comma));return this._consume(be.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(be.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(be.tokens.paren_right),new le([e])}_paren_expression(){this._consume(be.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(be.tokens.paren_right,"Expected ')'."),new le([e])}_struct_decl(){if(!this._match(be.keywords.struct))return null;const e=this._consume(be.tokens.ident,"Expected name for struct.").toString();this._consume(be.tokens.brace_left,"Expected '{' for struct body.");const t=[];for(;!this._check(be.tokens.brace_right);){const e=this._attribute(),r=this._consume(be.tokens.ident,"Expected variable name.").toString();this._consume(be.tokens.colon,"Expected ':' for struct member type.");const s=this._attribute(),n=this._type_decl();null!=n&&(n.attributes=s),this._check(be.tokens.brace_right)?this._match(be.tokens.comma):this._consume(be.tokens.comma,"Expected ',' for struct member."),t.push(new we(r,n,e))}this._consume(be.tokens.brace_right,"Expected '}' after struct body.");const r=new Z(e,t);return this._context.structs.set(e,r),r}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(be.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(be.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(be.keywords.const))return null;const e=this._consume(be.tokens.ident,"Expected variable name");let t=null;if(this._match(be.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}let r=null;if(this._match(be.tokens.equal)){const e=this._short_circuit_or_expression();if(e instanceof se)r=e;else if(e instanceof ae&&e.initializer instanceof se)r=e.initializer;else try{const t=e.evaluate(this._context);r=new oe(t)}catch(t){r=e}}const s=new U(e.toString(),t,"","",r);return this._context.constants.set(s.name,s),s}_global_let_decl(){if(!this._match(be.keywords.let))return null;const e=this._consume(be.tokens.ident,"Expected variable name");let t=null;if(this._match(be.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}let r=null;return this._match(be.tokens.equal)&&(r=this._const_expression()),new I(e.toString(),t,"","",r)}_const_expression(){if(this._match(be.const_literal))return new re(this._previous().toString());const e=this._type_decl();this._consume(be.tokens.paren_left,"Expected '('.");let t=[];for(;!this._check(be.tokens.paren_right)&&(t.push(this._const_expression()),this._check(be.tokens.comma));)this._advance();return this._consume(be.tokens.paren_right,"Expected ')'."),new se(e,t)}_variable_decl(){if(!this._match(be.keywords.var))return null;let e="",t="";this._match(be.tokens.less_than)&&(e=this._consume(be.storage_class,"Expected storage_class.").toString(),this._match(be.tokens.comma)&&(t=this._consume(be.access_mode,"Expected access_mode.").toString()),this._consume(be.tokens.greater_than,"Expected '>'."));const r=this._consume(be.tokens.ident,"Expected variable name");let s=null;if(this._match(be.tokens.colon)){const e=this._attribute();s=this._type_decl(),null!=s&&(s.attributes=e)}return new z(r.toString(),s,e,t,null)}_override_decl(){if(!this._match(be.keywords.override))return null;const e=this._consume(be.tokens.ident,"Expected variable name");let t=null;if(this._match(be.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}return new M(e.toString(),t,null)}_enable_directive(){const e=this._consume(be.tokens.ident,"identity expected.");return new D(e.toString())}_type_alias(){const e=this._consume(be.tokens.ident,"identity expected.");this._consume(be.tokens.equal,"Expected '=' for type alias.");let t=this._type_decl();if(null===t)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(t.name)&&(t=this._context.aliases.get(t.name).type);const r=new j(e.toString(),t);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([be.tokens.ident,...be.texel_format,be.keywords.bool,be.keywords.f32,be.keywords.i32,be.keywords.u32])){const e=this._advance(),t=e.toString();return this._context.structs.has(t)?this._context.structs.get(t):this._context.aliases.has(t)?this._context.aliases.get(t).type:new H(e.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(be.template_types)){let e=this._advance().toString(),t=null,r=null;return this._match(be.tokens.less_than)&&(t=this._type_decl(),r=null,this._match(be.tokens.comma)&&(r=this._consume(be.access_mode,"Expected access_mode for pointer").toString()),this._consume(be.tokens.greater_than,"Expected '>' for type.")),new Q(e,t,r)}if(this._match(be.keywords.ptr)){let e=this._previous().toString();this._consume(be.tokens.less_than,"Expected '<' for pointer.");const t=this._consume(be.storage_class,"Expected storage_class for pointer");this._consume(be.tokens.comma,"Expected ',' for pointer.");const r=this._type_decl();let s=null;return this._match(be.tokens.comma)&&(s=this._consume(be.access_mode,"Expected access_mode for pointer").toString()),this._consume(be.tokens.greater_than,"Expected '>' for pointer."),new J(e,t.toString(),r,s)}const t=this._attribute();if(this._match(be.keywords.array)){let e=null,r=-1;const s=this._previous();if(this._match(be.tokens.less_than)){e=this._type_decl(),this._context.aliases.has(e.name)&&(e=this._context.aliases.get(e.name).type);let t="";if(this._match(be.tokens.comma)){t=this._shift_expression().evaluate(this._context).toString()}this._consume(be.tokens.greater_than,"Expected '>' for array."),r=t?parseInt(t):0}return new K(s.toString(),t,e,r)}return null}_texture_sampler_types(){if(this._match(be.sampler_type))return new ee(this._previous().toString(),null,null);if(this._match(be.depth_texture_type))return new ee(this._previous().toString(),null,null);if(this._match(be.sampled_texture_type)||this._match(be.multisampled_texture_type)){const e=this._previous();this._consume(be.tokens.less_than,"Expected '<' for sampler type.");const t=this._type_decl();return this._consume(be.tokens.greater_than,"Expected '>' for sampler type."),new ee(e.toString(),t,null)}if(this._match(be.storage_texture_type)){const e=this._previous();this._consume(be.tokens.less_than,"Expected '<' for sampler type.");const t=this._consume(be.texel_format,"Invalid texel format.").toString();this._consume(be.tokens.comma,"Expected ',' after texel format.");const r=this._consume(be.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(be.tokens.greater_than,"Expected '>' for sampler type."),new ee(e.toString(),t,r)}return null}_attribute(){let e=[];for(;this._match(be.tokens.attr);){const t=this._consume(be.attribute_name,"Expected attribute name"),r=new ke(t.toString(),null);if(this._match(be.tokens.paren_left)){if(r.value=this._consume(be.literal_or_ident,"Expected attribute value").toString(),this._check(be.tokens.comma)){this._advance();do{const e=this._consume(be.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(e)}while(this._match(be.tokens.comma))}this._consume(be.tokens.paren_right,"Expected ')'")}e.push(r)}for(;this._match(be.tokens.attr_left);){if(!this._check(be.tokens.attr_right))do{const t=this._consume(be.attribute_name,"Expected attribute name"),r=new ke(t.toString(),null);if(this._match(be.tokens.paren_left)){if(r.value=[this._consume(be.literal_or_ident,"Expected attribute value").toString()],this._check(be.tokens.comma)){this._advance();do{const e=this._consume(be.literal_or_ident,"Expected attribute value").toString();r.value.push(e)}while(this._match(be.tokens.comma))}this._consume(be.tokens.paren_right,"Expected ')'")}e.push(r)}while(this._match(be.tokens.comma));this._consume(be.tokens.attr_right,"Expected ']]' after attribute declarations")}return 0==e.length?null:e}}class Te{constructor(e,t){this.name=e,this.attributes=t,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class Se{constructor(e,t,r){this.name=e,this.type=t,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class ze extends Te{constructor(e,t){super(e,t),this.members=[],this.align=0}get isStruct(){return!0}}class Me extends Te{constructor(e,t){super(e,t),this.count=0,this.stride=0}get isArray(){return!0}}class Ie extends Te{constructor(e,t,r,s){super(e,r),this.format=t,this.access=s}get isTemplate(){return!0}}!function(e){e[e.Uniform=0]="Uniform",e[e.Storage=1]="Storage",e[e.Texture=2]="Texture",e[e.Sampler=3]="Sampler",e[e.StorageTexture=4]="StorageTexture"}(q||(q={}));class Ue{constructor(e,t,r,s,n,i,a){this.name=e,this.type=t,this.group=r,this.binding=s,this.attributes=n,this.resourceType=i,this.access=a}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Ve{constructor(e,t){this.name=e,this.type=t}}class Fe{constructor(e,t){this.align=e,this.size=t}}class Ne{constructor(e,t,r,s){this.name=e,this.type=t,this.locationType=r,this.location=s,this.interpolation=null}}class Oe{constructor(e,t,r,s){this.name=e,this.type=t,this.locationType=r,this.location=s}}class qe{constructor(e,t=null){this.stage=null,this.inputs=[],this.outputs=[],this.resources=[],this.name=e,this.stage=t}}class Pe{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class Be{constructor(e,t,r,s){this.name=e,this.type=t,this.attributes=r,this.id=s}}class Ce{constructor(e){this.resources=null,this.node=e}}class Le{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new Pe,this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return"texture_storage_1d"==e.name||"texture_storage_2d"==e.name||"texture_storage_2d_array"==e.name||"texture_storage_3d"==e.name}update(e){const t=(new Ee).parse(e);for(const e of t)e instanceof v&&this._functions.set(e.name,new Ce(e));for(const e of t)if(e instanceof Z){const t=this._getTypeInfo(e,null);t instanceof ze&&this.structs.push(t)}else if(e instanceof j)this.aliases.push(this._getAliasInfo(e));else if(e instanceof M){const t=e,r=this._getAttributeNum(t.attributes,"id",0),s=null!=t.type?this._getTypeInfo(t.type,t.attributes):null;this.overrides.push(new Be(t.name,s,t.attributes,r))}else if(this._isUniformVar(e)){const t=e,r=this._getAttributeNum(t.attributes,"group",0),s=this._getAttributeNum(t.attributes,"binding",0),n=this._getTypeInfo(t.type,t.attributes),i=new Ue(t.name,n,r,s,t.attributes,q.Uniform,t.access);this.uniforms.push(i)}else if(this._isStorageVar(e)){const t=e,r=this._getAttributeNum(t.attributes,"group",0),s=this._getAttributeNum(t.attributes,"binding",0),n=this._getTypeInfo(t.type,t.attributes),i=this._isStorageTexture(n),a=new Ue(t.name,n,r,s,t.attributes,i?q.StorageTexture:q.Storage,t.access);this.storage.push(a)}else if(this._isTextureVar(e)){const t=e,r=this._getAttributeNum(t.attributes,"group",0),s=this._getAttributeNum(t.attributes,"binding",0),n=this._getTypeInfo(t.type,t.attributes),i=this._isStorageTexture(n),a=new Ue(t.name,n,r,s,t.attributes,i?q.StorageTexture:q.Texture,t.access);i?this.storage.push(a):this.textures.push(a)}else if(this._isSamplerVar(e)){const t=e,r=this._getAttributeNum(t.attributes,"group",0),s=this._getAttributeNum(t.attributes,"binding",0),n=this._getTypeInfo(t.type,t.attributes),i=new Ue(t.name,n,r,s,t.attributes,q.Sampler,t.access);this.samplers.push(i)}else if(e instanceof v){const t=this._getAttribute(e,"vertex"),r=this._getAttribute(e,"fragment"),s=this._getAttribute(e,"compute"),n=t||r||s;if(n){const t=new qe(e.name,null==n?void 0:n.name);t.inputs=this._getInputs(e.args),t.outputs=this._getOutputs(e.returnType),t.resources=this._findResources(e),this.entry[n.name].push(t)}}else;}_findResource(e){for(const t of this.uniforms)if(t.name==e)return t;for(const t of this.storage)if(t.name==e)return t;for(const t of this.textures)if(t.name==e)return t;for(const t of this.samplers)if(t.name==e)return t;return null}_findResources(e){const t=[],r=this,s=[];return e.search((e=>{if(e instanceof k)s.push({});else if(e instanceof x)s.pop();else if(e instanceof z){if(s.length>0){const t=e;s[s.length-1][t.name]=t}}else if(e instanceof I){if(s.length>0){const t=e;s[s.length-1][t.name]=t}}else if(e instanceof ie){const n=e;if(s.length>0){if(s[s.length-1][n.name])return}const i=r._findResource(n.name);i&&t.push(i)}else if(e instanceof ne){const s=e,n=r._functions.get(s.name);n&&(null===n.resources&&(n.resources=r._findResources(n.node)),t.push(...n.resources))}})),[...new Map(t.map((e=>[e.name,e]))).values()]}getBindGroups(){const e=[];function t(t,r){t>=e.length&&(e.length=t+1),void 0===e[t]&&(e[t]=[]),r>=e[t].length&&(e[t].length=r+1)}for(const r of this.uniforms){t(r.group,r.binding);e[r.group][r.binding]=r}for(const r of this.storage){t(r.group,r.binding);e[r.group][r.binding]=r}for(const r of this.textures){t(r.group,r.binding);e[r.group][r.binding]=r}for(const r of this.samplers){t(r.group,r.binding);e[r.group][r.binding]=r}return e}_getOutputs(e,t=void 0){if(void 0===t&&(t=[]),e instanceof Z)this._getStructOutputs(e,t);else{const r=this._getOutputInfo(e);null!==r&&t.push(r)}return t}_getStructOutputs(e,t){for(const r of e.members)if(r.type instanceof Z)this._getStructOutputs(r.type,t);else{const e=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(null!==e){const s=this._getTypeInfo(r.type,r.type.attributes),n=this._parseInt(e.value),i=new Oe(r.name,s,e.name,n);t.push(i)}}}_getOutputInfo(e){const t=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(null!==t){const r=this._getTypeInfo(e,e.attributes),s=this._parseInt(t.value);return new Oe("",r,t.name,s)}return null}_getInputs(e,t=void 0){void 0===t&&(t=[]);for(const r of e)if(r.type instanceof Z)this._getStructInputs(r.type,t);else{const e=this._getInputInfo(r);null!==e&&t.push(e)}return t}_getStructInputs(e,t){for(const r of e.members)if(r.type instanceof Z)this._getStructInputs(r.type,t);else{const e=this._getInputInfo(r);null!==e&&t.push(e)}}_getInputInfo(e){const t=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(null!==t){const r=this._getAttribute(e,"interpolation"),s=this._getTypeInfo(e.type,e.attributes),n=this._parseInt(t.value),i=new Ne(e.name,s,t.name,n);return null!==r&&(i.interpolation=this._parseString(r.value)),i}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const t=parseInt(e);return isNaN(t)?e:t}_getAlias(e){for(const t of this.aliases)if(t.name==e)return t.type;return null}_getAliasInfo(e){return new Ve(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,t){if(this._types.has(e))return this._types.get(e);if(e instanceof K){const r=e,s=this._getTypeInfo(r.format,r.attributes),n=new Me(r.name,t);return n.format=s,n.count=r.count,this._types.set(e,n),this._updateTypeInfo(n),n}if(e instanceof Z){const r=e,s=new ze(r.name,t);for(const e of r.members){const t=this._getTypeInfo(e.type,e.attributes);s.members.push(new Se(e.name,t,e.attributes))}return this._types.set(e,s),this._updateTypeInfo(s),s}if(e instanceof ee){const r=e,s=r.format instanceof H,n=r.format?s?this._getTypeInfo(r.format,null):new Te(r.format,null):null,i=new Ie(r.name,n,t,r.access);return this._types.set(e,i),this._updateTypeInfo(i),i}if(e instanceof Q){const r=e,s=r.format?this._getTypeInfo(r.format,null):null,n=new Ie(r.name,s,t,r.access);return this._types.set(e,n),this._updateTypeInfo(n),n}const r=new Te(e.name,t);return this._types.set(e,r),this._updateTypeInfo(r),r}_updateTypeInfo(e){var t,r;const s=this._getTypeSize(e);if(e.size=null!==(t=null==s?void 0:s.size)&&void 0!==t?t:0,e instanceof Me){const t=this._getTypeSize(e.format);e.stride=null!==(r=null==t?void 0:t.size)&&void 0!==r?r:0,this._updateTypeInfo(e.format)}e instanceof ze&&this._updateStructInfo(e)}_updateStructInfo(e){var t;let r=0,s=0,n=0,i=0;for(let a=0,o=e.members.length;ae.stage===r))[0]}(e,t,r);return s?.resources||[]}Le._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}},Le._textureTypes=be.any_texture_type.map((e=>e.name)),Le._samplerTypes=be.sampler_type.map((e=>e.name));const Ge=(e,t)=>Math.sign(e.binding-t.binding);function $e(e,t){return Object.fromEntries(t.map((t=>{const r=Je(e,t.type,0);return[t.name,{typeDefinition:r,group:t.group,binding:t.binding,size:r.size}]})))}function De(e,t,r){return{fields:Object.fromEntries(t.members.map((t=>[t.name,{offset:t.offset,type:Je(e,t.type,0)}]))),size:t.size,offset:r}}function je(e){if(e.name.includes("depth"))return"depth";switch(e.format?.name){case"f32":return"float";case"i32":return"sint";case"u32":return"uint";default:throw new Error("unknown texture sample type")}}function Ye(e){return e.name.includes("2d_array")?"2d-array":e.name.includes("cube_array")?"cube-array":e.name.includes("3d")?"3d":e.name.includes("1d")?"1d":e.name.includes("cube")?"cube":"2d"}function We(e){switch(e.access){case"read":return"read-only";case"write":return"write-only";case"read_write":return"read-write";default:throw new Error("unknonw storage texture access")}}function Xe(e){return e.name.endsWith("_comparison")?"comparison":"filtering"}function He(e,t){const{binding:r,access:s,type:n}=e;switch(e.resourceType){case q.Uniform:return{binding:r,visibility:t,buffer:{}};case q.Storage:return{binding:r,visibility:t,buffer:{type:""===s||"read"===s?"read-only-storage":"storage"}};case q.Texture:{if("texture_external"===n.name)return{binding:r,visibility:t,externalTexture:{}};const e=n.name.includes("multisampled");return{binding:r,visibility:t,texture:{sampleType:je(n),viewDimension:Ye(n),multisampled:e}}}case q.Sampler:return{binding:r,visibility:t,sampler:{type:Xe(n)}};case q.StorageTexture:return{binding:r,visibility:t,storageTexture:{access:We(n),format:n.format.name,viewDimension:Ye(n)}};default:throw new Error("unknown resource type")}}function Ze(e,t){const r={};for(const s of e)r[s.name]={stage:t,resources:s.resources.map((e=>{const{name:r,group:s}=e;return{name:r,group:s,entry:He(e,t)}}))};return r}function Qe(e,t=""){if(!e)throw new Error(t)}function Je(e,t,r){if(t.isArray){Qe(!t.isStruct,"struct array is invalid"),Qe(!t.isStruct,"template array is invalid");const s=t;return{size:s.size,elementType:Je(e,s.format,r),numElements:s.count}}if(t.isStruct){Qe(!t.isTemplate,"template struct is invalid");return De(e,t,r)}{const e=t,r=t.isTemplate?`${e.name}<${e.format.name}>`:t.name;return{size:t.size,type:r}}}function Ke(e){return Array.isArray(e)||r(e)?[...e,1,1].slice(0,3):function(e){return[e.width,e.height||1,e.depthOrArrayLayers||1]}(e)}function et(e,t){const r=Ke(e),s=Math.max(...r.slice(0,"3d"===t?3:2));return 1+Math.log2(s)|0}const tt=new WeakMap;function rt(e,t,r){let s=tt.get(e);s||(s={pipelineByFormatAndView:{},moduleByViewType:{}},tt.set(e,s));let{sampler:n,uniformBuffer:i,uniformValues:a}=s;const{pipelineByFormatAndView:o,moduleByViewType:u}=s;r=r||function(e){switch(e.dimension){case"1d":return"1d";case"3d":return"3d";default:return e.depthOrArrayLayers>1?"2d-array":"2d"}}(t);let c=u[r];if(!c){const t=function(e){let t,r;switch(e){case"2d":t="texture_2d",r="textureSample(ourTexture, ourSampler, fsInput.texcoord)";break;case"2d-array":t="texture_2d_array",r="\n textureSample(\n ourTexture,\n ourSampler,\n fsInput.texcoord,\n uni.layer)";break;case"cube":t="texture_cube",r="\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))";break;case"cube-array":t="texture_cube_array",r="\n textureSample(\n ourTexture,\n ourSampler,\n faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)";break;default:throw new Error(`unsupported view: ${e}`)}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: ${t};\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 ${r};\n }\n `}(r);c=e.createShaderModule({label:`mip level generation for ${r}`,code:t}),u[r]=c}n||(n=e.createSampler({minFilter:"linear",magFilter:"linear"}),i=e.createBuffer({size:16,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),a=new Uint32Array(1),Object.assign(s,{sampler:n,uniformBuffer:i,uniformValues:a}));const l=`${t.format}.${r}`;o[l]||(o[l]=e.createRenderPipeline({label:`mip level generator pipeline for ${r}`,layout:"auto",vertex:{module:c,entryPoint:"vs"},fragment:{module:c,entryPoint:"fs",targets:[{format:t.format}]}}));const h=o[l];for(let s=1;s[[t,e],[r,e]])).flat());function it(e){return"indices"===e}function at(e,t){if(r(e))return e;let s=e;if(r(s.data))return s.data;(Array.isArray(e)||"number"==typeof e)&&(s={data:e});let n=s.type;return n||(n=it(t)?Uint32Array:Float32Array),new n(s.data)}const ot=[{re:/coord|texture|uv/i,numComponents:2},{re:/color|colour/i,numComponents:4}];function ut(e,t){const r=function(e){for(const{re:t,numComponents:r}of ot)if(t.test(e))return r;return 3}(e);if(t%r>0)throw new Error(`Can not guess numComponents for attribute '${e}'. Tried ${r} but ${t} values is not evenly divisible by ${r}. You should specify it.`);return r}const ct=/(\w+)(?:x(\d))$/;function lt(e){const t=ct.exec(e),[r,s]=t?[t[1],parseInt(t[2])]:[e,1];return{Type:nt.get(r),numComponents:s}}function ht(e,t){return new(0,Object.getPrototypeOf(e).constructor)(t)}function _t(e,t={}){const r=void 0===t.interleave||t.interleave,s=t.stepMode||"vertex",n=t.shaderLocation?Array.isArray(t.shaderLocation)?t.shaderLocation:[t.shaderLocation]:[0];let i=0;const a=[],o=[],u=[];return Object.keys(e).filter((e=>!it(e))).forEach((t=>{const c=e[t],l=at(c,t),h=function(e,t){return e.numComponents||ut(t,function(e){return e.length?e:e.data}(e).length)}(c,t),_=h/4%1==0?4:h/3%1==0?3:4;for(let e=0;e1?`x${t}`:""}`,f=n.shift();0===n.length&&n.push(f+1),o.push({offset:r,format:p,shaderLocation:f}),u.push({data:l,offset:e,stride:h})}r||(a.push({stepMode:s,arrayStride:i,attributes:o.slice()}),i=0,o.length=0)})),o.length&&a.push({stepMode:s,arrayStride:i,attributes:o}),{bufferLayouts:a,typedArrays:u}}function dt(e,t){return r(e)?{data:e,offset:0,stride:t}:e}function pt(e,t,r,s){const n=new Map;e.forEach(((e,i)=>{const{offset:a,format:o}=e,{numComponents:u}=lt(o),{data:c,offset:l,stride:h}=dt(t[i],u),_=(e=>{const t=Object.getPrototypeOf(e).constructor,r=n.get(t);if(r)return r;const i=new t(s);return n.set(t,i),i})(c);for(let e=0;e{e.setVertexBuffer(r+s,t)})),t.indexBuffer&&e.setIndexBuffer(t.indexBuffer,t.indexFormat)}function mt(e){return r(e)||Array.isArray(e)||function(e){const t=e;return r(t.data)||Array.isArray(t.data)}(e)}function yt(e){switch(e){case"1d":return"1d";case"3d":return"3d";default:return"2d"}}const gt={"8snorm":Int8Array,"8unorm":Uint8Array,"8sint":Int8Array,"8uint":Uint8Array,"16snorm":Int16Array,"16unorm":Uint16Array,"16sint":Int16Array,"16uint":Uint16Array,"32snorm":Int32Array,"32unorm":Uint32Array,"32sint":Int32Array,"32uint":Uint32Array,"16float":Uint16Array,"32float":Float32Array},wt=/([a-z]+)(\d+)([a-z]+)/;function kt(e){const[,t,r,s]=wt.exec(e),n=t.length,i=parseInt(r)/8;return{channels:t,numChannels:n,bytesPerChannel:i,bytesPerElement:n*i,Type:gt[`${r}${s}`]}}function xt(e,t){return[e.width,e.height,e.depthOrArrayLayers].map((e=>Math.max(1,Math.floor(e/2**t))))}function bt(e,t,s,n){const i=function(e,t){if(r(e))return e;const{Type:s}=kt(t);return new s(e)}(s.data||s,t.format),a=xt(t,0),{bytesPerElement:o}=kt(t.format),u=n.origin||[0,0,0];e.queue.writeTexture({texture:t,origin:u},i,{bytesPerRow:o*a[0],rowsPerImage:a[1]},a)}function vt(e,t,r,s={}){r.forEach(((r,n)=>{const i=[0,0,n+(s.baseArrayLayer||0)];if(mt(r))bt(e,t,r,{origin:i});else{const n=r,{flipY:a,premultipliedAlpha:o,colorSpace:u}=s;e.queue.copyExternalImageToTexture({source:n,flipY:a},{texture:t,premultipliedAlpha:o,colorSpace:u,origin:i},At(n,s))}})),t.mipLevelCount>1&&rt(e,t)}function At(e,t){if(e instanceof HTMLVideoElement)return[e.videoWidth,e.videoHeight,1];{const s=e,{width:n,height:i}=s;if(n>0&&i>0&&!mt(e))return[n,i,1];const a=t.format||"rgba8unorm",{bytesPerElement:o,bytesPerChannel:u}=kt(a),c=r(e)||Array.isArray(e)?e:e.data;return function(e,t,r,s="2d"){if(r%1!=0)throw new Error("can't guess dimensions");if(e||t){if(t){if(!e&&(e=r/t)%1)throw new Error("can't guess dimensions")}else if((t=r/e)%1)throw new Error("can't guess dimensions")}else{const n=Math.sqrt(r/("cube"===s?6:1));n%1==0?(e=n,t=n):(e=r,t=1)}const n=r/e/t;if(n%1)throw new Error("can't guess dimensions");return[e,t,n]}(n,i,(r(c)?c.byteLength:c.length*u)/o)}}function Et(e,t,r={}){const s=At(t[0],r);s[2]=s[2]>1?s[2]:t.length;const n=e.createTexture({dimension:yt(r.dimension),format:r.format||"rgba8unorm",mipLevelCount:r.mipLevelCount?r.mipLevelCount:r.mips?et(s):1,size:s,usage:(r.usage??0)|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return vt(e,n,t,r),n}async function Tt(e,t={}){const r=await fetch(e),s=await r.blob(),n={...t,...void 0!==t.colorSpaceConversion&&{colorSpaceConversion:"none"}};return await createImageBitmap(s,n)}async function St(e,t,r={}){return Et(e,await Promise.all(t.map((e=>Tt(e)))),r)}class zt{typedArray;cursor=0;numComponents;constructor(e,t){this.typedArray=e,this.numComponents=t}get numElements(){return this.typedArray.length/this.numComponents}push(...e){for(const t of e)if(Array.isArray(t)||r(t)){const t=e;this.typedArray.set(t,this.cursor),this.cursor+=t.length}else this.typedArray[this.cursor++]=t}reset(e=0){this.cursor=e}}function Mt(e,t,r){return new zt(new r(e*t),e)}const It=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function Ut({bottomRadius:e=1,topRadius:t=0,height:r=1,radialSubdivisions:s=24,verticalSubdivisions:n=1,topCap:i=!0,bottomCap:a=!0}={}){if(s<3)throw new Error("radialSubdivisions must be 3 or greater");if(n<1)throw new Error("verticalSubdivisions must be 1 or greater");const o=(i?2:0)+(a?2:0),u=(s+1)*(n+1+o),c=Mt(3,u,Float32Array),l=Mt(3,u,Float32Array),h=Mt(2,u,Float32Array),_=Mt(3,s*(n+o/2)*2,Uint16Array),d=s+1,p=Math.atan2(e-t,r),f=Math.cos(p),m=Math.sin(p),y=n+(a?2:0);for(let a=i?-2:0;a<=y;++a){let i,o=a/n,u=r*o;a<0?(u=0,o=1,i=e):a>n?(u=r,o=1,i=t):i=e+a/n*(t-e),-2!==a&&a!==n+2||(i=0,o=0),u-=r/2;for(let e=0;en?l.push(0,1,0):0===i?l.push(0,0,0):l.push(t*f,m,r*f),h.push(e/s,1-o)}}for(let e=0;e[e,t.typedArray])))},createCrescentVertices:function({verticalRadius:e=2,outerRadius:t=1,innerRadius:r=0,thickness:s=1,subdivisionsDown:n=12,startOffset:i=0,endOffset:a=1}={}){if(n<=0)throw new Error("subdivisionDown must be > 0");const o=a-i,u=2*(n+1)*4,c=Mt(3,u,Float32Array),l=Mt(3,u,Float32Array),h=Mt(2,u,Float32Array);function _(e,t,r){return e+(t-e)*r}function d(e,t){return e.map(((e,r)=>e+t[r]))}function p(e,t){return e.map(((e,r)=>e*t[r]))}function f(t,r,a,u,f,m){for(let y=0;y<=n;y++){const g=r/1,w=y/n,k=2*(g-.5),x=(i+w*o)*Math.PI,b=Math.sin(x),v=Math.cos(x),A=_(e,t,b),E=k*s,T=v*e,S=b*A;c.push(E,T,S);const z=d(p([0,b,v],a),u);l.push(z),h.push(g*f+m,w)}}for(let e=0;e<2;e++){const s=2*(e/1-.5);f(t,e,[1,1,1],[0,0,0],1,0),f(t,e,[0,0,0],[s,0,0],0,0),f(r,e,[1,1,1],[0,0,0],1,0),f(r,e,[0,0,0],[s,0,0],0,1)}const m=Mt(3,2*n*4,Uint16Array);function y(e,t){for(let r=0;r0&&s!==t){const e=l+(s+1),t=l+s,r=l+s-_,n=l+(s+1)-_;c.push(e,t,r),c.push(e,r,n)}}l+=t+1}return{position:a.typedArray,normal:o.typedArray,texcoord:u.typedArray,indices:c.typedArray}},createPlaneVertices:function({width:e=1,depth:t=1,subdivisionsWidth:r=1,subdivisionsDepth:s=1}={}){const n=(r+1)*(s+1),i=Mt(3,n,Float32Array),a=Mt(3,n,Float32Array),o=Mt(2,n,Float32Array);for(let n=0;n<=s;n++)for(let u=0;u<=r;u++){const c=u/r,l=n/s;i.push(e*c-.5*e,0,t*l-.5*t),a.push(0,1,0),o.push(c,l)}const u=r+1,c=Mt(3,r*s*2,Uint16Array);for(let e=0;e 0");const o=n-s,u=a-i,c=(t+1)*(r+1),l=Mt(3,c,Float32Array),h=Mt(3,c,Float32Array),_=Mt(2,c,Float32Array);for(let n=0;n<=r;n++)for(let a=0;a<=t;a++){const c=a/t,d=n/r,p=u*c+i,f=o*d+s,m=Math.sin(p),y=Math.cos(p),g=Math.sin(f),w=y*g,k=Math.cos(f),x=m*g;l.push(e*w,e*k,e*x),h.push(w,k,x),_.push(1-c,d)}const d=t+1,p=Mt(3,t*r*2,Uint16Array);for(let e=0;eit(e)));if(l){const t=at(l[1],"indices"),r=e.createBuffer({size:t.byteLength,usage:GPUBufferUsage.INDEX|s,mappedAtCreation:!0});ht(t,r.getMappedRange()).set(t),r.unmap(),c.indexBuffer=r,c.indexFormat=t instanceof Uint16Array?"uint16":"uint32",c.numElements=t.length}return c},e.createTextureFromImage=async function(e,t,r={}){return St(e,[t],r)},e.createTextureFromImages=St,e.createTextureFromSource=function(e,t,r={}){return Et(e,[t],r)},e.createTextureFromSources=Et,e.drawArrays=function(e,t){ft(e,t),t.indexBuffer?e.drawIndexed(t.numElements):e.draw(t.numElements)},e.generateMipmap=rt,e.getSizeAndAlignmentOfUnsizedArrayElement=function(e){const t=e;return y(void 0===t.group?e:t.typeDefinition)},e.getSizeForMipFromTexture=xt,e.getSizeFromSource=At,e.interleaveVertexData=pt,e.isTypedArray=r,e.kTypes=i,e.loadImageBitmap=Tt,e.makeBindGroupLayoutDescriptors=function(e,t){const r=[...Re((e=Array.isArray(e)?e:[e])[0],t.vertex,GPUShaderStage.VERTEX),...Re(e[e.length-1],t.fragment,GPUShaderStage.FRAGMENT),...Re(e[0],t.compute,GPUShaderStage.COMPUTE)],s=[];for(const e of r){const t=s[e.group]||new Map;s[e.group]=t;const r=t.get(e.entry.binding);t.set(e.entry.binding,{...e.entry,visibility:e.entry.visibility|(r?.visibility||0)})}return s.map((e=>({entries:[...e.values()].sort(Ge)})))},e.makeShaderDataDefinitions=function(e){const t=new Le(e),r=Object.fromEntries(t.structs.map((e=>[e.name,De(t,e,0)]))),s=$e(t,t.uniforms);return{structs:r,storages:$e(t,t.storage),uniforms:s,entryPoints:{...Ze(t.entry.vertex,GPUShaderStage.VERTEX),...Ze(t.entry.fragment,GPUShaderStage.FRAGMENT),...Ze(t.entry.compute,GPUShaderStage.COMPUTE)}}},e.makeStructuredView=function(e,t,r=0){const s=e,n=l(void 0===s.group?e:s.typeDefinition,t,r);return{...n,set(e){h(e,n.views)}}},e.makeTypedArrayViews=l,e.normalizeGPUExtent3D=Ke,e.numMipLevels=et,e.primitives=Ft,e.setIntrinsicsToView=o,e.setStructuredValues=function(e,t,r,s=0){f(e.typeDefinition,t,r,s)},e.setStructuredView=h,e.setTypedValues=f,e.setVertexAndIndexBuffers=ft,e.subarray=function(e,t,r){return e.subarray(t,t+r)}})); -//# sourceMappingURL=webgpu-utils.min.js.map diff --git a/dist/1.x/webgpu-utils.min.js.map b/dist/1.x/webgpu-utils.min.js.map deleted file mode 100644 index 27f542a..0000000 --- a/dist/1.x/webgpu-utils.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webgpu-utils.min.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created. 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 kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {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 = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param 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 } = typeInfo[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) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n 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 (_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 (_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.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}\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 Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n 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 }\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 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 discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right)) {\n return null;\n }\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 const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.resources = [];\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.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 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 continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n fn.resources = this._findResources(node);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\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 _findResources(fn) {\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 if (varStack.length > 0) {\n const v = node;\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof Let) {\n if (varStack.length > 0) {\n const v = node;\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 fn = self._functions.get(c.name);\n if (fn) {\n if (fn.resources === null) {\n fn.resources = self._findResources(fn.node);\n }\n resources.push(...fn.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 if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While, _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';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\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\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: 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 return bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\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 };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\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);\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 structs,\n storages,\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 */\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n","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) {\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\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n\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) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param 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 } = {}) {\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} = {}) {\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} = {}) {\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} = {}) {\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} = {}) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param params\n * @param params.verticalRadius The vertical radius of the crescent. Default = 2\n * @param params.outerRadius The outer radius of the crescent. Default = 1\n * @param params.innerRadius The inner radius of the crescent. Default = 0\n * @param params.thickness The thickness of the crescent. Default = 1\n * @param params.subdivisionsDown number of steps around the crescent. Default = 12\n * @param params.startOffset Where to start arc. Default 0. Default = 0\n * @param params.endOffset Where to end arg. Default 1. Default = 1\n * @return The created vertices.\n */\nexport function createCrescentVertices({\n verticalRadius = 2,\n outerRadius = 1,\n innerRadius = 0,\n thickness = 1,\n subdivisionsDown = 12,\n startOffset = 0,\n endOffset = 1,\n} = {}) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param 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} = {}) {\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} = {}) {\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} = {}) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":["roundUpToMultipleOf","v","multiple","isTypedArray","arr","length","buffer","ArrayBuffer","byteLength","b","i32","numElements","align","size","type","View","Int32Array","u32","Uint32Array","f32","Float32Array","f16","Uint16Array","vec2f","vec2i","vec2u","vec2h","vec3i","vec3u","vec3f","vec3h","vec4i","vec4u","vec4f","vec4h","mat2x2f","mat2x2h","mat3x2f","mat3x2h","mat4x2f","mat4x2h","mat2x3f","pad","mat2x3h","mat3x3f","mat3x3h","mat4x3f","mat4x3h","mat2x4f","mat2x4h","mat3x4f","mat3x4h","mat4x4f","mat4x4h","bool","typeInfo","kTypes","obj","Object","keys","setIntrinsicsToView","types","flatten","visited","Set","info","has","add","includes","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","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","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","ConstExpr","initializer","property","postfix","struct","memberIndex","console","LiteralExpr","BitcastExpr","TypecastExpr","GroupingExpr","contents","Operator","UnaryOperator","right","BinaryOperator","left","SwitchCase","Case","selector","Default","Argument","ElseIf","Member","Attribute","TokenType","rule","TokenTypes","none","reserved","eof","token","asm","bf16","do","enum","f64","handle","i8","i16","i64","mat","premerge","regardless","typedef","u8","u16","u64","unless","using","vec","void","keywords","array","keyword","atomic","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","ptr","sampler","sampler_comparison","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_external","vec2","vec3","vec4","bitcast","break","case","continue","default","discard","enable","fallthrough","false","for","function","if","let","const","loop","while","private","read","read_write","return","switch","true","alias","uniform","var","override","workgroup","write","r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm_srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm_srgb","rgb10a2unorm","rg11b10float","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","static_assert","tokens","decimal_float_literal","hex_float_literal","int_literal","uint_literal","ident","and","and_and","arrow","attr","attr_left","attr_right","forward_slash","bang","bracket_left","bracket_right","brace_left","brace_right","colon","comma","equal","equal_equal","not_equal","greater_than","greater_than_equal","shift_right","less_than","less_than_equal","shift_left","modulo","minus","minus_minus","period","plus","plus_plus","or","or_or","paren_left","paren_right","semicolon","star","tilde","underscore","xor","plus_equal","minus_equal","times_equal","division_equal","modulo_equal","and_equal","or_equal","xor_equal","shift_right_equal","shift_left_equal","storage_class","access_mode","sampler_type","sampled_texture_type","multisampled_texture_type","storage_texture_type","depth_texture_type","texture_external_type","any_texture_type","texel_format","const_literal","literal_or_ident","element_count_expression","template_types","attribute_name","assignment_operators","increment_operators","Token","lexeme","line","isTemplateType","indexOf","isArrayType","isArrayOrTemplateType","WgslScanner","source","_tokens","_start","_current","_line","_source","scanTokens","_isAtEnd","scanToken","push","_advance","_isWhitespace","_peekAhead","commentLevel","matchType","matchedType","_findType","nextLexeme","foundLessThan","ti","_addToken","lookAheadLexeme","lookAhead","maxLookAhead","li","_match","match","exec","c","amount","text","substring","WgslParser","_context","tokensOrCode","_initialize","statements","statement","_global_decl_or_directive","scanner","_error","message","error","_peek","_check","l","_consume","tk","t","_previous","_type_alias","_enable_directive","attrs","_attribute","_var","_global_variable_decl","_override","_override_variable_decl","_let","_global_let_decl","_const","_global_const_decl","_struct","_struct_decl","_fn","_function_decl","argAttrs","typeAttrs","_type_decl","_return","_compound_statement","_statement","_if_statement","_switch_statement","_loop_statement","_for_statement","_while_statement","_continuing_statement","_static_assert_statement","result","_return_statement","_variable_statement","_increment_decrement_statement","_func_call_statement","_assignment_statement","_optional_paren_expression","_for_init","_short_circuit_or_expression","_for_increment","_variable_decl","savedPos","_unary_expression","decrement","isUnderscore","_argument_expression_list","s","_switch_body","cases","_case_selectors","_case_body","_cases","_d","selectors","_shift_expression","nextStatement","_match_elseif","_elseif_statement","expr","_short_circuit_and_expr","_inclusive_or_expression","_exclusive_or_expression","_and_expression","_equality_expression","_relational_expression","_additive_expression","_multiplicative_expression","_singular_expression","_primary_expression","p","_postfix_expression","_getStruct","parseFloat","_paren_expression","arg","memberAttrs","memberName","memberType","structNode","_const_expression","_override_decl","valueExpr","constValue","aliasType","aliasNode","typeName","_texture_sampler_types","pointer","decl","countInt","parseInt","TypeInfo","isTemplate","MemberInfo","StructInfo","ArrayInfo","TemplateInfo","VariableInfo","group","binding","resourceType","AliasInfo","_TypeSize","InputInfo","locationType","location","interpolation","OutputInfo","FunctionInfo","stage","inputs","outputs","resources","EntryFunctions","vertex","fragment","compute","OverrideInfo","id","_FunctionResources","WgslReflect","code","uniforms","textures","samplers","overrides","entry","_types","_functions","update","_isStorageTexture","ast","_getTypeInfo","_getAliasInfo","_getAttributeNum","_isUniformVar","g","varInfo","Uniform","_isStorageVar","isStorageTexture","StorageTexture","Storage","_isTextureVar","Texture","_isSamplerVar","Sampler","vertexStage","_getAttribute","fragmentStage","computeStage","_getInputs","_getOutputs","_findResources","_findResource","u","self","varStack","r","getBindGroups","groups","_makeRoom","_getStructOutputs","output","_getOutputInfo","m","locationValue","_parseInt","_getStructInputs","input","_getInputInfo","_parseString","n","isNaN","_getAlias","a","_updateTypeInfo","formatIsType","typeSize","_getTypeSize","formatInfo","_updateStructInfo","lastSize","lastOffset","structAlign","mi","ml","member","sizeInfo","_roundUp","explicitSize","explicitAlign","_typeInfo","divisor","arrayType","E","_textureTypes","_samplerTypes","defaultValue","k","getStageResources","defs","stageFlags","entryPoint","entryPointName","ep","entryPoints","filter","getEntryPointForStage","byBinding","getNamedVariables","reflect","variables","fromEntries","typeDefinition","addType","makeStructDefinition","structInfo","getTextureSampleType","getViewDimension","getStorageTextureAccess","getSamplerType","endsWith","getBindGroupLayoutEntry","resource","visibility","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","kVertexFormatRE","numComponentsAndTypeFromVertexFormat","prefix","createTypedArrayOfSameType","typedArray","getPrototypeOf","createBufferLayoutsFromArrays","arrays","options","interleave","stepMode","shaderLocations","shaderLocation","currentOffset","bufferLayouts","typedArrays","arrayName","totalNumComponents","getArray","getNumComponents","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","layer","flipY","premultipliedAlpha","colorSpace","copyExternalImageToTexture","getSizeFromSource","HTMLVideoElement","videoWidth","videoHeight","maybeHasWidthAndHeight","depth","guessDimensions","createTextureFromSources","createTexture","mips","GPUTextureUsage","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","colors","numVerts","color","verticalRadius","outerRadius","innerRadius","thickness","subdivisionsDown","startOffset","endOffset","offsetRange","lerp","vAdd","vMultiply","createArc","arcRadius","x","normalMult","normalAdd","uMult","uAdd","z","uBack","xBack","angle","radius","px","py","pz","createSurface","leftArcOffset","rightArcOffset","numVerticesDown","cornerVertices","faceNormals","uvCoords","f","faceIndices","uv","divisions","stacks","stackPower","firstIndex","radiusSpan","pointsPerStack","stack","stackRadius","theta","d","subdivisionsWidth","subdivisionsDepth","numVertsAcross","subdivisionsAxis","subdivisionsHeight","startLatitudeInRadians","endLatitudeInRadians","startLongitudeInRadians","endLongitudeInRadians","latRange","longRange","phi","sinTheta","cosTheta","sinPhi","ux","uy","uz","numVertsAround","bodySubdivisions","startAngle","endAngle","range","radialParts","bodyParts","sliceAngle","sliceSin","ny","ring","ringAngle","xSin","zCos","nx","nz","nextRingIndex","nextSliceIndex","inSize","xOffset","yOffset","byteOffset","alignment","numBytes","bufferNdx","attribs","attrib0","data0","VERTEX","mappedAtCreation","getMappedRange","unmap","indicesEntry","find","INDEX","drawIndexed","varD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AA0BC,EAAS,GAC1GuC,EAAe87B,EAAOtV,eAAgB7nB,EAAMnB,EAAaC,EAC7D,6FD3e+C/E,EAAiB+E,EAAgB9E,GAC9E,OAAOD,EAAI22B,SAAS5xB,EAAQA,EAAS9E,EACvC","x_google_ignoreList":[3]} \ No newline at end of file diff --git a/dist/1.x/webgpu-utils.module.js b/dist/1.x/webgpu-utils.module.js deleted file mode 100644 index a428072..0000000 --- a/dist/1.x/webgpu-utils.module.js +++ /dev/null @@ -1,6451 +0,0 @@ -/* webgpu-utils@1.3.0, license MIT */ -const roundUpToMultipleOf = (v, multiple) => (((v + multiple - 1) / multiple) | 0) * multiple; -function keysOf(obj) { - return Object.keys(obj); -} -function range(count, fn) { - return new Array(count).fill(0).map((_, i) => fn(i)); -} - -class TypedArrayViewGenerator { - arrayBuffer; - byteOffset; - constructor(sizeInBytes) { - this.arrayBuffer = new ArrayBuffer(sizeInBytes); - this.byteOffset = 0; - } - align(alignment) { - this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment); - } - pad(numBytes) { - this.byteOffset += numBytes; - } - getView(Ctor, numElements) { - const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements); - this.byteOffset += view.byteLength; - return view; - } -} -function subarray(arr, offset, length) { - return arr.subarray(offset, offset + length); -} -// TODO: fix better? -const isTypedArray = (arr) => arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number'; - -const b = { - i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array }, - u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array }, - f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array }, - f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array }, - vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array }, - vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array }, - vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array }, - vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array }, - vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array }, - vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array }, - vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array }, - vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array }, - vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array }, - vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array }, - vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array }, - vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array }, - // AlignOf(vecR) SizeOf(array) - mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array }, - mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array }, - mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array }, - mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array }, - mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array }, - mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array }, - mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array }, - mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array }, - mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array }, - mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array }, - mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array }, - mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array }, - mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array }, - mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array }, - mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array }, - // Note: At least as of WGSL V1 you can not create a bool for uniform or storage. - // You can only create one in an internal struct. But, this code generates - // views of structs and it needs to not fail if the struct has a bool - bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array }, -}; -const typeInfo = { - ...b, - 'vec2': b.vec2i, - 'vec2': b.vec2u, - 'vec2': b.vec2f, - 'vec2': b.vec2h, - 'vec3': b.vec3i, - 'vec3': b.vec3u, - 'vec3': b.vec3f, - 'vec3': b.vec3h, - 'vec4': b.vec4i, - 'vec4': b.vec4u, - 'vec4': b.vec4f, - 'vec4': b.vec4h, - 'mat2x2': b.mat2x2f, - 'mat2x2': b.mat2x2h, - 'mat3x2': b.mat3x2f, - 'mat3x2': b.mat3x2h, - 'mat4x2': b.mat4x2f, - 'mat4x2': b.mat4x2h, - 'mat2x3': b.mat2x3f, - 'mat2x3': b.mat2x3h, - 'mat3x3': b.mat3x3f, - 'mat3x3': b.mat3x3h, - 'mat4x3': b.mat4x3f, - 'mat4x3': b.mat4x3h, - 'mat2x4': b.mat2x4f, - 'mat2x4': b.mat2x4h, - 'mat3x4': b.mat3x4f, - 'mat3x4': b.mat3x4h, - 'mat4x4': b.mat4x4f, - 'mat4x4': b.mat4x4h, -}; -const kTypes = keysOf(typeInfo); -/** - * Set which intrinsic types to make views for. - * - * Example: - * - * Given a an array of intrinsics like this - * `array` - * - * The default is to create a single `Float32Array(4 * 200)` - * because creating 200 `Float32Array` views is not usually - * what you want. - * - * If you do want individual views then you'd call - * `setIntrinsicsToView(['vec3f`])` and now you get - * an array of 200 `Float32Array`s. - * - * Note: `setIntrinsicsToView` always sets ALL types. The list you - * pass it is the types you want views created for, all other types - * will be reset to do the default. In other words - * - * ```js - * setIntrinsicsToView(['vec3f`]) - * setIntrinsicsToView(['vec2f`]) - * ``` - * - * Only `vec2f` will have views created. `vec3f` has been reset to the default by - * the second call - * - * You can pass in `true` as the 2nd parameter to make it set which types - * to flatten and all others will be set to have views created. For example - * to expand all types would be `setIntrinsicsToView([], true)`. To expand - * all except `f32` would be `setIntrinsicsToView(['f32'], true)`. - * - * To reset all types to the default call it with no arguments - * - * @param types array of types to make views for - * @param flatten whether to flatten or expand the specified types. - */ -function setIntrinsicsToView(types = [], flatten) { - // we need to track what we've viewed because for example `vec3f` references - // the same info as `vec3` so we'd set one and reset the other. - const visited = new Set(); - for (const type of kTypes) { - const info = typeInfo[type]; - if (!visited.has(info)) { - visited.add(info); - info.flatten = types.includes(type) ? flatten : !flatten; - } - } -} -setIntrinsicsToView(); -// This needs to be fixed! 😱 -function getSizeOfTypeDef(typeDef) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - return asArrayDef.size; - /* - if (isIntrinsic(elementType)) { - const asIntrinsicDef = elementType as IntrinsicDefinition; - const { align } = typeInfo[asIntrinsicDef.type]; - return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements; - } else { - return asArrayDef.numElements * getSizeOfTypeDef(elementType); - } - */ - } - else { - const asStructDef = typeDef; - const numElements = asArrayDef.numElements || 1; - if (asStructDef.fields) { - return typeDef.size * numElements; - } - else { - const asIntrinsicDef = typeDef; - const { align } = typeInfo[asIntrinsicDef.type]; - return numElements > 1 - ? roundUpToMultipleOf(typeDef.size, align) * numElements - : typeDef.size; - } - } -} -// If numElements is undefined this is NOT an array. If it is defined then it IS an array -// Sizes for arrays are different than sizes for non-arrays. Example -// a vec3f non array is Float32Array(3) -// a vec3f array of 2 is Float32Array(4 * 2) -// a vec3f array of 1 is Float32Array(4 * 1) -function makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset, numElements) { - const { size, type } = typeDef; - try { - const { View, align } = typeInfo[type]; - const isArray = numElements !== undefined; - const sizeInBytes = isArray - ? roundUpToMultipleOf(size, align) - : size; - const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT; - const effectiveNumElements = isArray - ? (numElements === 0 - ? (buffer.byteLength - baseOffset) / sizeInBytes - : numElements) - : 1; - return new View(buffer, baseOffset, baseNumElements * effectiveNumElements); - } - catch { - throw new Error(`unknown type: ${type}`); - } -} -function isIntrinsic(typeDef) { - return !typeDef.fields && - !typeDef.elementType; -} -/** - * Creates a set of named TypedArray views on an ArrayBuffer. If you don't - * pass in an ArrayBuffer, one will be created. If you're using an unsized - * array then you must pass in your own arraybuffer - * - * Example: - * - * ```js - * const code = ` - * struct Stuff { - * direction: vec3f, - * strength: f32, - * matrix: mat4x4f, - * }; - * @group(0) @binding(0) var uni: Stuff; - * `; - * const defs = makeShaderDataDefinitions(code); - * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition); - * ``` - * - * views would effectively be - * - * ```js - * views = { - * direction: Float32Array(arrayBuffer, 0, 3), - * strength: Float32Array(arrayBuffer, 3, 4), - * matrix: Float32Array(arraybuffer, 4, 20), - * }; - * ``` - * - * You can use the views directly or you can use @link {setStructuredView} - * - * @param typeDef Definition of the various types of views. - * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created) - * @param offset Optional offset in existing ArrayBuffer to start the views. - * @returns A bunch of named TypedArray views and the ArrayBuffer - */ -function makeTypedArrayViews(typeDef, arrayBuffer, offset) { - const baseOffset = offset || 0; - const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef)); - const makeViews = (typeDef, baseOffset) => { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - // TODO: Should be optional? Per Type? Depth set? Per field? - // The issue is, if we have `array` we don't likely - // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view. - // On the other hand, if we have `array` the maybe we do want - // 10 `Float32Array(16)` views since you might want to do - // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`; - if (isIntrinsic(elementType) && typeInfo[elementType.type].flatten) { - return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements); - } - else { - const { size } = getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef); - const effectiveNumElements = asArrayDef.numElements === 0 - ? (buffer.byteLength - baseOffset) / size - : asArrayDef.numElements; - return range(effectiveNumElements, i => makeViews(elementType, baseOffset + size * i)); - } - } - else if (typeof typeDef === 'string') { - throw Error('unreachable'); - } - else { - const fields = typeDef.fields; - if (fields) { - const views = {}; - for (const [name, { type, offset }] of Object.entries(fields)) { - views[name] = makeViews(type, baseOffset + offset); - } - return views; - } - else { - return makeIntrinsicTypedArrayView(typeDef, buffer, baseOffset); - } - } - }; - return { views: makeViews(typeDef, baseOffset), arrayBuffer: buffer }; -} -/** - * Given a set of TypeArrayViews and matching JavaScript data - * sets the content of the views. - * - * Example: - * - * ```js - * const code = ` - * struct Stuff { - * direction: vec3f, - * strength: f32, - * matrix: mat4x4f, - * }; - * @group(0) @binding(0) var uni: Stuff; - * `; - * const defs = makeShaderDataDefinitions(code); - * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition); - * - * setStructuredViews({ - * direction: [1, 2, 3], - * strength: 45, - * matrix: [ - * 1, 0, 0, 0, - * 0, 1, 0, 0, - * 0, 0, 1, 0, - * 0, 0, 0, 1, - * ], - * }); - * ``` - * - * The code above will set the various views, which all point to different - * locations within the same array buffer. - * - * See @link {makeTypedArrayViews}. - * - * @param data The new values - * @param views TypedArray views as returned from {@link makeTypedArrayViews} - */ -function setStructuredView(data, views) { - if (data === undefined) { - return; - } - else if (isTypedArray(views)) { - const view = views; - if (view.length === 1 && typeof data === 'number') { - view[0] = data; - } - else { - if (Array.isArray(data[0]) || isTypedArray(data[0])) { - // complete hack! - // there's no type data here so let's guess based on the user's data - const dataLen = data[0].length; - const stride = dataLen === 3 ? 4 : dataLen; - for (let i = 0; i < data.length; ++i) { - const offset = i * stride; - view.set(data[i], offset); - } - } - else { - view.set(data); - } - } - } - else if (Array.isArray(views)) { - const asArray = views; - data.forEach((newValue, ndx) => { - setStructuredView(newValue, asArray[ndx]); - }); - } - else { - const asViews = views; - for (const [key, newValue] of Object.entries(data)) { - const view = asViews[key]; - if (view) { - setStructuredView(newValue, view); - } - } - } -} -/** - * 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 - */ -function makeStructuredView(varDef, arrayBuffer, offset = 0) { - const asVarDef = varDef; - const typeDef = asVarDef.group === undefined ? varDef : asVarDef.typeDefinition; - const views = makeTypedArrayViews(typeDef, arrayBuffer, offset); - return { - ...views, - set(data) { - setStructuredView(data, views.views); - }, - }; -} -const s_views = new WeakMap(); -function getViewsByCtor(arrayBuffer) { - let viewsByCtor = s_views.get(arrayBuffer); - if (!viewsByCtor) { - viewsByCtor = new Map(); - s_views.set(arrayBuffer, viewsByCtor); - } - return viewsByCtor; -} -function getView(arrayBuffer, Ctor) { - const viewsByCtor = getViewsByCtor(arrayBuffer); - let view = viewsByCtor.get(Ctor); - if (!view) { - view = new Ctor(arrayBuffer); - viewsByCtor.set(Ctor, view); - } - return view; -} -// Is this something like [1,2,3]? -function isArrayLikeOfNumber(data) { - return isTypedArray(data) || Array.isArray(data) && typeof data[0] === 'number'; -} -function setIntrinsicFromArrayLikeOfNumber(typeDef, data, arrayBuffer, offset) { - const asIntrinsicDefinition = typeDef; - const type = typeInfo[asIntrinsicDefinition.type]; - const view = getView(arrayBuffer, type.View); - const index = offset / view.BYTES_PER_ELEMENT; - if (typeof data === 'number') { - view[index] = data; - } - else { - view.set(data, index); - } -} -/** - * Sets values on an existing array buffer from a TypeDefinition - * @param typeDef A type definition provided by @link {makeShaderDataDefinitions} - * @param data The source data - * @param arrayBuffer The arrayBuffer who's data to set. - * @param offset An offset in the arrayBuffer to start at. - */ -function setTypedValues(typeDef, data, arrayBuffer, offset = 0) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - // It's ArrayDefinition - if (isIntrinsic(elementType)) { - const asIntrinsicDef = elementType; - if (isArrayLikeOfNumber(data)) { - setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset); - return; - } - } - data.forEach((newValue, ndx) => { - setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx); - }); - return; - } - const asStructDef = typeDef; - const fields = asStructDef.fields; - if (fields) { - // It's StructDefinition - for (const [key, newValue] of Object.entries(data)) { - const fieldDef = fields[key]; - if (fieldDef) { - setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset); - } - } - } - else { - // It's IntrinsicDefinition - setIntrinsicFromArrayLikeOfNumber(typeDef, data, arrayBuffer, offset); - } -} -/** - * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}. - * @param varDef A variable definition provided by @link {makeShaderDataDefinitions} - * @param data The source data - * @param arrayBuffer The arrayBuffer who's data to set. - * @param offset An offset in the arrayBuffer to start at. - */ -function setStructuredValues(varDef, data, arrayBuffer, offset = 0) { - setTypedValues(varDef.typeDefinition, data, arrayBuffer, offset); -} -function getAlignmentOfTypeDef(typeDef) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - return getAlignmentOfTypeDef(elementType); - } - const asStructDef = typeDef; - const fields = asStructDef.fields; - if (fields) { - return Object.values(fields).reduce((max, { type }) => Math.max(max, getAlignmentOfTypeDef(type)), 0); - } - const { type } = typeDef; - const { align } = typeInfo[type]; - return align; -} -function getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef) { - const asArrayDef = typeDef; - const elementType = asArrayDef.elementType; - if (elementType) { - const unalignedSize = elementType.size; - const align = getAlignmentOfTypeDef(elementType); - return { - unalignedSize, - align, - size: roundUpToMultipleOf(unalignedSize, align), - }; - } - const asStructDef = typeDef; - const fields = asStructDef.fields; - if (fields) { - const lastField = Object.values(fields).pop(); - if (lastField.type.size === 0) { - return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(lastField.type); - } - } - return { - size: 0, - unalignedSize: 0, - align: 1, - }; -} -/** - * Returns the size, align, and unalignedSize of "the" unsized array element. Unsized arrays are only - * allowed at the outer most level or the last member of a top level struct. - * - * Example: - * - * ```js - * const code = ` - * struct Foo { - * a: u32, - * b: array, - * }; - * @group(0) @binding(0) var f: Foo; - * `; - * const defs = makeShaderDataDefinitions(code); - * const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement( - * defs.storages.f); - * // size = 16 (since you need to allocate 16 bytes per element) - * // align = 16 (since vec3f needs to be aligned to 16 bytes) - * // unalignedSize = 12 (since only 12 bytes are used for a vec3f) - * ``` - * - * Generally you only need size. Example: - * - * ```js - * const code = ` - * struct Foo { - * a: u32, - * b: array, - * }; - * @group(0) @binding(0) var f: Foo; - * `; - * const defs = makeShaderDataDefinitions(code); - * const { size } = getSizeAndAlignmentOfUnsizedArrayElement(defs.storages.f); - * const numElements = 10; - * const views = makeStructuredViews( - * defs.storages.f, - * new ArrayBuffer(defs.storages.f.size + size * numElements)); - * ``` - * - * @param varDef A variable definition provided by @link {makeShaderDataDefinitions} - * @returns the size, align, and unalignedSize in bytes of the unsized array element in this type definition. - * If there is no unsized array, size = 0. - */ -function getSizeAndAlignmentOfUnsizedArrayElement(varDef) { - const asVarDef = varDef; - const typeDef = asVarDef.group === undefined ? varDef : asVarDef.typeDefinition; - return getSizeAndAlignmentOfUnsizedArrayElementOfTypeDef(typeDef); -} - -class ParseContext { - constructor() { - this.constants = new Map(); - this.aliases = new Map(); - this.structs = new Map(); - } -} -/** - * @class Node - * @category AST - * Base class for AST nodes parsed from a WGSL shader. - */ -class Node { - constructor() { } - get isAstNode() { - return true; - } - get astNodeType() { - return ""; - } - evaluate(context) { - throw new Error("Cannot evaluate node"); - } - evaluateString(context) { - return this.evaluate(context).toString(); - } - search(callback) { } - searchBlock(block, callback) { - if (block) { - callback(_BlockStart.instance); - for (const node of block) { - if (node instanceof Array) { - this.searchBlock(node, callback); - } - else { - node.search(callback); - } - } - callback(_BlockEnd.instance); - } - } -} -// For internal use only -class _BlockStart extends Node { -} -_BlockStart.instance = new _BlockStart(); -// For internal use only -class _BlockEnd extends Node { -} -_BlockEnd.instance = new _BlockEnd(); -/** - * @class Statement - * @extends Node - * @category AST - */ -class Statement extends Node { - constructor() { - super(); - } -} -/** - * @class Function - * @extends Statement - * @category AST - */ -class Function extends Statement { - constructor(name, args, returnType, body) { - super(); - this.name = name; - this.args = args; - this.returnType = returnType; - this.body = body; - } - get astNodeType() { - return "function"; - } - search(callback) { - this.searchBlock(this.body, callback); - } -} -/** - * @class StaticAssert - * @extends Statement - * @category AST - */ -class StaticAssert extends Statement { - constructor(expression) { - super(); - this.expression = expression; - } - get astNodeType() { - return "staticAssert"; - } - search(callback) { - this.expression.search(callback); - } -} -/** - * @class While - * @extends Statement - * @category AST - */ -class While extends Statement { - constructor(condition, body) { - super(); - this.condition = condition; - this.body = body; - } - get astNodeType() { - return "while"; - } - search(callback) { - this.condition.search(callback); - this.searchBlock(this.body, callback); - } -} -/** - * @class Continuing - * @extends Statement - * @category AST - */ -class Continuing extends Statement { - constructor(body) { - super(); - this.body = body; - } - get astNodeType() { - return "continuing"; - } - search(callback) { - this.searchBlock(this.body, callback); - } -} -/** - * @class For - * @extends Statement - * @category AST - */ -class For extends Statement { - constructor(init, condition, increment, body) { - super(); - this.init = init; - this.condition = condition; - this.increment = increment; - this.body = body; - } - get astNodeType() { - return "for"; - } - search(callback) { - var _a, _b, _c; - (_a = this.init) === null || _a === void 0 ? void 0 : _a.search(callback); - (_b = this.condition) === null || _b === void 0 ? void 0 : _b.search(callback); - (_c = this.increment) === null || _c === void 0 ? void 0 : _c.search(callback); - this.searchBlock(this.body, callback); - } -} -/** - * @class Var - * @extends Statement - * @category AST - */ -class Var extends Statement { - constructor(name, type, storage, access, value) { - super(); - this.name = name; - this.type = type; - this.storage = storage; - this.access = access; - this.value = value; - } - get astNodeType() { - return "var"; - } - search(callback) { - var _a; - callback(this); - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } -} -/** - * @class Override - * @extends Statement - * @category AST - */ -class Override extends Statement { - constructor(name, type, value) { - super(); - this.name = name; - this.type = type; - this.value = value; - } - get astNodeType() { - return "override"; - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } -} -/** - * @class Let - * @extends Statement - * @category AST - */ -class Let extends Statement { - constructor(name, type, storage, access, value) { - super(); - this.name = name; - this.type = type; - this.storage = storage; - this.access = access; - this.value = value; - } - get astNodeType() { - return "let"; - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } -} -/** - * @class Const - * @extends Statement - * @category AST - */ -class Const extends Statement { - constructor(name, type, storage, access, value) { - super(); - this.name = name; - this.type = type; - this.storage = storage; - this.access = access; - this.value = value; - } - get astNodeType() { - return "const"; - } - evaluate(context) { - return this.value.evaluate(context); - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } -} -var IncrementOperator; -(function (IncrementOperator) { - IncrementOperator["increment"] = "++"; - IncrementOperator["decrement"] = "--"; -})(IncrementOperator || (IncrementOperator = {})); -(function (IncrementOperator) { - function parse(val) { - const key = val; - if (key == "parse") - throw new Error("Invalid value for IncrementOperator"); - return IncrementOperator[key]; - } - IncrementOperator.parse = parse; -})(IncrementOperator || (IncrementOperator = {})); -/** - * @class Increment - * @extends Statement - * @category AST - */ -class Increment extends Statement { - constructor(operator, variable) { - super(); - this.operator = operator; - this.variable = variable; - } - get astNodeType() { - return "increment"; - } - search(callback) { - this.variable.search(callback); - } -} -var AssignOperator; -(function (AssignOperator) { - AssignOperator["assign"] = "="; - AssignOperator["addAssign"] = "+="; - AssignOperator["subtractAssin"] = "-="; - AssignOperator["multiplyAssign"] = "*="; - AssignOperator["divideAssign"] = "/="; - AssignOperator["moduloAssign"] = "%="; - AssignOperator["andAssign"] = "&="; - AssignOperator["orAssign"] = "|="; - AssignOperator["xorAssign"] = "^="; - AssignOperator["shiftLeftAssign"] = "<<="; - AssignOperator["shiftRightAssign"] = ">>="; -})(AssignOperator || (AssignOperator = {})); -(function (AssignOperator) { - function parse(val) { - const key = val; - if (key == "parse") { - throw new Error("Invalid value for AssignOperator"); - } - //return AssignOperator[key]; - return key; - } - AssignOperator.parse = parse; -})(AssignOperator || (AssignOperator = {})); -/** - * @class Assign - * @extends Statement - * @category AST - */ -class Assign extends Statement { - constructor(operator, variable, value) { - super(); - this.operator = operator; - this.variable = variable; - this.value = value; - } - get astNodeType() { - return "assign"; - } - search(callback) { - this.value.search(callback); - } -} -/** - * @class Call - * @extends Statement - * @category AST - */ -class Call extends Statement { - constructor(name, args) { - super(); - this.name = name; - this.args = args; - } - get astNodeType() { - return "call"; - } -} -/** - * @class Loop - * @extends Statement - * @category AST - */ -class Loop extends Statement { - constructor(body, continuing) { - super(); - this.body = body; - this.continuing = continuing; - } - get astNodeType() { - return "loop"; - } -} -/** - * @class Switch - * @extends Statement - * @category AST - */ -class Switch extends Statement { - constructor(condition, body) { - super(); - this.condition = condition; - this.body = body; - } - get astNodeType() { - return "body"; - } -} -/** - * @class If - * @extends Statement - * @category AST - */ -class If extends Statement { - constructor(condition, body, elseif, _else) { - super(); - this.condition = condition; - this.body = body; - this.elseif = elseif; - this.else = _else; - } - get astNodeType() { - return "if"; - } - search(callback) { - this.condition.search(callback); - this.searchBlock(this.body, callback); - this.searchBlock(this.elseif, callback); - this.searchBlock(this.else, callback); - } -} -/** - * @class Return - * @extends Statement - * @category AST - */ -class Return extends Statement { - constructor(value) { - super(); - this.value = value; - } - get astNodeType() { - return "return"; - } - search(callback) { - var _a; - (_a = this.value) === null || _a === void 0 ? void 0 : _a.search(callback); - } -} -/** - * @class Enable - * @extends Statement - * @category AST - */ -class Enable extends Statement { - constructor(name) { - super(); - this.name = name; - } - get astNodeType() { - return "enable"; - } -} -/** - * @class Alias - * @extends Statement - * @category AST - */ -class Alias extends Statement { - constructor(name, type) { - super(); - this.name = name; - this.type = type; - } - get astNodeType() { - return "alias"; - } -} -/** - * @class Discard - * @extends Statement - * @category AST - */ -class Discard extends Statement { - constructor() { - super(); - } - get astNodeType() { - return "discard"; - } -} -/** - * @class Break - * @extends Statement - * @category AST - */ -class Break extends Statement { - constructor() { - super(); - } - get astNodeType() { - return "break"; - } -} -/** - * @class Continue - * @extends Statement - * @category AST - */ -class Continue extends Statement { - constructor() { - super(); - } - get astNodeType() { - return "continue"; - } -} -/** - * @class Type - * @extends Statement - * @category AST - */ -class Type extends Statement { - constructor(name) { - super(); - this.name = name; - } - get astNodeType() { - return "type"; - } - get isStruct() { - return false; - } - get isArray() { - return false; - } -} -/** - * @class StructType - * @extends Type - * @category AST - */ -class Struct extends Type { - constructor(name, members) { - super(name); - this.members = members; - } - get astNodeType() { - return "struct"; - } - get isStruct() { - return true; - } - /// Return the index of the member with the given name, or -1 if not found. - getMemberIndex(name) { - for (let i = 0; i < this.members.length; i++) { - if (this.members[i].name == name) - return i; - } - return -1; - } -} -/** - * @class TemplateType - * @extends Type - * @category AST - */ -class TemplateType extends Type { - constructor(name, format, access) { - super(name); - this.format = format; - this.access = access; - } - get astNodeType() { - return "template"; - } -} -/** - * @class PointerType - * @extends Type - * @category AST - */ -class PointerType extends Type { - constructor(name, storage, type, access) { - super(name); - this.storage = storage; - this.type = type; - this.access = access; - } - get astNodeType() { - return "pointer"; - } -} -/** - * @class ArrayType - * @extends Type - * @category AST - */ -class ArrayType extends Type { - constructor(name, attributes, format, count) { - super(name); - this.attributes = attributes; - this.format = format; - this.count = count; - } - get astNodeType() { - return "array"; - } - get isArray() { - return true; - } -} -/** - * @class SamplerType - * @extends Type - * @category AST - */ -class SamplerType extends Type { - constructor(name, format, access) { - super(name); - this.format = format; - this.access = access; - } - get astNodeType() { - return "sampler"; - } -} -/** - * @class Expression - * @extends Node - * @category AST - */ -class Expression extends Node { - constructor() { - super(); - } -} -/** - * @class StringExpr - * @extends Expression - * @category AST - */ -class StringExpr extends Expression { - constructor(value) { - super(); - this.value = value; - } - get astNodeType() { - return "stringExpr"; - } - toString() { - return this.value; - } - evaluateString() { - return this.value; - } -} -/** - * @class CreateExpr - * @extends Expression - * @category AST - */ -class CreateExpr extends Expression { - constructor(type, args) { - super(); - this.type = type; - this.args = args; - } - get astNodeType() { - return "createExpr"; - } -} -/** - * @class CallExpr - * @extends Expression - * @category AST - */ -class CallExpr extends Expression { - constructor(name, args) { - super(); - this.name = name; - this.args = args; - } - get astNodeType() { - return "callExpr"; - } - evaluate(context) { - switch (this.name) { - case "abs": - return Math.abs(this.args[0].evaluate(context)); - case "acos": - return Math.acos(this.args[0].evaluate(context)); - case "acosh": - return Math.acosh(this.args[0].evaluate(context)); - case "asin": - return Math.asin(this.args[0].evaluate(context)); - case "asinh": - return Math.asinh(this.args[0].evaluate(context)); - case "atan": - return Math.atan(this.args[0].evaluate(context)); - case "atan2": - return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "atanh": - return Math.atanh(this.args[0].evaluate(context)); - case "ceil": - return Math.ceil(this.args[0].evaluate(context)); - case "clamp": - return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context)); - case "cos": - return Math.cos(this.args[0].evaluate(context)); - //case "cross": - //TODO: (x[i] * y[j] - x[j] * y[i]) - case "degrees": - return (this.args[0].evaluate(context) * 180) / Math.PI; - //case "determinant": - //TODO implement - case "distance": - return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2)); - case "dot": - //TODO: (x[i] * y[i]) - case "exp": - return Math.exp(this.args[0].evaluate(context)); - case "exp2": - return Math.pow(2, this.args[0].evaluate(context)); - //case "extractBits": - //TODO: implement - //case "firstLeadingBit": - //TODO: implement - case "floor": - return Math.floor(this.args[0].evaluate(context)); - case "fma": - return (this.args[0].evaluate(context) * this.args[1].evaluate(context) + - this.args[2].evaluate(context)); - case "fract": - return (this.args[0].evaluate(context) - - Math.floor(this.args[0].evaluate(context))); - //case "frexp": - //TODO: implement - case "inverseSqrt": - return 1 / Math.sqrt(this.args[0].evaluate(context)); - //case "length": - //TODO: implement - case "log": - return Math.log(this.args[0].evaluate(context)); - case "log2": - return Math.log2(this.args[0].evaluate(context)); - case "max": - return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "min": - return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "mix": - return (this.args[0].evaluate(context) * - (1 - this.args[2].evaluate(context)) + - this.args[1].evaluate(context) * this.args[2].evaluate(context)); - case "modf": - return (this.args[0].evaluate(context) - - Math.floor(this.args[0].evaluate(context))); - case "pow": - return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context)); - case "radians": - return (this.args[0].evaluate(context) * Math.PI) / 180; - case "round": - return Math.round(this.args[0].evaluate(context)); - case "sign": - return Math.sign(this.args[0].evaluate(context)); - case "sin": - return Math.sin(this.args[0].evaluate(context)); - case "sinh": - return Math.sinh(this.args[0].evaluate(context)); - case "saturate": - return Math.min(Math.max(this.args[0].evaluate(context), 0), 1); - case "smoothstep": - return (this.args[0].evaluate(context) * - this.args[0].evaluate(context) * - (3 - 2 * this.args[0].evaluate(context))); - case "sqrt": - return Math.sqrt(this.args[0].evaluate(context)); - case "step": - return this.args[0].evaluate(context) < this.args[1].evaluate(context) - ? 0 - : 1; - case "tan": - return Math.tan(this.args[0].evaluate(context)); - case "tanh": - return Math.tanh(this.args[0].evaluate(context)); - case "trunc": - return Math.trunc(this.args[0].evaluate(context)); - default: - throw new Error("Non const function: " + this.name); - } - } - search(callback) { - for (const node of this.args) { - node.search(callback); - } - callback(this); - } -} -/** - * @class VariableExpr - * @extends Expression - * @category AST - */ -class VariableExpr extends Expression { - constructor(name) { - super(); - this.name = name; - } - get astNodeType() { - return "varExpr"; - } - search(callback) { - callback(this); - } -} -/** - * @class ConstExpr - * @extends Expression - * @category AST - */ -class ConstExpr extends Expression { - constructor(name, initializer) { - super(); - this.name = name; - this.initializer = initializer; - } - get astNodeType() { - return "constExpr"; - } - evaluate(context) { - var _a, _b; - if (this.initializer instanceof CreateExpr) { - // This is a struct constant - const property = (_a = this.postfix) === null || _a === void 0 ? void 0 : _a.evaluateString(context); - const type = (_b = this.initializer.type) === null || _b === void 0 ? void 0 : _b.name; - const struct = context.structs.get(type); - const memberIndex = struct === null || struct === void 0 ? void 0 : struct.getMemberIndex(property); - if (memberIndex != -1) { - const value = this.initializer.args[memberIndex].evaluate(context); - return value; - } - console.log(memberIndex); - } - return this.initializer.evaluate(context); - } - search(callback) { - this.initializer.search(callback); - } -} -/** - * @class LiteralExpr - * @extends Expression - * @category AST - */ -class LiteralExpr extends Expression { - constructor(value) { - super(); - this.value = value; - } - get astNodeType() { - return "literalExpr"; - } - evaluate() { - return this.value; - } -} -/** - * @class BitcastExpr - * @extends Expression - * @category AST - */ -class BitcastExpr extends Expression { - constructor(type, value) { - super(); - this.type = type; - this.value = value; - } - get astNodeType() { - return "bitcastExpr"; - } - search(callback) { - this.value.search(callback); - } -} -/** - * @class TypecastExpr - * @extends Expression - * @category AST - */ -class TypecastExpr extends Expression { - constructor(type, args) { - super(); - this.type = type; - this.args = args; - } - get astNodeType() { - return "typecastExpr"; - } - evaluate(context) { - return this.args[0].evaluate(context); - } - search(callback) { - this.searchBlock(this.args, callback); - } -} -/** - * @class GroupingExpr - * @extends Expression - * @category AST - */ -class GroupingExpr extends Expression { - constructor(contents) { - super(); - this.contents = contents; - } - get astNodeType() { - return "groupExpr"; - } - evaluate(context) { - return this.contents[0].evaluate(context); - } - search(callback) { - this.searchBlock(this.contents, callback); - } -} -/** - * @class Operator - * @extends Expression - * @category AST - */ -class Operator extends Expression { - constructor() { - super(); - } -} -/** - * @class UnaryOperator - * @extends Operator - * @category AST - * @property {string} operator +, -, !, ~ - */ -class UnaryOperator extends Operator { - constructor(operator, right) { - super(); - this.operator = operator; - this.right = right; - } - get astNodeType() { - return "unaryOp"; - } - evaluate(context) { - switch (this.operator) { - case "+": - return this.right.evaluate(context); - case "-": - return -this.right.evaluate(context); - case "!": - return this.right.evaluate(context) ? 0 : 1; - case "~": - return ~this.right.evaluate(context); - default: - throw new Error("Unknown unary operator: " + this.operator); - } - } - search(callback) { - this.right.search(callback); - } -} -/** - * @class BinaryOperator - * @extends Operator - * @category AST - * @property {string} operator +, -, *, /, %, ==, !=, <, >, <=, >=, &&, || - */ -class BinaryOperator extends Operator { - constructor(operator, left, right) { - super(); - this.operator = operator; - this.left = left; - this.right = right; - } - get astNodeType() { - return "binaryOp"; - } - evaluate(context) { - switch (this.operator) { - case "+": - return this.left.evaluate(context) + this.right.evaluate(context); - case "-": - return this.left.evaluate(context) - this.right.evaluate(context); - case "*": - return this.left.evaluate(context) * this.right.evaluate(context); - case "/": - return this.left.evaluate(context) / this.right.evaluate(context); - case "%": - return this.left.evaluate(context) % this.right.evaluate(context); - case "==": - return this.left.evaluate(context) == this.right.evaluate(context) - ? 1 - : 0; - case "!=": - return this.left.evaluate(context) != this.right.evaluate(context) - ? 1 - : 0; - case "<": - return this.left.evaluate(context) < this.right.evaluate(context) - ? 1 - : 0; - case ">": - return this.left.evaluate(context) > this.right.evaluate(context) - ? 1 - : 0; - case "<=": - return this.left.evaluate(context) <= this.right.evaluate(context) - ? 1 - : 0; - case ">=": - return this.left.evaluate(context) >= this.right.evaluate(context) - ? 1 - : 0; - case "&&": - return this.left.evaluate(context) && this.right.evaluate(context) - ? 1 - : 0; - case "||": - return this.left.evaluate(context) || this.right.evaluate(context) - ? 1 - : 0; - default: - throw new Error(`Unknown operator ${this.operator}`); - } - } - search(callback) { - this.left.search(callback); - this.right.search(callback); - } -} -/** - * @class SwitchCase - * @extends Node - * @category AST - */ -class SwitchCase extends Node { - constructor() { - super(); - } -} -/** - * @class Case - * @extends SwitchCase - * @category AST - */ -class Case extends SwitchCase { - constructor(selector, body) { - super(); - this.selector = selector; - this.body = body; - } - get astNodeType() { - return "case"; - } - search(callback) { - this.searchBlock(this.body, callback); - } -} -/** - * @class Default - * @extends SwitchCase - * @category AST - */ -class Default extends SwitchCase { - constructor(body) { - super(); - this.body = body; - } - get astNodeType() { - return "default"; - } - search(callback) { - this.searchBlock(this.body, callback); - } -} -/** - * @class Argument - * @extends Node - * @category AST - */ -class Argument extends Node { - constructor(name, type, attributes) { - super(); - this.name = name; - this.type = type; - this.attributes = attributes; - } - get astNodeType() { - return "argument"; - } -} -/** - * @class ElseIf - * @extends Node - * @category AST - */ -class ElseIf extends Node { - constructor(condition, body) { - super(); - this.condition = condition; - this.body = body; - } - get astNodeType() { - return "elseif"; - } - search(callback) { - this.condition.search(callback); - this.searchBlock(this.body, callback); - } -} -/** - * @class Member - * @extends Node - * @category AST - */ -class Member extends Node { - constructor(name, type, attributes) { - super(); - this.name = name; - this.type = type; - this.attributes = attributes; - } - get astNodeType() { - return "member"; - } -} -/** - * @class Attribute - * @extends Node - * @category AST - */ -class Attribute extends Node { - constructor(name, value) { - super(); - this.name = name; - this.value = value; - } - get astNodeType() { - return "attribute"; - } -} - -var _a; -var TokenClass; -(function (TokenClass) { - TokenClass[TokenClass["token"] = 0] = "token"; - TokenClass[TokenClass["keyword"] = 1] = "keyword"; - TokenClass[TokenClass["reserved"] = 2] = "reserved"; -})(TokenClass || (TokenClass = {})); -class TokenType { - constructor(name, type, rule) { - this.name = name; - this.type = type; - this.rule = rule; - } - toString() { - return this.name; - } -} -/// Catalog of defined token types, keywords, and reserved words. -class TokenTypes { -} -_a = TokenTypes; -TokenTypes.none = new TokenType("", TokenClass.reserved, ""); -TokenTypes.eof = new TokenType("EOF", TokenClass.token, ""); -TokenTypes.reserved = { - asm: new TokenType("asm", TokenClass.reserved, "asm"), - bf16: new TokenType("bf16", TokenClass.reserved, "bf16"), - do: new TokenType("do", TokenClass.reserved, "do"), - enum: new TokenType("enum", TokenClass.reserved, "enum"), - f16: new TokenType("f16", TokenClass.reserved, "f16"), - f64: new TokenType("f64", TokenClass.reserved, "f64"), - handle: new TokenType("handle", TokenClass.reserved, "handle"), - i8: new TokenType("i8", TokenClass.reserved, "i8"), - i16: new TokenType("i16", TokenClass.reserved, "i16"), - i64: new TokenType("i64", TokenClass.reserved, "i64"), - mat: new TokenType("mat", TokenClass.reserved, "mat"), - premerge: new TokenType("premerge", TokenClass.reserved, "premerge"), - regardless: new TokenType("regardless", TokenClass.reserved, "regardless"), - typedef: new TokenType("typedef", TokenClass.reserved, "typedef"), - u8: new TokenType("u8", TokenClass.reserved, "u8"), - u16: new TokenType("u16", TokenClass.reserved, "u16"), - u64: new TokenType("u64", TokenClass.reserved, "u64"), - unless: new TokenType("unless", TokenClass.reserved, "unless"), - using: new TokenType("using", TokenClass.reserved, "using"), - vec: new TokenType("vec", TokenClass.reserved, "vec"), - void: new TokenType("void", TokenClass.reserved, "void"), -}; -TokenTypes.keywords = { - array: new TokenType("array", TokenClass.keyword, "array"), - atomic: new TokenType("atomic", TokenClass.keyword, "atomic"), - bool: new TokenType("bool", TokenClass.keyword, "bool"), - f32: new TokenType("f32", TokenClass.keyword, "f32"), - i32: new TokenType("i32", TokenClass.keyword, "i32"), - mat2x2: new TokenType("mat2x2", TokenClass.keyword, "mat2x2"), - mat2x3: new TokenType("mat2x3", TokenClass.keyword, "mat2x3"), - mat2x4: new TokenType("mat2x4", TokenClass.keyword, "mat2x4"), - mat3x2: new TokenType("mat3x2", TokenClass.keyword, "mat3x2"), - mat3x3: new TokenType("mat3x3", TokenClass.keyword, "mat3x3"), - mat3x4: new TokenType("mat3x4", TokenClass.keyword, "mat3x4"), - mat4x2: new TokenType("mat4x2", TokenClass.keyword, "mat4x2"), - mat4x3: new TokenType("mat4x3", TokenClass.keyword, "mat4x3"), - mat4x4: new TokenType("mat4x4", TokenClass.keyword, "mat4x4"), - ptr: new TokenType("ptr", TokenClass.keyword, "ptr"), - sampler: new TokenType("sampler", TokenClass.keyword, "sampler"), - sampler_comparison: new TokenType("sampler_comparison", TokenClass.keyword, "sampler_comparison"), - struct: new TokenType("struct", TokenClass.keyword, "struct"), - texture_1d: new TokenType("texture_1d", TokenClass.keyword, "texture_1d"), - texture_2d: new TokenType("texture_2d", TokenClass.keyword, "texture_2d"), - texture_2d_array: new TokenType("texture_2d_array", TokenClass.keyword, "texture_2d_array"), - texture_3d: new TokenType("texture_3d", TokenClass.keyword, "texture_3d"), - texture_cube: new TokenType("texture_cube", TokenClass.keyword, "texture_cube"), - texture_cube_array: new TokenType("texture_cube_array", TokenClass.keyword, "texture_cube_array"), - texture_multisampled_2d: new TokenType("texture_multisampled_2d", TokenClass.keyword, "texture_multisampled_2d"), - texture_storage_1d: new TokenType("texture_storage_1d", TokenClass.keyword, "texture_storage_1d"), - texture_storage_2d: new TokenType("texture_storage_2d", TokenClass.keyword, "texture_storage_2d"), - texture_storage_2d_array: new TokenType("texture_storage_2d_array", TokenClass.keyword, "texture_storage_2d_array"), - texture_storage_3d: new TokenType("texture_storage_3d", TokenClass.keyword, "texture_storage_3d"), - texture_depth_2d: new TokenType("texture_depth_2d", TokenClass.keyword, "texture_depth_2d"), - texture_depth_2d_array: new TokenType("texture_depth_2d_array", TokenClass.keyword, "texture_depth_2d_array"), - texture_depth_cube: new TokenType("texture_depth_cube", TokenClass.keyword, "texture_depth_cube"), - texture_depth_cube_array: new TokenType("texture_depth_cube_array", TokenClass.keyword, "texture_depth_cube_array"), - texture_depth_multisampled_2d: new TokenType("texture_depth_multisampled_2d", TokenClass.keyword, "texture_depth_multisampled_2d"), - texture_external: new TokenType("texture_external", TokenClass.keyword, "texture_external"), - u32: new TokenType("u32", TokenClass.keyword, "u32"), - vec2: new TokenType("vec2", TokenClass.keyword, "vec2"), - vec3: new TokenType("vec3", TokenClass.keyword, "vec3"), - vec4: new TokenType("vec4", TokenClass.keyword, "vec4"), - bitcast: new TokenType("bitcast", TokenClass.keyword, "bitcast"), - block: new TokenType("block", TokenClass.keyword, "block"), - break: new TokenType("break", TokenClass.keyword, "break"), - case: new TokenType("case", TokenClass.keyword, "case"), - continue: new TokenType("continue", TokenClass.keyword, "continue"), - continuing: new TokenType("continuing", TokenClass.keyword, "continuing"), - default: new TokenType("default", TokenClass.keyword, "default"), - discard: new TokenType("discard", TokenClass.keyword, "discard"), - else: new TokenType("else", TokenClass.keyword, "else"), - enable: new TokenType("enable", TokenClass.keyword, "enable"), - fallthrough: new TokenType("fallthrough", TokenClass.keyword, "fallthrough"), - false: new TokenType("false", TokenClass.keyword, "false"), - fn: new TokenType("fn", TokenClass.keyword, "fn"), - for: new TokenType("for", TokenClass.keyword, "for"), - function: new TokenType("function", TokenClass.keyword, "function"), - if: new TokenType("if", TokenClass.keyword, "if"), - let: new TokenType("let", TokenClass.keyword, "let"), - const: new TokenType("const", TokenClass.keyword, "const"), - loop: new TokenType("loop", TokenClass.keyword, "loop"), - while: new TokenType("while", TokenClass.keyword, "while"), - private: new TokenType("private", TokenClass.keyword, "private"), - read: new TokenType("read", TokenClass.keyword, "read"), - read_write: new TokenType("read_write", TokenClass.keyword, "read_write"), - return: new TokenType("return", TokenClass.keyword, "return"), - storage: new TokenType("storage", TokenClass.keyword, "storage"), - switch: new TokenType("switch", TokenClass.keyword, "switch"), - true: new TokenType("true", TokenClass.keyword, "true"), - alias: new TokenType("alias", TokenClass.keyword, "alias"), - type: new TokenType("type", TokenClass.keyword, "type"), - uniform: new TokenType("uniform", TokenClass.keyword, "uniform"), - var: new TokenType("var", TokenClass.keyword, "var"), - override: new TokenType("override", TokenClass.keyword, "override"), - workgroup: new TokenType("workgroup", TokenClass.keyword, "workgroup"), - write: new TokenType("write", TokenClass.keyword, "write"), - r8unorm: new TokenType("r8unorm", TokenClass.keyword, "r8unorm"), - r8snorm: new TokenType("r8snorm", TokenClass.keyword, "r8snorm"), - r8uint: new TokenType("r8uint", TokenClass.keyword, "r8uint"), - r8sint: new TokenType("r8sint", TokenClass.keyword, "r8sint"), - r16uint: new TokenType("r16uint", TokenClass.keyword, "r16uint"), - r16sint: new TokenType("r16sint", TokenClass.keyword, "r16sint"), - r16float: new TokenType("r16float", TokenClass.keyword, "r16float"), - rg8unorm: new TokenType("rg8unorm", TokenClass.keyword, "rg8unorm"), - rg8snorm: new TokenType("rg8snorm", TokenClass.keyword, "rg8snorm"), - rg8uint: new TokenType("rg8uint", TokenClass.keyword, "rg8uint"), - rg8sint: new TokenType("rg8sint", TokenClass.keyword, "rg8sint"), - r32uint: new TokenType("r32uint", TokenClass.keyword, "r32uint"), - r32sint: new TokenType("r32sint", TokenClass.keyword, "r32sint"), - r32float: new TokenType("r32float", TokenClass.keyword, "r32float"), - rg16uint: new TokenType("rg16uint", TokenClass.keyword, "rg16uint"), - rg16sint: new TokenType("rg16sint", TokenClass.keyword, "rg16sint"), - rg16float: new TokenType("rg16float", TokenClass.keyword, "rg16float"), - rgba8unorm: new TokenType("rgba8unorm", TokenClass.keyword, "rgba8unorm"), - rgba8unorm_srgb: new TokenType("rgba8unorm_srgb", TokenClass.keyword, "rgba8unorm_srgb"), - rgba8snorm: new TokenType("rgba8snorm", TokenClass.keyword, "rgba8snorm"), - rgba8uint: new TokenType("rgba8uint", TokenClass.keyword, "rgba8uint"), - rgba8sint: new TokenType("rgba8sint", TokenClass.keyword, "rgba8sint"), - bgra8unorm: new TokenType("bgra8unorm", TokenClass.keyword, "bgra8unorm"), - bgra8unorm_srgb: new TokenType("bgra8unorm_srgb", TokenClass.keyword, "bgra8unorm_srgb"), - rgb10a2unorm: new TokenType("rgb10a2unorm", TokenClass.keyword, "rgb10a2unorm"), - rg11b10float: new TokenType("rg11b10float", TokenClass.keyword, "rg11b10float"), - rg32uint: new TokenType("rg32uint", TokenClass.keyword, "rg32uint"), - rg32sint: new TokenType("rg32sint", TokenClass.keyword, "rg32sint"), - rg32float: new TokenType("rg32float", TokenClass.keyword, "rg32float"), - rgba16uint: new TokenType("rgba16uint", TokenClass.keyword, "rgba16uint"), - rgba16sint: new TokenType("rgba16sint", TokenClass.keyword, "rgba16sint"), - rgba16float: new TokenType("rgba16float", TokenClass.keyword, "rgba16float"), - rgba32uint: new TokenType("rgba32uint", TokenClass.keyword, "rgba32uint"), - rgba32sint: new TokenType("rgba32sint", TokenClass.keyword, "rgba32sint"), - rgba32float: new TokenType("rgba32float", TokenClass.keyword, "rgba32float"), - static_assert: new TokenType("static_assert", TokenClass.keyword, "static_assert"), - // WGSL grammar has a few keywords that have different token names than the strings they - // represent. Aliasing them here. - /*int32: new TokenType("i32", TokenClass.keyword, "i32"), - uint32: new TokenType("u32", TokenClass.keyword, "u32"), - float32: new TokenType("f32", TokenClass.keyword, "f32"), - pointer: new TokenType("ptr", TokenClass.keyword, "ptr"),*/ -}; -TokenTypes.tokens = { - 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)/), - 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?))/), - int_literal: new TokenType("int_literal", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/), - uint_literal: new TokenType("uint_literal", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/), - ident: new TokenType("ident", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/), - and: new TokenType("and", TokenClass.token, "&"), - and_and: new TokenType("and_and", TokenClass.token, "&&"), - arrow: new TokenType("arrow ", TokenClass.token, "->"), - attr: new TokenType("attr", TokenClass.token, "@"), - attr_left: new TokenType("attr_left", TokenClass.token, "[["), - attr_right: new TokenType("attr_right", TokenClass.token, "]]"), - forward_slash: new TokenType("forward_slash", TokenClass.token, "/"), - bang: new TokenType("bang", TokenClass.token, "!"), - bracket_left: new TokenType("bracket_left", TokenClass.token, "["), - bracket_right: new TokenType("bracket_right", TokenClass.token, "]"), - brace_left: new TokenType("brace_left", TokenClass.token, "{"), - brace_right: new TokenType("brace_right", TokenClass.token, "}"), - colon: new TokenType("colon", TokenClass.token, ":"), - comma: new TokenType("comma", TokenClass.token, ","), - equal: new TokenType("equal", TokenClass.token, "="), - equal_equal: new TokenType("equal_equal", TokenClass.token, "=="), - not_equal: new TokenType("not_equal", TokenClass.token, "!="), - greater_than: new TokenType("greater_than", TokenClass.token, ">"), - greater_than_equal: new TokenType("greater_than_equal", TokenClass.token, ">="), - shift_right: new TokenType("shift_right", TokenClass.token, ">>"), - less_than: new TokenType("less_than", TokenClass.token, "<"), - less_than_equal: new TokenType("less_than_equal", TokenClass.token, "<="), - shift_left: new TokenType("shift_left", TokenClass.token, "<<"), - modulo: new TokenType("modulo", TokenClass.token, "%"), - minus: new TokenType("minus", TokenClass.token, "-"), - minus_minus: new TokenType("minus_minus", TokenClass.token, "--"), - period: new TokenType("period", TokenClass.token, "."), - plus: new TokenType("plus", TokenClass.token, "+"), - plus_plus: new TokenType("plus_plus", TokenClass.token, "++"), - or: new TokenType("or", TokenClass.token, "|"), - or_or: new TokenType("or_or", TokenClass.token, "||"), - paren_left: new TokenType("paren_left", TokenClass.token, "("), - paren_right: new TokenType("paren_right", TokenClass.token, ")"), - semicolon: new TokenType("semicolon", TokenClass.token, ";"), - star: new TokenType("star", TokenClass.token, "*"), - tilde: new TokenType("tilde", TokenClass.token, "~"), - underscore: new TokenType("underscore", TokenClass.token, "_"), - xor: new TokenType("xor", TokenClass.token, "^"), - plus_equal: new TokenType("plus_equal", TokenClass.token, "+="), - minus_equal: new TokenType("minus_equal", TokenClass.token, "-="), - times_equal: new TokenType("times_equal", TokenClass.token, "*="), - division_equal: new TokenType("division_equal", TokenClass.token, "/="), - modulo_equal: new TokenType("modulo_equal", TokenClass.token, "%="), - and_equal: new TokenType("and_equal", TokenClass.token, "&="), - or_equal: new TokenType("or_equal", TokenClass.token, "|="), - xor_equal: new TokenType("xor_equal", TokenClass.token, "^="), - shift_right_equal: new TokenType("shift_right_equal", TokenClass.token, ">>="), - shift_left_equal: new TokenType("shift_left_equal", TokenClass.token, "<<="), -}; -TokenTypes.storage_class = [ - _a.keywords.function, - _a.keywords.private, - _a.keywords.workgroup, - _a.keywords.uniform, - _a.keywords.storage, -]; -TokenTypes.access_mode = [ - _a.keywords.read, - _a.keywords.write, - _a.keywords.read_write, -]; -TokenTypes.sampler_type = [ - _a.keywords.sampler, - _a.keywords.sampler_comparison, -]; -TokenTypes.sampled_texture_type = [ - _a.keywords.texture_1d, - _a.keywords.texture_2d, - _a.keywords.texture_2d_array, - _a.keywords.texture_3d, - _a.keywords.texture_cube, - _a.keywords.texture_cube_array, -]; -TokenTypes.multisampled_texture_type = [ - _a.keywords.texture_multisampled_2d, -]; -TokenTypes.storage_texture_type = [ - _a.keywords.texture_storage_1d, - _a.keywords.texture_storage_2d, - _a.keywords.texture_storage_2d_array, - _a.keywords.texture_storage_3d, -]; -TokenTypes.depth_texture_type = [ - _a.keywords.texture_depth_2d, - _a.keywords.texture_depth_2d_array, - _a.keywords.texture_depth_cube, - _a.keywords.texture_depth_cube_array, - _a.keywords.texture_depth_multisampled_2d, -]; -TokenTypes.texture_external_type = [_a.keywords.texture_external]; -TokenTypes.any_texture_type = [ - ..._a.sampled_texture_type, - ..._a.multisampled_texture_type, - ..._a.storage_texture_type, - ..._a.depth_texture_type, - ..._a.texture_external_type, -]; -TokenTypes.texel_format = [ - _a.keywords.r8unorm, - _a.keywords.r8snorm, - _a.keywords.r8uint, - _a.keywords.r8sint, - _a.keywords.r16uint, - _a.keywords.r16sint, - _a.keywords.r16float, - _a.keywords.rg8unorm, - _a.keywords.rg8snorm, - _a.keywords.rg8uint, - _a.keywords.rg8sint, - _a.keywords.r32uint, - _a.keywords.r32sint, - _a.keywords.r32float, - _a.keywords.rg16uint, - _a.keywords.rg16sint, - _a.keywords.rg16float, - _a.keywords.rgba8unorm, - _a.keywords.rgba8unorm_srgb, - _a.keywords.rgba8snorm, - _a.keywords.rgba8uint, - _a.keywords.rgba8sint, - _a.keywords.bgra8unorm, - _a.keywords.bgra8unorm_srgb, - _a.keywords.rgb10a2unorm, - _a.keywords.rg11b10float, - _a.keywords.rg32uint, - _a.keywords.rg32sint, - _a.keywords.rg32float, - _a.keywords.rgba16uint, - _a.keywords.rgba16sint, - _a.keywords.rgba16float, - _a.keywords.rgba32uint, - _a.keywords.rgba32sint, - _a.keywords.rgba32float, -]; -TokenTypes.const_literal = [ - _a.tokens.int_literal, - _a.tokens.uint_literal, - _a.tokens.decimal_float_literal, - _a.tokens.hex_float_literal, - _a.keywords.true, - _a.keywords.false, -]; -TokenTypes.literal_or_ident = [ - _a.tokens.ident, - _a.tokens.int_literal, - _a.tokens.uint_literal, - _a.tokens.decimal_float_literal, - _a.tokens.hex_float_literal, -]; -TokenTypes.element_count_expression = [ - _a.tokens.int_literal, - _a.tokens.uint_literal, - _a.tokens.ident, -]; -TokenTypes.template_types = [ - _a.keywords.vec2, - _a.keywords.vec3, - _a.keywords.vec4, - _a.keywords.mat2x2, - _a.keywords.mat2x3, - _a.keywords.mat2x4, - _a.keywords.mat3x2, - _a.keywords.mat3x3, - _a.keywords.mat3x4, - _a.keywords.mat4x2, - _a.keywords.mat4x3, - _a.keywords.mat4x4, - _a.keywords.atomic, - _a.keywords.bitcast, - ..._a.any_texture_type, -]; -// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'. -// The attribute grammar should be ident | block. -TokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block]; -TokenTypes.assignment_operators = [ - _a.tokens.equal, - _a.tokens.plus_equal, - _a.tokens.minus_equal, - _a.tokens.times_equal, - _a.tokens.division_equal, - _a.tokens.modulo_equal, - _a.tokens.and_equal, - _a.tokens.or_equal, - _a.tokens.xor_equal, - _a.tokens.shift_right_equal, - _a.tokens.shift_left_equal, -]; -TokenTypes.increment_operators = [ - _a.tokens.plus_plus, - _a.tokens.minus_minus, -]; -/// A token parsed by the WgslScanner. -class Token { - constructor(type, lexeme, line) { - this.type = type; - this.lexeme = lexeme; - this.line = line; - } - toString() { - return this.lexeme; - } - isTemplateType() { - return TokenTypes.template_types.indexOf(this.type) != -1; - } - isArrayType() { - return this.type == TokenTypes.keywords.array; - } - isArrayOrTemplateType() { - return this.isArrayType() || this.isTemplateType(); - } -} -/// Lexical scanner for the WGSL language. This takes an input source text and generates a list -/// of Token objects, which can then be fed into the WgslParser to generate an AST. -class WgslScanner { - constructor(source) { - this._tokens = []; - this._start = 0; - this._current = 0; - this._line = 1; - this._source = source !== null && source !== void 0 ? source : ""; - } - /// Scan all tokens from the source. - scanTokens() { - while (!this._isAtEnd()) { - this._start = this._current; - if (!this.scanToken()) - throw `Invalid syntax at line ${this._line}`; - } - this._tokens.push(new Token(TokenTypes.eof, "", this._line)); - return this._tokens; - } - /// Scan a single token from the source. - scanToken() { - // Find the longest consecutive set of characters that match a rule. - let lexeme = this._advance(); - // Skip line-feed, adding to the line counter. - if (lexeme == "\n") { - this._line++; - return true; - } - // Skip whitespace - if (this._isWhitespace(lexeme)) { - return true; - } - if (lexeme == "/") { - // If it's a // comment, skip everything until the next line-feed. - if (this._peekAhead() == "/") { - while (lexeme != "\n") { - if (this._isAtEnd()) - return true; - lexeme = this._advance(); - } - // skip the linefeed - this._line++; - return true; - } - else if (this._peekAhead() == "*") { - // If it's a / * block comment, skip everything until the matching * /, - // allowing for nested block comments. - this._advance(); - let commentLevel = 1; - while (commentLevel > 0) { - if (this._isAtEnd()) - return true; - lexeme = this._advance(); - if (lexeme == "\n") { - this._line++; - } - else if (lexeme == "*") { - if (this._peekAhead() == "/") { - this._advance(); - commentLevel--; - if (commentLevel == 0) { - return true; - } - } - } - else if (lexeme == "/") { - if (this._peekAhead() == "*") { - this._advance(); - commentLevel++; - } - } - } - return true; - } - } - let matchType = TokenTypes.none; - for (;;) { - let matchedType = this._findType(lexeme); - // An exception to "longest lexeme" rule is '>>'. In the case of 1>>2, it's a - // shift_right. - // In the case of array>, it's two greater_than's (one to close the vec4, - // and one to close the array). - // Another ambiguity is '>='. In the case of vec2=vec2(1,2), - // it's a greather_than and an equal, not a greater_than_equal. - // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases - // are predicated on it the > either closing a template, or being part of an operator. - // The solution here is to check if there was a less_than up to some number of tokens - // previously, and the token prior to that is a keyword that requires a '<', then it will be - // split into two operators; otherwise it's a single operator. - const nextLexeme = this._peekAhead(); - if (lexeme == ">" && (nextLexeme == ">" || nextLexeme == "=")) { - let foundLessThan = false; - let ti = this._tokens.length - 1; - for (let count = 0; count < 5 && ti >= 0; ++count, --ti) { - if (this._tokens[ti].type === TokenTypes.tokens.less_than) { - if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) { - foundLessThan = true; - } - break; - } - } - // If there was a less_than in the recent token history, then this is probably a - // greater_than. - if (foundLessThan) { - this._addToken(matchedType); - return true; - } - } - // The current lexeme may not match any rule, but some token types may be invalid for - // part of the string but valid after a few more characters. - // For example, 0x.5 is a hex_float_literal. But as it's being scanned, - // "0" is a int_literal, then "0x" is invalid. If we stopped there, it would return - // the int_literal "0", but that's incorrect. So if we look forward a few characters, - // we'd get "0x.", which is still invalid, followed by "0x.5" which is the correct - // hex_float_literal. So that means if we hit an non-matching string, we should look - // ahead up to two characters to see if the string starts matching a valid rule again. - if (matchedType === TokenTypes.none) { - let lookAheadLexeme = lexeme; - let lookAhead = 0; - const maxLookAhead = 2; - for (let li = 0; li < maxLookAhead; ++li) { - lookAheadLexeme += this._peekAhead(li); - matchedType = this._findType(lookAheadLexeme); - if (matchedType !== TokenTypes.none) { - lookAhead = li; - break; - } - } - if (matchedType === TokenTypes.none) { - if (matchType === TokenTypes.none) - return false; - this._current--; - this._addToken(matchType); - return true; - } - lexeme = lookAheadLexeme; - this._current += lookAhead + 1; - } - matchType = matchedType; - if (this._isAtEnd()) - break; - lexeme += this._advance(); - } - // We got to the end of the input stream. Then the token we've ready so far is it. - if (matchType === TokenTypes.none) - return false; - this._addToken(matchType); - return true; - } - _findType(lexeme) { - for (const name in TokenTypes.keywords) { - const type = TokenTypes.keywords[name]; - if (this._match(lexeme, type.rule)) { - return type; - } - } - for (const name in TokenTypes.tokens) { - const type = TokenTypes.tokens[name]; - if (this._match(lexeme, type.rule)) { - return type; - } - } - return TokenTypes.none; - } - _match(lexeme, rule) { - if (typeof rule === "string") { - if (rule == lexeme) { - return true; - } - } - else { - // regex - const match = rule.exec(lexeme); - if (match && match.index == 0 && match[0] == lexeme) - return true; - } - return false; - } - _isAtEnd() { - return this._current >= this._source.length; - } - _isWhitespace(c) { - return c == " " || c == "\t" || c == "\r"; - } - _advance(amount = 0) { - let c = this._source[this._current]; - amount = amount || 0; - amount++; - this._current += amount; - return c; - } - _peekAhead(offset = 0) { - offset = offset || 0; - if (this._current + offset >= this._source.length) - return "\0"; - return this._source[this._current + offset]; - } - _addToken(type) { - const text = this._source.substring(this._start, this._current); - this._tokens.push(new Token(type, text, this._line)); - } -} - -/** - * @author Brendan Duncan / https://github.com/brendan-duncan - */ -/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST). -class WgslParser { - constructor() { - this._tokens = []; - this._current = 0; - this._context = new ParseContext(); - } - parse(tokensOrCode) { - this._initialize(tokensOrCode); - let statements = []; - while (!this._isAtEnd()) { - const statement = this._global_decl_or_directive(); - if (!statement) - break; - statements.push(statement); - } - return statements; - } - _initialize(tokensOrCode) { - if (tokensOrCode) { - if (typeof tokensOrCode == "string") { - const scanner = new WgslScanner(tokensOrCode); - this._tokens = scanner.scanTokens(); - } - else { - this._tokens = tokensOrCode; - } - } - else { - this._tokens = []; - } - this._current = 0; - } - _error(token, message) { - console.error(token, message); - return { - token, - message, - toString: function () { - return `${message}`; - }, - }; - } - _isAtEnd() { - return (this._current >= this._tokens.length || - this._peek().type == TokenTypes.eof); - } - _match(types) { - if (types instanceof TokenType) { - if (this._check(types)) { - this._advance(); - return true; - } - return false; - } - for (let i = 0, l = types.length; i < l; ++i) { - const type = types[i]; - if (this._check(type)) { - this._advance(); - return true; - } - } - return false; - } - _consume(types, message) { - if (this._check(types)) - return this._advance(); - throw this._error(this._peek(), message); - } - _check(types) { - if (this._isAtEnd()) - return false; - const tk = this._peek(); - if (types instanceof Array) { - let t = tk.type; - let index = types.indexOf(t); - return index != -1; - } - return tk.type == types; - } - _advance() { - if (!this._isAtEnd()) - this._current++; - return this._previous(); - } - _peek() { - return this._tokens[this._current]; - } - _previous() { - return this._tokens[this._current - 1]; - } - _global_decl_or_directive() { - // semicolon - // global_variable_decl semicolon - // global_constant_decl semicolon - // type_alias semicolon - // struct_decl - // function_decl - // enable_directive - // Ignore any stand-alone semicolons - while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd()) - ; - if (this._match(TokenTypes.keywords.alias)) { - const type = this._type_alias(); - this._consume(TokenTypes.tokens.semicolon, "Expected ';'"); - return type; - } - if (this._match(TokenTypes.keywords.enable)) { - const enable = this._enable_directive(); - this._consume(TokenTypes.tokens.semicolon, "Expected ';'"); - return enable; - } - // The following statements have an optional attribute* - const attrs = this._attribute(); - if (this._check(TokenTypes.keywords.var)) { - const _var = this._global_variable_decl(); - if (_var != null) - _var.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _var; - } - if (this._check(TokenTypes.keywords.override)) { - const _override = this._override_variable_decl(); - if (_override != null) - _override.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _override; - } - if (this._check(TokenTypes.keywords.let)) { - const _let = this._global_let_decl(); - if (_let != null) - _let.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _let; - } - if (this._check(TokenTypes.keywords.const)) { - const _const = this._global_const_decl(); - if (_const != null) - _const.attributes = attrs; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - return _const; - } - if (this._check(TokenTypes.keywords.struct)) { - const _struct = this._struct_decl(); - if (_struct != null) - _struct.attributes = attrs; - return _struct; - } - if (this._check(TokenTypes.keywords.fn)) { - const _fn = this._function_decl(); - if (_fn != null) - _fn.attributes = attrs; - return _fn; - } - return null; - } - _function_decl() { - // attribute* function_header compound_statement - // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)? - if (!this._match(TokenTypes.keywords.fn)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected function name.").toString(); - this._consume(TokenTypes.tokens.paren_left, "Expected '(' for function arguments."); - const args = []; - if (!this._check(TokenTypes.tokens.paren_right)) { - do { - if (this._check(TokenTypes.tokens.paren_right)) - break; - const argAttrs = this._attribute(); - const name = this._consume(TokenTypes.tokens.ident, "Expected argument name.").toString(); - this._consume(TokenTypes.tokens.colon, "Expected ':' for argument type."); - const typeAttrs = this._attribute(); - const type = this._type_decl(); - if (type != null) { - type.attributes = typeAttrs; - args.push(new Argument(name, type, argAttrs)); - } - } while (this._match(TokenTypes.tokens.comma)); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')' after function arguments."); - let _return = null; - if (this._match(TokenTypes.tokens.arrow)) { - const attrs = this._attribute(); - _return = this._type_decl(); - if (_return != null) - _return.attributes = attrs; - } - const body = this._compound_statement(); - return new Function(name, args, _return, body); - } - _compound_statement() { - // brace_left statement* brace_right - const statements = []; - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for block."); - while (!this._check(TokenTypes.tokens.brace_right)) { - const statement = this._statement(); - if (statement !== null) - statements.push(statement); - } - this._consume(TokenTypes.tokens.brace_right, "Expected '}' for block."); - return statements; - } - _statement() { - // semicolon - // return_statement semicolon - // if_statement - // switch_statement - // loop_statement - // for_statement - // func_call_statement semicolon - // variable_statement semicolon - // break_statement semicolon - // continue_statement semicolon - // continuing_statement compound_statement - // discard semicolon - // assignment_statement semicolon - // compound_statement - // increment_statement semicolon - // decrement_statement semicolon - // static_assert_statement semicolon - // Ignore any stand-alone semicolons - while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd()) - ; - if (this._check(TokenTypes.keywords.if)) - return this._if_statement(); - if (this._check(TokenTypes.keywords.switch)) - return this._switch_statement(); - if (this._check(TokenTypes.keywords.loop)) - return this._loop_statement(); - if (this._check(TokenTypes.keywords.for)) - return this._for_statement(); - if (this._check(TokenTypes.keywords.while)) - return this._while_statement(); - if (this._check(TokenTypes.keywords.continuing)) - return this._continuing_statement(); - if (this._check(TokenTypes.keywords.static_assert)) - return this._static_assert_statement(); - if (this._check(TokenTypes.tokens.brace_left)) - return this._compound_statement(); - let result = null; - if (this._check(TokenTypes.keywords.return)) - result = this._return_statement(); - else if (this._check([ - TokenTypes.keywords.var, - TokenTypes.keywords.let, - TokenTypes.keywords.const, - ])) - result = this._variable_statement(); - else if (this._match(TokenTypes.keywords.discard)) - result = new Discard(); - else if (this._match(TokenTypes.keywords.break)) - result = new Break(); - else if (this._match(TokenTypes.keywords.continue)) - result = new Continue(); - else - result = - this._increment_decrement_statement() || - this._func_call_statement() || - this._assignment_statement(); - if (result != null) - this._consume(TokenTypes.tokens.semicolon, "Expected ';' after statement."); - return result; - } - _static_assert_statement() { - if (!this._match(TokenTypes.keywords.static_assert)) - return null; - let expression = this._optional_paren_expression(); - return new StaticAssert(expression); - } - _while_statement() { - if (!this._match(TokenTypes.keywords.while)) - return null; - let condition = this._optional_paren_expression(); - const block = this._compound_statement(); - return new While(condition, block); - } - _continuing_statement() { - if (!this._match(TokenTypes.keywords.continuing)) - return null; - const block = this._compound_statement(); - return new Continuing(block); - } - _for_statement() { - // for paren_left for_header paren_right compound_statement - if (!this._match(TokenTypes.keywords.for)) - return null; - this._consume(TokenTypes.tokens.paren_left, "Expected '('."); - // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)? - const init = !this._check(TokenTypes.tokens.semicolon) - ? this._for_init() - : null; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - const condition = !this._check(TokenTypes.tokens.semicolon) - ? this._short_circuit_or_expression() - : null; - this._consume(TokenTypes.tokens.semicolon, "Expected ';'."); - const increment = !this._check(TokenTypes.tokens.paren_right) - ? this._for_increment() - : null; - this._consume(TokenTypes.tokens.paren_right, "Expected ')'."); - const body = this._compound_statement(); - return new For(init, condition, increment, body); - } - _for_init() { - // (variable_statement assignment_statement func_call_statement)? - return (this._variable_statement() || - this._func_call_statement() || - this._assignment_statement()); - } - _for_increment() { - // (assignment_statement func_call_statement increment_statement)? - return (this._func_call_statement() || - this._increment_decrement_statement() || - this._assignment_statement()); - } - _variable_statement() { - // variable_decl - // variable_decl equal short_circuit_or_expression - // let (ident variable_ident_decl) equal short_circuit_or_expression - // const (ident variable_ident_decl) equal short_circuit_or_expression - if (this._check(TokenTypes.keywords.var)) { - const _var = this._variable_decl(); - if (_var === null) - throw this._error(this._peek(), "Variable declaration expected."); - let value = null; - if (this._match(TokenTypes.tokens.equal)) - value = this._short_circuit_or_expression(); - return new Var(_var.name, _var.type, _var.storage, _var.access, value); - } - if (this._match(TokenTypes.keywords.let)) { - const name = this._consume(TokenTypes.tokens.ident, "Expected name for let.").toString(); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const typeAttrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = typeAttrs; - } - this._consume(TokenTypes.tokens.equal, "Expected '=' for let."); - const value = this._short_circuit_or_expression(); - return new Let(name, type, null, null, value); - } - if (this._match(TokenTypes.keywords.const)) { - const name = this._consume(TokenTypes.tokens.ident, "Expected name for const.").toString(); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const typeAttrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = typeAttrs; - } - this._consume(TokenTypes.tokens.equal, "Expected '=' for const."); - const value = this._short_circuit_or_expression(); - return new Const(name, type, null, null, value); - } - return null; - } - _increment_decrement_statement() { - const savedPos = this._current; - const _var = this._unary_expression(); - if (_var == null) - return null; - if (!this._check(TokenTypes.increment_operators)) { - this._current = savedPos; - return null; - } - const token = this._consume(TokenTypes.increment_operators, "Expected increment operator"); - return new Increment(token.type === TokenTypes.tokens.plus_plus - ? IncrementOperator.increment - : IncrementOperator.decrement, _var); - } - _assignment_statement() { - // (unary_expression underscore) equal short_circuit_or_expression - let _var = null; - if (this._check(TokenTypes.tokens.brace_right)) { - return null; - } - let isUnderscore = this._match(TokenTypes.tokens.underscore); - if (!isUnderscore) { - _var = this._unary_expression(); - } - if (!isUnderscore && _var == null) { - return null; - } - const type = this._consume(TokenTypes.assignment_operators, "Expected assignment operator."); - const value = this._short_circuit_or_expression(); - return new Assign(AssignOperator.parse(type.lexeme), _var, value); - } - _func_call_statement() { - // ident argument_expression_list - if (!this._check(TokenTypes.tokens.ident)) - return null; - const savedPos = this._current; - const name = this._consume(TokenTypes.tokens.ident, "Expected function name."); - const args = this._argument_expression_list(); - if (args === null) { - this._current = savedPos; - return null; - } - return new Call(name.lexeme, args); - } - _loop_statement() { - // loop brace_left statement* continuing_statement? brace_right - if (!this._match(TokenTypes.keywords.loop)) - return null; - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for loop."); - // statement* - const statements = []; - let statement = this._statement(); - while (statement !== null) { - if (Array.isArray(statement)) { - for (let s of statement) { - statements.push(s); - } - } - else { - statements.push(statement); - } - statement = this._statement(); - } - // continuing_statement: continuing compound_statement - let continuing = null; - if (this._match(TokenTypes.keywords.continuing)) - continuing = this._compound_statement(); - this._consume(TokenTypes.tokens.brace_right, "Expected '}' for loop."); - return new Loop(statements, continuing); - } - _switch_statement() { - // switch optional_paren_expression brace_left switch_body+ brace_right - if (!this._match(TokenTypes.keywords.switch)) - return null; - const condition = this._optional_paren_expression(); - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for switch."); - const body = this._switch_body(); - if (body == null || body.length == 0) - throw this._error(this._previous(), "Expected 'case' or 'default'."); - this._consume(TokenTypes.tokens.brace_right, "Expected '}' for switch."); - return new Switch(condition, body); - } - _switch_body() { - // case case_selectors colon brace_left case_body? brace_right - // default colon brace_left case_body? brace_right - const cases = []; - if (this._match(TokenTypes.keywords.case)) { - const selector = this._case_selectors(); - this._match(TokenTypes.tokens.colon); // colon is optional - this._consume(TokenTypes.tokens.brace_left, "Exected '{' for switch case."); - const body = this._case_body(); - this._consume(TokenTypes.tokens.brace_right, "Exected '}' for switch case."); - cases.push(new Case(selector, body)); - } - if (this._match(TokenTypes.keywords.default)) { - this._match(TokenTypes.tokens.colon); // colon is optional - this._consume(TokenTypes.tokens.brace_left, "Exected '{' for switch default."); - const body = this._case_body(); - this._consume(TokenTypes.tokens.brace_right, "Exected '}' for switch default."); - cases.push(new Default(body)); - } - if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) { - const _cases = this._switch_body(); - cases.push(_cases[0]); - } - return cases; - } - _case_selectors() { - var _a, _b, _c, _d; - // const_literal (comma const_literal)* comma? - const selectors = [ - (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : "", - ]; - while (this._match(TokenTypes.tokens.comma)) { - selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : ""); - } - return selectors; - } - _case_body() { - // statement case_body? - // fallthrough semicolon - if (this._match(TokenTypes.keywords.fallthrough)) { - this._consume(TokenTypes.tokens.semicolon, "Expected ';'"); - return []; - } - let statement = this._statement(); - if (statement == null) - return []; - if (!(statement instanceof Array)) { - statement = [statement]; - } - const nextStatement = this._case_body(); - if (nextStatement.length == 0) - return statement; - return [...statement, nextStatement[0]]; - } - _if_statement() { - // if optional_paren_expression compound_statement elseif_statement? else_statement? - if (!this._match(TokenTypes.keywords.if)) - return null; - const condition = this._optional_paren_expression(); - const block = this._compound_statement(); - let elseif = []; - if (this._match_elseif()) { - elseif = this._elseif_statement(elseif); - } - let _else = null; - if (this._match(TokenTypes.keywords.else)) - _else = this._compound_statement(); - return new If(condition, block, elseif, _else); - } - _match_elseif() { - if (this._tokens[this._current].type === TokenTypes.keywords.else && - this._tokens[this._current + 1].type === TokenTypes.keywords.if) { - this._advance(); - this._advance(); - return true; - } - return false; - } - _elseif_statement(elseif = []) { - // else_if optional_paren_expression compound_statement elseif_statement? - const condition = this._optional_paren_expression(); - const block = this._compound_statement(); - elseif.push(new ElseIf(condition, block)); - if (this._match_elseif()) { - this._elseif_statement(elseif); - } - return elseif; - } - _return_statement() { - // return short_circuit_or_expression? - if (!this._match(TokenTypes.keywords.return)) - return null; - const value = this._short_circuit_or_expression(); - return new Return(value); - } - _short_circuit_or_expression() { - // short_circuit_and_expression - // short_circuit_or_expression or_or short_circuit_and_expression - let expr = this._short_circuit_and_expr(); - while (this._match(TokenTypes.tokens.or_or)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr()); - } - return expr; - } - _short_circuit_and_expr() { - // inclusive_or_expression - // short_circuit_and_expression and_and inclusive_or_expression - let expr = this._inclusive_or_expression(); - while (this._match(TokenTypes.tokens.and_and)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression()); - } - return expr; - } - _inclusive_or_expression() { - // exclusive_or_expression - // inclusive_or_expression or exclusive_or_expression - let expr = this._exclusive_or_expression(); - while (this._match(TokenTypes.tokens.or)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression()); - } - return expr; - } - _exclusive_or_expression() { - // and_expression - // exclusive_or_expression xor and_expression - let expr = this._and_expression(); - while (this._match(TokenTypes.tokens.xor)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression()); - } - return expr; - } - _and_expression() { - // equality_expression - // and_expression and equality_expression - let expr = this._equality_expression(); - while (this._match(TokenTypes.tokens.and)) { - expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression()); - } - return expr; - } - _equality_expression() { - // relational_expression - // relational_expression equal_equal relational_expression - // relational_expression not_equal relational_expression - const expr = this._relational_expression(); - if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) { - return new BinaryOperator(this._previous().toString(), expr, this._relational_expression()); - } - return expr; - } - _relational_expression() { - // shift_expression - // relational_expression less_than shift_expression - // relational_expression greater_than shift_expression - // relational_expression less_than_equal shift_expression - // relational_expression greater_than_equal shift_expression - let expr = this._shift_expression(); - while (this._match([ - TokenTypes.tokens.less_than, - TokenTypes.tokens.greater_than, - TokenTypes.tokens.less_than_equal, - TokenTypes.tokens.greater_than_equal, - ])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression()); - } - return expr; - } - _shift_expression() { - // additive_expression - // shift_expression shift_left additive_expression - // shift_expression shift_right additive_expression - let expr = this._additive_expression(); - while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression()); - } - return expr; - } - _additive_expression() { - // multiplicative_expression - // additive_expression plus multiplicative_expression - // additive_expression minus multiplicative_expression - let expr = this._multiplicative_expression(); - while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression()); - } - return expr; - } - _multiplicative_expression() { - // unary_expression - // multiplicative_expression star unary_expression - // multiplicative_expression forward_slash unary_expression - // multiplicative_expression modulo unary_expression - let expr = this._unary_expression(); - while (this._match([ - TokenTypes.tokens.star, - TokenTypes.tokens.forward_slash, - TokenTypes.tokens.modulo, - ])) { - expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression()); - } - return expr; - } - _unary_expression() { - // singular_expression - // minus unary_expression - // bang unary_expression - // tilde unary_expression - // star unary_expression - // and unary_expression - if (this._match([ - TokenTypes.tokens.minus, - TokenTypes.tokens.bang, - TokenTypes.tokens.tilde, - TokenTypes.tokens.star, - TokenTypes.tokens.and, - ])) { - return new UnaryOperator(this._previous().toString(), this._unary_expression()); - } - return this._singular_expression(); - } - _singular_expression() { - // primary_expression postfix_expression ? - const expr = this._primary_expression(); - const p = this._postfix_expression(); - if (p) - expr.postfix = p; - return expr; - } - _postfix_expression() { - // bracket_left short_circuit_or_expression bracket_right postfix_expression? - if (this._match(TokenTypes.tokens.bracket_left)) { - const expr = this._short_circuit_or_expression(); - this._consume(TokenTypes.tokens.bracket_right, "Expected ']'."); - const p = this._postfix_expression(); - if (p) - expr.postfix = p; - return expr; - } - // period ident postfix_expression? - if (this._match(TokenTypes.tokens.period)) { - const name = this._consume(TokenTypes.tokens.ident, "Expected member name."); - const p = this._postfix_expression(); - const expr = new StringExpr(name.lexeme); - if (p) - expr.postfix = p; - return expr; - } - return null; - } - _getStruct(name) { - if (this._context.aliases.has(name)) { - const alias = this._context.aliases.get(name).type; - return alias; - } - if (this._context.structs.has(name)) { - const struct = this._context.structs.get(name); - return struct; - } - return null; - } - _primary_expression() { - // ident argument_expression_list? - if (this._match(TokenTypes.tokens.ident)) { - const name = this._previous().toString(); - if (this._check(TokenTypes.tokens.paren_left)) { - const args = this._argument_expression_list(); - const struct = this._getStruct(name); - if (struct != null) { - return new CreateExpr(struct, args); - } - return new CallExpr(name, args); - } - if (this._context.constants.has(name)) { - const c = this._context.constants.get(name); - return new ConstExpr(name, c.value); - } - return new VariableExpr(name); - } - // const_literal - if (this._match(TokenTypes.const_literal)) { - return new LiteralExpr(parseFloat(this._previous().toString())); - } - // paren_expression - if (this._check(TokenTypes.tokens.paren_left)) { - return this._paren_expression(); - } - // bitcast less_than type_decl greater_than paren_expression - if (this._match(TokenTypes.keywords.bitcast)) { - this._consume(TokenTypes.tokens.less_than, "Expected '<'."); - const type = this._type_decl(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>'."); - const value = this._paren_expression(); - return new BitcastExpr(type, value); - } - // type_decl argument_expression_list - const type = this._type_decl(); - const args = this._argument_expression_list(); - return new TypecastExpr(type, args); - } - _argument_expression_list() { - // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right - if (!this._match(TokenTypes.tokens.paren_left)) - return null; - const args = []; - do { - if (this._check(TokenTypes.tokens.paren_right)) - break; - const arg = this._short_circuit_or_expression(); - args.push(arg); - } while (this._match(TokenTypes.tokens.comma)); - this._consume(TokenTypes.tokens.paren_right, "Expected ')' for agument list"); - return args; - } - _optional_paren_expression() { - // [paren_left] short_circuit_or_expression [paren_right] - this._match(TokenTypes.tokens.paren_left); - const expr = this._short_circuit_or_expression(); - this._match(TokenTypes.tokens.paren_right); - return new GroupingExpr([expr]); - } - _paren_expression() { - // paren_left short_circuit_or_expression paren_right - this._consume(TokenTypes.tokens.paren_left, "Expected '('."); - const expr = this._short_circuit_or_expression(); - this._consume(TokenTypes.tokens.paren_right, "Expected ')'."); - return new GroupingExpr([expr]); - } - _struct_decl() { - // attribute* struct ident struct_body_decl - if (!this._match(TokenTypes.keywords.struct)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected name for struct.").toString(); - // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right - this._consume(TokenTypes.tokens.brace_left, "Expected '{' for struct body."); - const members = []; - while (!this._check(TokenTypes.tokens.brace_right)) { - // struct_member: attribute* variable_ident_decl - const memberAttrs = this._attribute(); - const memberName = this._consume(TokenTypes.tokens.ident, "Expected variable name.").toString(); - this._consume(TokenTypes.tokens.colon, "Expected ':' for struct member type."); - const typeAttrs = this._attribute(); - const memberType = this._type_decl(); - if (memberType != null) - memberType.attributes = typeAttrs; - if (!this._check(TokenTypes.tokens.brace_right)) - this._consume(TokenTypes.tokens.comma, "Expected ',' for struct member."); - else - this._match(TokenTypes.tokens.comma); // trailing comma optional. - members.push(new Member(memberName, memberType, memberAttrs)); - } - this._consume(TokenTypes.tokens.brace_right, "Expected '}' after struct body."); - const structNode = new Struct(name, members); - this._context.structs.set(name, structNode); - return structNode; - } - _global_variable_decl() { - // attribute* variable_decl (equal const_expression)? - const _var = this._variable_decl(); - if (_var && this._match(TokenTypes.tokens.equal)) - _var.value = this._const_expression(); - return _var; - } - _override_variable_decl() { - // attribute* override_decl (equal const_expression)? - const _override = this._override_decl(); - if (_override && this._match(TokenTypes.tokens.equal)) - _override.value = this._const_expression(); - return _override; - } - _global_const_decl() { - // attribute* const (ident variable_ident_decl) global_const_initializer? - if (!this._match(TokenTypes.keywords.const)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - let value = null; - if (this._match(TokenTypes.tokens.equal)) { - const valueExpr = this._short_circuit_or_expression(); - if (valueExpr instanceof CreateExpr) { - value = valueExpr; - } - else if (valueExpr instanceof ConstExpr && - valueExpr.initializer instanceof CreateExpr) { - value = valueExpr.initializer; - } - else { - try { - const constValue = valueExpr.evaluate(this._context); - value = new LiteralExpr(constValue); - } - catch (_a) { - value = valueExpr; - } - } - } - const c = new Const(name.toString(), type, "", "", value); - this._context.constants.set(c.name, c); - return c; - } - _global_let_decl() { - // attribute* let (ident variable_ident_decl) global_const_initializer? - if (!this._match(TokenTypes.keywords.let)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - let value = null; - if (this._match(TokenTypes.tokens.equal)) { - value = this._const_expression(); - } - return new Let(name.toString(), type, "", "", value); - } - _const_expression() { - // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right - // const_literal - if (this._match(TokenTypes.const_literal)) - return new StringExpr(this._previous().toString()); - const type = this._type_decl(); - this._consume(TokenTypes.tokens.paren_left, "Expected '('."); - let args = []; - while (!this._check(TokenTypes.tokens.paren_right)) { - args.push(this._const_expression()); - if (!this._check(TokenTypes.tokens.comma)) - break; - this._advance(); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')'."); - return new CreateExpr(type, args); - } - _variable_decl() { - // var variable_qualifier? (ident variable_ident_decl) - if (!this._match(TokenTypes.keywords.var)) - return null; - // variable_qualifier: less_than storage_class (comma access_mode)? greater_than - let storage = ""; - let access = ""; - if (this._match(TokenTypes.tokens.less_than)) { - storage = this._consume(TokenTypes.storage_class, "Expected storage_class.").toString(); - if (this._match(TokenTypes.tokens.comma)) - access = this._consume(TokenTypes.access_mode, "Expected access_mode.").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>'."); - } - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - return new Var(name.toString(), type, storage, access, null); - } - _override_decl() { - // override (ident variable_ident_decl) - if (!this._match(TokenTypes.keywords.override)) - return null; - const name = this._consume(TokenTypes.tokens.ident, "Expected variable name"); - let type = null; - if (this._match(TokenTypes.tokens.colon)) { - const attrs = this._attribute(); - type = this._type_decl(); - if (type != null) - type.attributes = attrs; - } - return new Override(name.toString(), type, null); - } - _enable_directive() { - // enable ident semicolon - const name = this._consume(TokenTypes.tokens.ident, "identity expected."); - return new Enable(name.toString()); - } - _type_alias() { - // type ident equal type_decl - const name = this._consume(TokenTypes.tokens.ident, "identity expected."); - this._consume(TokenTypes.tokens.equal, "Expected '=' for type alias."); - let aliasType = this._type_decl(); - if (aliasType === null) { - throw this._error(this._peek(), "Expected Type for Alias."); - } - if (this._context.aliases.has(aliasType.name)) { - aliasType = this._context.aliases.get(aliasType.name).type; - } - const aliasNode = new Alias(name.toString(), aliasType); - this._context.aliases.set(aliasNode.name, aliasNode); - return aliasNode; - } - _type_decl() { - // ident - // bool - // float32 - // int32 - // uint32 - // vec2 less_than type_decl greater_than - // vec3 less_than type_decl greater_than - // vec4 less_than type_decl greater_than - // mat2x2 less_than type_decl greater_than - // mat2x3 less_than type_decl greater_than - // mat2x4 less_than type_decl greater_than - // mat3x2 less_than type_decl greater_than - // mat3x3 less_than type_decl greater_than - // mat3x4 less_than type_decl greater_than - // mat4x2 less_than type_decl greater_than - // mat4x3 less_than type_decl greater_than - // mat4x4 less_than type_decl greater_than - // atomic less_than type_decl greater_than - // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than - // array_type_decl - // texture_sampler_types - if (this._check([ - TokenTypes.tokens.ident, - ...TokenTypes.texel_format, - TokenTypes.keywords.bool, - TokenTypes.keywords.f32, - TokenTypes.keywords.i32, - TokenTypes.keywords.u32, - ])) { - const type = this._advance(); - const typeName = type.toString(); - if (this._context.structs.has(typeName)) { - return this._context.structs.get(typeName); - } - if (this._context.aliases.has(typeName)) { - return this._context.aliases.get(typeName).type; - } - return new Type(type.toString()); - } - // texture_sampler_types - let type = this._texture_sampler_types(); - if (type) - return type; - if (this._check(TokenTypes.template_types)) { - let type = this._advance().toString(); - let format = null; - let access = null; - if (this._match(TokenTypes.tokens.less_than)) { - format = this._type_decl(); - access = null; - if (this._match(TokenTypes.tokens.comma)) - access = this._consume(TokenTypes.access_mode, "Expected access_mode for pointer").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for type."); - } - return new TemplateType(type, format, access); - } - // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than - if (this._match(TokenTypes.keywords.ptr)) { - let pointer = this._previous().toString(); - this._consume(TokenTypes.tokens.less_than, "Expected '<' for pointer."); - const storage = this._consume(TokenTypes.storage_class, "Expected storage_class for pointer"); - this._consume(TokenTypes.tokens.comma, "Expected ',' for pointer."); - const decl = this._type_decl(); - let access = null; - if (this._match(TokenTypes.tokens.comma)) - access = this._consume(TokenTypes.access_mode, "Expected access_mode for pointer").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for pointer."); - return new PointerType(pointer, storage.toString(), decl, access); - } - // The following type_decl's have an optional attribyte_list* - const attrs = this._attribute(); - // attribute* array - // attribute* array less_than type_decl (comma element_count_expression)? greater_than - if (this._match(TokenTypes.keywords.array)) { - let format = null; - let countInt = -1; - const array = this._previous(); - if (this._match(TokenTypes.tokens.less_than)) { - format = this._type_decl(); - if (this._context.aliases.has(format.name)) { - format = this._context.aliases.get(format.name).type; - } - let count = ""; - if (this._match(TokenTypes.tokens.comma)) { - let c = this._shift_expression(); - count = c.evaluate(this._context).toString(); - } - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for array."); - countInt = count ? parseInt(count) : 0; - } - return new ArrayType(array.toString(), attrs, format, countInt); - } - return null; - } - _texture_sampler_types() { - // sampler_type - if (this._match(TokenTypes.sampler_type)) - return new SamplerType(this._previous().toString(), null, null); - // depth_texture_type - if (this._match(TokenTypes.depth_texture_type)) - return new SamplerType(this._previous().toString(), null, null); - // sampled_texture_type less_than type_decl greater_than - // multisampled_texture_type less_than type_decl greater_than - if (this._match(TokenTypes.sampled_texture_type) || - this._match(TokenTypes.multisampled_texture_type)) { - const sampler = this._previous(); - this._consume(TokenTypes.tokens.less_than, "Expected '<' for sampler type."); - const format = this._type_decl(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for sampler type."); - return new SamplerType(sampler.toString(), format, null); - } - // storage_texture_type less_than texel_format comma access_mode greater_than - if (this._match(TokenTypes.storage_texture_type)) { - const sampler = this._previous(); - this._consume(TokenTypes.tokens.less_than, "Expected '<' for sampler type."); - const format = this._consume(TokenTypes.texel_format, "Invalid texel format.").toString(); - this._consume(TokenTypes.tokens.comma, "Expected ',' after texel format."); - const access = this._consume(TokenTypes.access_mode, "Expected access mode for storage texture type.").toString(); - this._consume(TokenTypes.tokens.greater_than, "Expected '>' for sampler type."); - return new SamplerType(sampler.toString(), format, access); - } - return null; - } - _attribute() { - // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right - // attr ident - let attributes = []; - while (this._match(TokenTypes.tokens.attr)) { - const name = this._consume(TokenTypes.attribute_name, "Expected attribute name"); - const attr = new Attribute(name.toString(), null); - if (this._match(TokenTypes.tokens.paren_left)) { - // literal_or_ident - attr.value = this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(); - if (this._check(TokenTypes.tokens.comma)) { - this._advance(); - do { - const v = this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(); - if (!(attr.value instanceof Array)) { - attr.value = [attr.value]; - } - attr.value.push(v); - } while (this._match(TokenTypes.tokens.comma)); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')'"); - } - attributes.push(attr); - } - // Deprecated: - // attr_left (attribute comma)* attribute attr_right - while (this._match(TokenTypes.tokens.attr_left)) { - if (!this._check(TokenTypes.tokens.attr_right)) { - do { - const name = this._consume(TokenTypes.attribute_name, "Expected attribute name"); - const attr = new Attribute(name.toString(), null); - if (this._match(TokenTypes.tokens.paren_left)) { - // literal_or_ident - attr.value = [ - this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(), - ]; - if (this._check(TokenTypes.tokens.comma)) { - this._advance(); - do { - const v = this._consume(TokenTypes.literal_or_ident, "Expected attribute value").toString(); - attr.value.push(v); - } while (this._match(TokenTypes.tokens.comma)); - } - this._consume(TokenTypes.tokens.paren_right, "Expected ')'"); - } - attributes.push(attr); - } while (this._match(TokenTypes.tokens.comma)); - } - // Consume ]] - this._consume(TokenTypes.tokens.attr_right, "Expected ']]' after attribute declarations"); - } - if (attributes.length == 0) - return null; - return attributes; - } -} - -/** - * @author Brendan Duncan / https://github.com/brendan-duncan - */ -class TypeInfo { - constructor(name, attributes) { - this.name = name; - this.attributes = attributes; - this.size = 0; - } - get isArray() { - return false; - } - get isStruct() { - return false; - } - get isTemplate() { - return false; - } -} -class MemberInfo { - constructor(name, type, attributes) { - this.name = name; - this.type = type; - this.attributes = attributes; - this.offset = 0; - this.size = 0; - } - get isArray() { - return this.type.isArray; - } - get isStruct() { - return this.type.isStruct; - } - get isTemplate() { - return this.type.isTemplate; - } - get align() { - return this.type.isStruct ? this.type.align : 0; - } - get members() { - return this.type.isStruct ? this.type.members : null; - } - get format() { - return this.type.isArray - ? this.type.format - : this.type.isTemplate - ? this.type.format - : null; - } - get count() { - return this.type.isArray ? this.type.count : 0; - } - get stride() { - return this.type.isArray ? this.type.stride : this.size; - } -} -class StructInfo extends TypeInfo { - constructor(name, attributes) { - super(name, attributes); - this.members = []; - this.align = 0; - } - get isStruct() { - return true; - } -} -class ArrayInfo extends TypeInfo { - constructor(name, attributes) { - super(name, attributes); - this.count = 0; - this.stride = 0; - } - get isArray() { - return true; - } -} -class TemplateInfo extends TypeInfo { - constructor(name, format, attributes, access) { - super(name, attributes); - this.format = format; - this.access = access; - } - get isTemplate() { - return true; - } -} -var ResourceType; -(function (ResourceType) { - ResourceType[ResourceType["Uniform"] = 0] = "Uniform"; - ResourceType[ResourceType["Storage"] = 1] = "Storage"; - ResourceType[ResourceType["Texture"] = 2] = "Texture"; - ResourceType[ResourceType["Sampler"] = 3] = "Sampler"; - ResourceType[ResourceType["StorageTexture"] = 4] = "StorageTexture"; -})(ResourceType || (ResourceType = {})); -class VariableInfo { - constructor(name, type, group, binding, attributes, resourceType, access) { - this.name = name; - this.type = type; - this.group = group; - this.binding = binding; - this.attributes = attributes; - this.resourceType = resourceType; - this.access = access; - } - get isArray() { - return this.type.isArray; - } - get isStruct() { - return this.type.isStruct; - } - get isTemplate() { - return this.type.isTemplate; - } - get size() { - return this.type.size; - } - get align() { - return this.type.isStruct ? this.type.align : 0; - } - get members() { - return this.type.isStruct ? this.type.members : null; - } - get format() { - return this.type.isArray - ? this.type.format - : this.type.isTemplate - ? this.type.format - : null; - } - get count() { - return this.type.isArray ? this.type.count : 0; - } - get stride() { - return this.type.isArray ? this.type.stride : this.size; - } -} -class AliasInfo { - constructor(name, type) { - this.name = name; - this.type = type; - } -} -class _TypeSize { - constructor(align, size) { - this.align = align; - this.size = size; - } -} -class InputInfo { - constructor(name, type, locationType, location) { - this.name = name; - this.type = type; - this.locationType = locationType; - this.location = location; - this.interpolation = null; - } -} -class OutputInfo { - constructor(name, type, locationType, location) { - this.name = name; - this.type = type; - this.locationType = locationType; - this.location = location; - } -} -class FunctionInfo { - constructor(name, stage = null) { - this.stage = null; - this.inputs = []; - this.outputs = []; - this.resources = []; - this.name = name; - this.stage = stage; - } -} -class EntryFunctions { - constructor() { - this.vertex = []; - this.fragment = []; - this.compute = []; - } -} -class OverrideInfo { - constructor(name, type, attributes, id) { - this.name = name; - this.type = type; - this.attributes = attributes; - this.id = id; - } -} -class _FunctionResources { - constructor(node) { - this.resources = null; - this.node = node; - } -} -class WgslReflect { - constructor(code) { - /// All top-level uniform vars in the shader. - this.uniforms = []; - /// All top-level storage vars in the shader. - this.storage = []; - /// All top-level texture vars in the shader; - this.textures = []; - // All top-level sampler vars in the shader. - this.samplers = []; - /// All top-level type aliases in the shader. - this.aliases = []; - /// All top-level overrides in the shader. - this.overrides = []; - /// All top-level structs in the shader. - this.structs = []; - /// All entry functions in the shader: vertex, fragment, and/or compute. - this.entry = new EntryFunctions(); - this._types = new Map(); - this._functions = new Map(); - if (code) { - this.update(code); - } - } - _isStorageTexture(type) { - return (type.name == "texture_storage_1d" || - type.name == "texture_storage_2d" || - type.name == "texture_storage_2d_array" || - type.name == "texture_storage_3d"); - } - update(code) { - const parser = new WgslParser(); - const ast = parser.parse(code); - for (const node of ast) { - if (node instanceof Function) { - this._functions.set(node.name, new _FunctionResources(node)); - } - } - for (const node of ast) { - if (node instanceof Struct) { - const info = this._getTypeInfo(node, null); - if (info instanceof StructInfo) { - this.structs.push(info); - } - continue; - } - if (node instanceof Alias) { - this.aliases.push(this._getAliasInfo(node)); - continue; - } - if (node instanceof Override) { - const v = node; - const id = this._getAttributeNum(v.attributes, "id", 0); - const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null; - this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id)); - continue; - } - if (this._isUniformVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access); - this.uniforms.push(varInfo); - continue; - } - if (this._isStorageVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const isStorageTexture = this._isStorageTexture(type); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access); - this.storage.push(varInfo); - continue; - } - if (this._isTextureVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const isStorageTexture = this._isStorageTexture(type); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access); - if (isStorageTexture) { - this.storage.push(varInfo); - } - else { - this.textures.push(varInfo); - } - continue; - } - if (this._isSamplerVar(node)) { - const v = node; - const g = this._getAttributeNum(v.attributes, "group", 0); - const b = this._getAttributeNum(v.attributes, "binding", 0); - const type = this._getTypeInfo(v.type, v.attributes); - const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access); - this.samplers.push(varInfo); - continue; - } - if (node instanceof Function) { - const vertexStage = this._getAttribute(node, "vertex"); - const fragmentStage = this._getAttribute(node, "fragment"); - const computeStage = this._getAttribute(node, "compute"); - const stage = vertexStage || fragmentStage || computeStage; - if (stage) { - const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name); - fn.inputs = this._getInputs(node.args); - fn.outputs = this._getOutputs(node.returnType); - fn.resources = this._findResources(node); - this.entry[stage.name].push(fn); - } - continue; - } - } - } - _findResource(name) { - for (const u of this.uniforms) { - if (u.name == name) { - return u; - } - } - for (const s of this.storage) { - if (s.name == name) { - return s; - } - } - for (const t of this.textures) { - if (t.name == name) { - return t; - } - } - for (const s of this.samplers) { - if (s.name == name) { - return s; - } - } - return null; - } - _findResources(fn) { - const resources = []; - const self = this; - const varStack = []; - fn.search((node) => { - if (node instanceof _BlockStart) { - varStack.push({}); - } - else if (node instanceof _BlockEnd) { - varStack.pop(); - } - else if (node instanceof Var) { - if (varStack.length > 0) { - const v = node; - varStack[varStack.length - 1][v.name] = v; - } - } - else if (node instanceof Let) { - if (varStack.length > 0) { - const v = node; - varStack[varStack.length - 1][v.name] = v; - } - } - else if (node instanceof VariableExpr) { - const v = node; - // Check to see if the variable is a local variable before checking to see if it's - // a resource. - if (varStack.length > 0) { - const varInfo = varStack[varStack.length - 1][v.name]; - if (varInfo) { - return; - } - } - const varInfo = self._findResource(v.name); - if (varInfo) { - resources.push(varInfo); - } - } - else if (node instanceof CallExpr) { - const c = node; - const fn = self._functions.get(c.name); - if (fn) { - if (fn.resources === null) { - fn.resources = self._findResources(fn.node); - } - resources.push(...fn.resources); - } - } - }); - return [...new Map(resources.map(r => [r.name, r])).values()]; - } - getBindGroups() { - const groups = []; - function _makeRoom(group, binding) { - if (group >= groups.length) - groups.length = group + 1; - if (groups[group] === undefined) - groups[group] = []; - if (binding >= groups[group].length) - groups[group].length = binding + 1; - } - for (const u of this.uniforms) { - _makeRoom(u.group, u.binding); - const group = groups[u.group]; - group[u.binding] = u; - } - for (const u of this.storage) { - _makeRoom(u.group, u.binding); - const group = groups[u.group]; - group[u.binding] = u; - } - for (const t of this.textures) { - _makeRoom(t.group, t.binding); - const group = groups[t.group]; - group[t.binding] = t; - } - for (const t of this.samplers) { - _makeRoom(t.group, t.binding); - const group = groups[t.group]; - group[t.binding] = t; - } - return groups; - } - _getOutputs(type, outputs = undefined) { - if (outputs === undefined) - outputs = []; - if (type instanceof Struct) { - this._getStructOutputs(type, outputs); - } - else { - const output = this._getOutputInfo(type); - if (output !== null) - outputs.push(output); - } - return outputs; - } - _getStructOutputs(struct, outputs) { - for (const m of struct.members) { - if (m.type instanceof Struct) { - this._getStructOutputs(m.type, outputs); - } - else { - const location = this._getAttribute(m, "location") || this._getAttribute(m, "builtin"); - if (location !== null) { - const typeInfo = this._getTypeInfo(m.type, m.type.attributes); - const locationValue = this._parseInt(location.value); - const info = new OutputInfo(m.name, typeInfo, location.name, locationValue); - outputs.push(info); - } - } - } - } - _getOutputInfo(type) { - const location = this._getAttribute(type, "location") || - this._getAttribute(type, "builtin"); - if (location !== null) { - const typeInfo = this._getTypeInfo(type, type.attributes); - const locationValue = this._parseInt(location.value); - const info = new OutputInfo("", typeInfo, location.name, locationValue); - return info; - } - return null; - } - _getInputs(args, inputs = undefined) { - if (inputs === undefined) - inputs = []; - for (const arg of args) { - if (arg.type instanceof Struct) { - this._getStructInputs(arg.type, inputs); - } - else { - const input = this._getInputInfo(arg); - if (input !== null) - inputs.push(input); - } - } - return inputs; - } - _getStructInputs(struct, inputs) { - for (const m of struct.members) { - if (m.type instanceof Struct) { - this._getStructInputs(m.type, inputs); - } - else { - const input = this._getInputInfo(m); - if (input !== null) - inputs.push(input); - } - } - } - _getInputInfo(node) { - const location = this._getAttribute(node, "location") || - this._getAttribute(node, "builtin"); - if (location !== null) { - const interpolation = this._getAttribute(node, "interpolation"); - const type = this._getTypeInfo(node.type, node.attributes); - const locationValue = this._parseInt(location.value); - const info = new InputInfo(node.name, type, location.name, locationValue); - if (interpolation !== null) { - info.interpolation = this._parseString(interpolation.value); - } - return info; - } - return null; - } - _parseString(s) { - if (s instanceof Array) { - s = s[0]; - } - return s; - } - _parseInt(s) { - if (s instanceof Array) { - s = s[0]; - } - const n = parseInt(s); - return isNaN(n) ? s : n; - } - _getAlias(name) { - for (const a of this.aliases) { - if (a.name == name) - return a.type; - } - return null; - } - _getAliasInfo(node) { - return new AliasInfo(node.name, this._getTypeInfo(node.type, null)); - } - _getTypeInfo(type, attributes) { - if (this._types.has(type)) { - return this._types.get(type); - } - if (type instanceof ArrayType) { - const a = type; - const t = this._getTypeInfo(a.format, a.attributes); - const info = new ArrayInfo(a.name, attributes); - info.format = t; - info.count = a.count; - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - if (type instanceof Struct) { - const s = type; - const info = new StructInfo(s.name, attributes); - for (const m of s.members) { - const t = this._getTypeInfo(m.type, m.attributes); - info.members.push(new MemberInfo(m.name, t, m.attributes)); - } - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - if (type instanceof SamplerType) { - const s = type; - const formatIsType = s.format instanceof Type; - const format = s.format - ? formatIsType - ? this._getTypeInfo(s.format, null) - : new TypeInfo(s.format, null) - : null; - const info = new TemplateInfo(s.name, format, attributes, s.access); - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - if (type instanceof TemplateType) { - const t = type; - const format = t.format ? this._getTypeInfo(t.format, null) : null; - const info = new TemplateInfo(t.name, format, attributes, t.access); - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - const info = new TypeInfo(type.name, attributes); - this._types.set(type, info); - this._updateTypeInfo(info); - return info; - } - _updateTypeInfo(type) { - var _a, _b; - const typeSize = this._getTypeSize(type); - type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0; - if (type instanceof ArrayInfo) { - const formatInfo = this._getTypeSize(type["format"]); - type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0; - this._updateTypeInfo(type["format"]); - } - if (type instanceof StructInfo) { - this._updateStructInfo(type); - } - } - _updateStructInfo(struct) { - var _a; - let offset = 0; - let lastSize = 0; - let lastOffset = 0; - let structAlign = 0; - for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) { - const member = struct.members[mi]; - const sizeInfo = this._getTypeSize(member); - if (!sizeInfo) - continue; - (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type; - const align = sizeInfo.align; - const size = sizeInfo.size; - offset = this._roundUp(align, offset + lastSize); - lastSize = size; - lastOffset = offset; - structAlign = Math.max(structAlign, align); - member.offset = offset; - member.size = size; - this._updateTypeInfo(member.type); - } - struct.size = this._roundUp(structAlign, lastOffset + lastSize); - struct.align = structAlign; - } - _getTypeSize(type) { - var _a; - if (type === null || type === undefined) - return null; - const explicitSize = this._getAttributeNum(type.attributes, "size", 0); - const explicitAlign = this._getAttributeNum(type.attributes, "align", 0); - if (type instanceof MemberInfo) - type = type.type; - if (type instanceof TypeInfo) { - const alias = this._getAlias(type.name); - if (alias !== null) { - type = alias; - } - } - { - const info = WgslReflect._typeInfo[type.name]; - if (info !== undefined) { - const divisor = type["format"] === "f16" ? 2 : 1; - return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor)); - } - } - { - const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)]; - if (info) { - const divisor = type.name[type.name.length - 1] === "h" ? 2 : 1; - return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor)); - } - } - if (type instanceof ArrayInfo) { - let arrayType = type; - let align = 8; - let size = 8; - // Type AlignOf(T) Sizeof(T) - // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) - // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime) - // - // @stride(Q) - // array AlignOf(E) N * Q - // - // @stride(Q) - // array AlignOf(E) Nruntime * Q - //const E = type.format.name; - const E = this._getTypeSize(arrayType.format); - if (E !== null) { - size = E.size; - align = E.align; - } - const N = arrayType.count; - 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)); - size = N * stride; - if (explicitSize) - size = explicitSize; - return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size)); - } - if (type instanceof StructInfo) { - let align = 0; - let size = 0; - // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN)) - // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L)) - // Where L is the last member of the structure - let offset = 0; - let lastSize = 0; - let lastOffset = 0; - for (const m of type.members) { - const mi = this._getTypeSize(m.type); - if (mi !== null) { - align = Math.max(mi.align, align); - offset = this._roundUp(mi.align, offset + lastSize); - lastSize = mi.size; - lastOffset = offset; - } - } - size = this._roundUp(align, lastOffset + lastSize); - return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size)); - } - return null; - } - _isUniformVar(node) { - return node instanceof Var && node.storage == "uniform"; - } - _isStorageVar(node) { - return node instanceof Var && node.storage == "storage"; - } - _isTextureVar(node) { - return (node instanceof Var && - node.type !== null && - WgslReflect._textureTypes.indexOf(node.type.name) != -1); - } - _isSamplerVar(node) { - return (node instanceof Var && - node.type !== null && - WgslReflect._samplerTypes.indexOf(node.type.name) != -1); - } - _getAttribute(node, name) { - const obj = node; - if (!obj || !obj["attributes"]) - return null; - const attrs = obj["attributes"]; - for (let a of attrs) { - if (a.name == name) - return a; - } - return null; - } - _getAttributeNum(attributes, name, defaultValue) { - if (attributes === null) - return defaultValue; - for (let a of attributes) { - if (a.name == name) { - let v = a !== null && a.value !== null ? a.value : defaultValue; - if (v instanceof Array) { - v = v[0]; - } - if (typeof v === "number") { - return v; - } - if (typeof v === "string") { - return parseInt(v); - } - return defaultValue; - } - } - return defaultValue; - } - _roundUp(k, n) { - return Math.ceil(n / k) * k; - } -} -// Type AlignOf(T) Sizeof(T) -// i32, u32, or f32 4 4 -// atomic 4 4 -// vec2 8 8 -// vec3 16 12 -// vec4 16 16 -// mat2x2 8 16 -// mat3x2 8 24 -// mat4x2 8 32 -// mat2x3 16 32 -// mat3x3 16 48 -// mat4x3 16 64 -// mat2x4 16 32 -// mat3x4 16 48 -// mat4x4 16 64 -WgslReflect._typeInfo = { - f16: { align: 2, size: 2 }, - i32: { align: 4, size: 4 }, - u32: { align: 4, size: 4 }, - f32: { align: 4, size: 4 }, - atomic: { align: 4, size: 4 }, - vec2: { align: 8, size: 8 }, - vec3: { align: 16, size: 12 }, - vec4: { align: 16, size: 16 }, - mat2x2: { align: 8, size: 16 }, - mat3x2: { align: 8, size: 24 }, - mat4x2: { align: 8, size: 32 }, - mat2x3: { align: 16, size: 32 }, - mat3x3: { align: 16, size: 48 }, - mat4x3: { align: 16, size: 64 }, - mat2x4: { align: 16, size: 32 }, - mat3x4: { align: 16, size: 48 }, - mat4x4: { align: 16, size: 64 }, -}; -WgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => { - return t.name; -}); -WgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => { - return t.name; -}); - -function getEntryPointForStage(defs, stage, stageFlags) { - const { entryPoint: entryPointName } = stage; - if (entryPointName) { - const ep = defs.entryPoints[entryPointName]; - return (ep && ep.stage === stageFlags) ? ep : undefined; - } - return Object.values(defs.entryPoints).filter(ep => ep.stage === stageFlags)[0]; -} -function getStageResources(defs, stage, stageFlags) { - if (!stage) { - return []; - } - const entryPoint = getEntryPointForStage(defs, stage, stageFlags); - return entryPoint?.resources || []; -} -const byBinding = (a, b) => Math.sign(a.binding - b.binding); -/** - * Gets GPUBindGroupLayoutDescriptors for the given pipeline. - * - * Important: Assumes you pipeline is valid (it doesn't check for errors). - * - * Note: In WebGPU some layouts must be specified manually. For example an unfiltered-float - * sampler can not be derived since it is unknown at compile time pipeline creation time - * which texture you'll use. - * - * MAINTENANCE_TODO: Add example - * - * @param defs ShaderDataDefinitions or an array of ShaderDataDefinitions as - * returned from @link {makeShaderDataDefinitions}. If an array more than 1 - * definition it's assumed the vertex shader is in the first and the fragment - * shader in the second. - * @param desc A PipelineDescriptor. You should be able to pass in the same object you passed - * to `createRenderPipeline` or `createComputePipeline`. - * @returns An array of GPUBindGroupLayoutDescriptors which you can pass, one at a time, to - * `createBindGroupLayout`. Note: the array will be sparse if there are gaps in group - * numbers. Note: Each GPUBindGroupLayoutDescriptor.entries will be sorted by binding. - */ -function makeBindGroupLayoutDescriptors(defs, desc) { - defs = Array.isArray(defs) ? defs : [defs]; - const resources = [ - ...getStageResources(defs[0], desc.vertex, GPUShaderStage.VERTEX), - ...getStageResources(defs[defs.length - 1], desc.fragment, GPUShaderStage.FRAGMENT), - ...getStageResources(defs[0], desc.compute, GPUShaderStage.COMPUTE), - ]; - const bindGroupLayoutDescriptorsByGroupByBinding = []; - for (const resource of resources) { - const bindingsToBindGroupEntry = bindGroupLayoutDescriptorsByGroupByBinding[resource.group] || new Map(); - bindGroupLayoutDescriptorsByGroupByBinding[resource.group] = bindingsToBindGroupEntry; - // Should we error here if the 2 don't match? - const entry = bindingsToBindGroupEntry.get(resource.entry.binding); - bindingsToBindGroupEntry.set(resource.entry.binding, { - ...resource.entry, - visibility: resource.entry.visibility | (entry?.visibility || 0), - }); - } - return bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({ entries: [...v.values()].sort(byBinding) })); -} -function getNamedVariables(reflect, variables) { - return Object.fromEntries(variables.map(v => { - const typeDefinition = addType(reflect, v.type, 0); - return [ - v.name, - { - typeDefinition, - group: v.group, - binding: v.binding, - size: typeDefinition.size, - }, - ]; - })); -} -function makeStructDefinition(reflect, structInfo, offset) { - // StructDefinition - const fields = Object.fromEntries(structInfo.members.map(m => { - return [ - m.name, - { - offset: m.offset, - type: addType(reflect, m.type, 0), - }, - ]; - })); - return { - fields, - size: structInfo.size, - offset, - }; -} -function getTextureSampleType(type) { - if (type.name.includes('depth')) { - return 'depth'; - } - // unfiltered-float - switch (type.format?.name) { - case 'f32': return 'float'; - case 'i32': return 'sint'; - case 'u32': return 'uint'; - default: - throw new Error('unknown texture sample type'); - } -} -function getViewDimension(type) { - if (type.name.includes('2d_array')) { - return '2d-array'; - } - if (type.name.includes('cube_array')) { - return 'cube-array'; - } - if (type.name.includes('3d')) { - return '3d'; - } - if (type.name.includes('1d')) { - return '1d'; - } - if (type.name.includes('cube')) { - return 'cube'; - } - return '2d'; -} -function getStorageTextureAccess(type) { - switch (type.access) { - case 'read': return 'read-only'; - case 'write': return 'write-only'; - case 'read_write': return 'read-write'; - default: - throw new Error('unknonw storage texture access'); - } -} -function getSamplerType(type) { - // "non-filtering" can only be specified manually. - return type.name.endsWith('_comparison') - ? 'comparison' - : 'filtering'; -} -function getBindGroupLayoutEntry(resource, visibility) { - const { binding, access, type } = resource; - switch (resource.resourceType) { - case ResourceType.Uniform: - return { - binding, - visibility, - buffer: {}, - }; - case ResourceType.Storage: - return { - binding, - visibility, - buffer: { - type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage', - }, - }; - case ResourceType.Texture: { - if (type.name === 'texture_external') { - return { - binding, - visibility, - externalTexture: {}, - }; - } - const multisampled = type.name.includes('multisampled'); - return { - binding, - visibility, - texture: { - sampleType: getTextureSampleType(type), - viewDimension: getViewDimension(type), - multisampled, - }, - }; - } - case ResourceType.Sampler: - return { - binding, - visibility, - sampler: { - type: getSamplerType(type), - }, - }; - case ResourceType.StorageTexture: - return { - binding, - visibility, - storageTexture: { - access: getStorageTextureAccess(type), - format: type.format.name, - viewDimension: getViewDimension(type), - }, - }; - default: - throw new Error('unknown resource type'); - } -} -function addEntryPoints(funcInfos, stage) { - const entryPoints = {}; - for (const info of funcInfos) { - entryPoints[info.name] = { - stage, - resources: info.resources.map(resource => { - const { name, group } = resource; - return { - name, - group, - entry: getBindGroupLayoutEntry(resource, stage), - }; - }), - }; - } - return entryPoints; -} -/** - * Given a WGSL shader, returns data definitions for structures, - * uniforms, and storage buffers - * - * Example: - * - * ```js - * const code = ` - * struct MyStruct { - * color: vec4f, - * brightness: f32, - * kernel: array, - * }; - * @group(0) @binding(0) var myUniforms: MyUniforms; - * `; - * const defs = makeShaderDataDefinitions(code); - * const myUniformValues = makeStructuredView(defs.uniforms.myUniforms); - * - * myUniformValues.set({ - * color: [1, 0, 1, 1], - * brightness: 0.8, - * kernel: [ - * 1, 0, -1, - * 2, 0, -2, - * 1, 0, -1, - * ], - * }); - * device.queue.writeBuffer(uniformBuffer, 0, myUniformValues.arrayBuffer); - * ``` - * - * @param code WGSL shader. Note: it is not required for this to be a complete shader - * @returns definitions of the structures by name. Useful for passing to {@link makeStructuredView} - */ -function makeShaderDataDefinitions(code) { - const reflect = new WgslReflect(code); - const structs = Object.fromEntries(reflect.structs.map(structInfo => { - return [structInfo.name, makeStructDefinition(reflect, structInfo, 0)]; - })); - const uniforms = getNamedVariables(reflect, reflect.uniforms); - const storages = getNamedVariables(reflect, reflect.storage); - const entryPoints = { - ...addEntryPoints(reflect.entry.vertex, GPUShaderStage.VERTEX), - ...addEntryPoints(reflect.entry.fragment, GPUShaderStage.FRAGMENT), - ...addEntryPoints(reflect.entry.compute, GPUShaderStage.COMPUTE), - }; - return { - structs, - storages, - uniforms, - entryPoints, - }; -} -function assert(cond, msg = '') { - if (!cond) { - throw new Error(msg); - } -} -/* - write down what I want for a given type - - struct VSUniforms { - foo: u32, - }; - @group(4) @binding(1) var uni1: f32; - @group(3) @binding(2) var uni2: array; - @group(2) @binding(3) var uni3: VSUniforms; - @group(1) @binding(4) var uni4: array; - - uni1: { - type: 'f32', - numElements: undefined - }, - uni2: { - type: 'array', - elementType: 'f32' - numElements: 5, - }, - uni3: { - type: 'struct', - fields: { - foo: { - type: 'f32', - numElements: undefined - } - }, - }, - uni4: { - type: 'array', - elementType: - fields: { - foo: { - type: 'f32', - numElements: undefined - } - }, - fields: { - foo: { - type: 'f32', - numElements: undefined - } - }, - ... - ] - - */ -function addType(reflect, typeInfo, offset) { - if (typeInfo.isArray) { - assert(!typeInfo.isStruct, 'struct array is invalid'); - assert(!typeInfo.isStruct, 'template array is invalid'); - const arrayInfo = typeInfo; - // ArrayDefinition - return { - size: arrayInfo.size, - elementType: addType(reflect, arrayInfo.format, offset), - numElements: arrayInfo.count, - }; - } - else if (typeInfo.isStruct) { - assert(!typeInfo.isTemplate, 'template struct is invalid'); - const structInfo = typeInfo; - return makeStructDefinition(reflect, structInfo, offset); - } - else { - // template is like vec4 or mat4x4 - const asTemplateInfo = typeInfo; - const type = typeInfo.isTemplate - ? `${asTemplateInfo.name}<${asTemplateInfo.format.name}>` - : typeInfo.name; - // IntrinsicDefinition - return { - size: typeInfo.size, - type, - }; - } -} - -function guessTextureBindingViewDimensionForTexture(texture) { - switch (texture.dimension) { - case '1d': - return '1d'; - case '3d': - return '3d'; - default: // to shut up TS - case '2d': - return texture.depthOrArrayLayers > 1 ? '2d-array' : '2d'; - } -} -function normalizeGPUExtent3Dict(size) { - return [size.width, size.height || 1, size.depthOrArrayLayers || 1]; -} -/** - * Converts a `GPUExtent3D` into an array of numbers - * - * `GPUExtent3D` has two forms `[width, height?, depth?]` or - * `{width: number, height?: number, depthOrArrayLayers?: number}` - * - * You pass one of those in here and it returns an array of 3 numbers - * so that your code doesn't have to deal with multiple forms. - * - * @param size - * @returns an array of 3 numbers, [width, height, depthOrArrayLayers] - */ -function normalizeGPUExtent3D(size) { - return (Array.isArray(size) || isTypedArray(size)) - ? [...size, 1, 1].slice(0, 3) - : normalizeGPUExtent3Dict(size); -} -/** - * Given a GPUExtent3D returns the number of mip levels needed - * - * @param size - * @returns number of mip levels needed for the given size - */ -function numMipLevels(size, dimension) { - const sizes = normalizeGPUExtent3D(size); - const maxSize = Math.max(...sizes.slice(0, dimension === '3d' ? 3 : 2)); - return 1 + Math.log2(maxSize) | 0; -} -function getMipmapGenerationWGSL(textureBindingViewDimension) { - let textureSnippet; - let sampleSnippet; - switch (textureBindingViewDimension) { - case '2d': - textureSnippet = 'texture_2d'; - sampleSnippet = 'textureSample(ourTexture, ourSampler, fsInput.texcoord)'; - break; - case '2d-array': - textureSnippet = 'texture_2d_array'; - sampleSnippet = ` - textureSample( - ourTexture, - ourSampler, - fsInput.texcoord, - uni.layer)`; - break; - case 'cube': - textureSnippet = 'texture_cube'; - sampleSnippet = ` - textureSample( - ourTexture, - ourSampler, - faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1))`; - break; - case 'cube-array': - textureSnippet = 'texture_cube_array'; - sampleSnippet = ` - textureSample( - ourTexture, - ourSampler, - faceMat[uni.layer] * vec3f(fract(fsInput.texcoord), 1), uni.layer)`; - break; - default: - throw new Error(`unsupported view: ${textureBindingViewDimension}`); - } - return ` - const faceMat = array( - mat3x3f( 0, 0, -2, 0, -2, 0, 1, 1, 1), // pos-x - mat3x3f( 0, 0, 2, 0, -2, 0, -1, 1, -1), // neg-x - mat3x3f( 2, 0, 0, 0, 0, 2, -1, 1, -1), // pos-y - mat3x3f( 2, 0, 0, 0, 0, -2, -1, -1, 1), // neg-y - mat3x3f( 2, 0, 0, 0, -2, 0, -1, 1, 1), // pos-z - mat3x3f(-2, 0, 0, 0, -2, 0, 1, 1, -1)); // neg-z - - struct VSOutput { - @builtin(position) position: vec4f, - @location(0) texcoord: vec2f, - }; - - @vertex fn vs( - @builtin(vertex_index) vertexIndex : u32 - ) -> VSOutput { - var pos = array( - vec2f(-1.0, -1.0), - vec2f(-1.0, 3.0), - vec2f( 3.0, -1.0), - ); - - var vsOutput: VSOutput; - let xy = pos[vertexIndex]; - vsOutput.position = vec4f(xy, 0.0, 1.0); - vsOutput.texcoord = xy * vec2f(0.5, -0.5) + vec2f(0.5); - return vsOutput; - } - - struct Uniforms { - layer: u32, - }; - - @group(0) @binding(0) var ourSampler: sampler; - @group(0) @binding(1) var ourTexture: ${textureSnippet}; - @group(0) @binding(2) var uni: Uniforms; - - @fragment fn fs(fsInput: VSOutput) -> @location(0) vec4f { - _ = uni.layer; // make sure this is used so all pipelines have the same bindings - return ${sampleSnippet}; - } - `; -} -// Use a WeakMap so the device can be destroyed and/or lost -const byDevice = new WeakMap(); -/** - * Generates mip levels from level 0 to the last mip for an existing texture - * - * The texture must have been created with TEXTURE_BINDING and RENDER_ATTACHMENT - * and been created with mip levels - * - * @param device A GPUDevice - * @param texture The texture to create mips for - * @param textureBindingViewDimension This is only needed in compatibility mode - * and it is only needed when the texture is going to be used as a cube map. - */ -function generateMipmap(device, texture, textureBindingViewDimension) { - let perDeviceInfo = byDevice.get(device); - if (!perDeviceInfo) { - perDeviceInfo = { - pipelineByFormatAndView: {}, - moduleByViewType: {}, - }; - byDevice.set(device, perDeviceInfo); - } - let { sampler, uniformBuffer, uniformValues, } = perDeviceInfo; - const { pipelineByFormatAndView, moduleByViewType, } = perDeviceInfo; - textureBindingViewDimension = textureBindingViewDimension || guessTextureBindingViewDimensionForTexture(texture); - let module = moduleByViewType[textureBindingViewDimension]; - if (!module) { - const code = getMipmapGenerationWGSL(textureBindingViewDimension); - module = device.createShaderModule({ - label: `mip level generation for ${textureBindingViewDimension}`, - code, - }); - moduleByViewType[textureBindingViewDimension] = module; - } - if (!sampler) { - sampler = device.createSampler({ - minFilter: 'linear', - magFilter: 'linear', - }); - uniformBuffer = device.createBuffer({ - size: 16, - usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, - }); - uniformValues = new Uint32Array(1); - Object.assign(perDeviceInfo, { sampler, uniformBuffer, uniformValues }); - } - const id = `${texture.format}.${textureBindingViewDimension}`; - if (!pipelineByFormatAndView[id]) { - pipelineByFormatAndView[id] = device.createRenderPipeline({ - label: `mip level generator pipeline for ${textureBindingViewDimension}`, - layout: 'auto', - vertex: { - module, - entryPoint: 'vs', - }, - fragment: { - module, - entryPoint: 'fs', - targets: [{ format: texture.format }], - }, - }); - } - const pipeline = pipelineByFormatAndView[id]; - for (let baseMipLevel = 1; baseMipLevel < texture.mipLevelCount; ++baseMipLevel) { - for (let baseArrayLayer = 0; baseArrayLayer < texture.depthOrArrayLayers; ++baseArrayLayer) { - uniformValues[0] = baseArrayLayer; - device.queue.writeBuffer(uniformBuffer, 0, uniformValues); - const bindGroup = device.createBindGroup({ - layout: pipeline.getBindGroupLayout(0), - entries: [ - { binding: 0, resource: sampler }, - { - binding: 1, - resource: texture.createView({ - dimension: textureBindingViewDimension, - baseMipLevel: baseMipLevel - 1, - mipLevelCount: 1, - }), - }, - { binding: 2, resource: { buffer: uniformBuffer } }, - ], - }); - const renderPassDescriptor = { - label: 'mip gen renderPass', - colorAttachments: [ - { - view: texture.createView({ - dimension: '2d', - baseMipLevel, - mipLevelCount: 1, - baseArrayLayer, - arrayLayerCount: 1, - }), - loadOp: 'clear', - storeOp: 'store', - }, - ], - }; - const encoder = device.createCommandEncoder({ - label: 'mip gen encoder', - }); - const pass = encoder.beginRenderPass(renderPassDescriptor); - pass.setPipeline(pipeline); - pass.setBindGroup(0, bindGroup); - pass.draw(3); - pass.end(); - const commandBuffer = encoder.finish(); - device.queue.submit([commandBuffer]); - } - } -} - -const kTypedArrayToAttribFormat = new Map([ - [Int8Array, { formats: ['sint8', 'snorm8'], defaultForType: 1 }], - [Uint8Array, { formats: ['uint8', 'unorm8'], defaultForType: 1 }], - [Int16Array, { formats: ['sint16', 'snorm16'], defaultForType: 1 }], - [Uint16Array, { formats: ['uint16', 'unorm16'], defaultForType: 1 }], - [Int32Array, { formats: ['sint32', 'snorm32'], defaultForType: 0 }], - [Uint32Array, { formats: ['uint32', 'unorm32'], defaultForType: 0 }], - [Float32Array, { formats: ['float32', 'float32'], defaultForType: 0 }], - // TODO: Add Float16Array -]); -const kVertexFormatPrefixToType = new Map([...kTypedArrayToAttribFormat.entries()].map(([Type, { formats: [s1, s2] }]) => [[s1, Type], [s2, Type]]).flat()); -function isIndices(name) { - return name === "indices"; -} -function makeTypedArrayFromArrayUnion(array, name) { - if (isTypedArray(array)) { - return array; - } - let asFullSpec = array; - if (isTypedArray(asFullSpec.data)) { - return asFullSpec.data; - } - if (Array.isArray(array) || typeof array === 'number') { - asFullSpec = { - data: array, - }; - } - let Type = asFullSpec.type; - if (!Type) { - if (isIndices(name)) { - Type = Uint32Array; - } - else { - Type = Float32Array; - } - } - return new Type(asFullSpec.data); // ugh! -} -function getArray(array) { - const arr = array.length ? array : array.data; - return arr; -} -const kNameToNumComponents = [ - { re: /coord|texture|uv/i, numComponents: 2 }, - { re: /color|colour/i, numComponents: 4 }, -]; -function guessNumComponentsFromNameImpl(name) { - for (const { re, numComponents } of kNameToNumComponents) { - if (re.test(name)) { - return numComponents; - } - } - return 3; -} -function guessNumComponentsFromName(name, length) { - const numComponents = guessNumComponentsFromNameImpl(name); - if (length % numComponents > 0) { - 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.`); - } - return numComponents; -} -function getNumComponents(array, arrayName) { - return array.numComponents || guessNumComponentsFromName(arrayName, getArray(array).length); -} -const kVertexFormatRE = /(\w+)(?:x(\d))$/; -function numComponentsAndTypeFromVertexFormat(format) { - const m = kVertexFormatRE.exec(format); - const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1]; - return { - Type: kVertexFormatPrefixToType.get(prefix), - numComponents, - }; -} -function createTypedArrayOfSameType(typedArray, arrayBuffer) { - const Ctor = Object.getPrototypeOf(typedArray).constructor; - return new Ctor(arrayBuffer); -} -/** - * Given a set of named arrays, generates an array `GPUBufferLayout`s - * - * Examples: - * - * ```js - * const arrays = { - * 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], - * 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], - * 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], - * }; - * - * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays); - * ``` - * - * results in `bufferLayouts` being - * - * ```js - * [ - * { - * stepMode: 'vertex', - * arrayStride: 32, - * attributes: [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ], - * }, - * ] - * ``` - * - * and `typedArrays` being - * - * ``` - * [ - * someFloat32Array0, - * someFloat32Array1, - * someFloat32Array2, - * ] - * ``` - * - * See {@link Arrays} for details on the various types of arrays. - * - * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made) - */ -function createBufferLayoutsFromArrays(arrays, options = {}) { - const interleave = options.interleave === undefined ? true : options.interleave; - const stepMode = options.stepMode || 'vertex'; - const shaderLocations = options.shaderLocation - ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation]) - : [0]; - let currentOffset = 0; - const bufferLayouts = []; - const attributes = []; - const typedArrays = []; - Object.keys(arrays) - .filter(arrayName => !isIndices(arrayName)) - .forEach(arrayName => { - const array = arrays[arrayName]; - const data = makeTypedArrayFromArrayUnion(array, arrayName); - const totalNumComponents = getNumComponents(array, arrayName); - // if totalNumComponents > 4 then we clearly need to split this into multiple - // attributes - // (a) <= 4 doesn't mean don't split and - // (b) how to split? We could divide by 4 and if it's not even then divide by 3 - // as a guess? - // 5 is error? or 1x4 + 1x1? - // 6 is 2x3 - // 7 is error? or 1x4 + 1x3? - // 8 is 2x4 - // 9 is 3x3 - // 10 is error? or 2x4 + 1x2? - // 11 is error? or 2x4 + 1x3? - // 12 is 3x4 or 4x3? - // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1? - // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2? - // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3? - // 16 is 4x4 - const by4 = totalNumComponents / 4; - const by3 = totalNumComponents / 3; - const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4); - for (let component = 0; component < totalNumComponents; component += step) { - const numComponents = Math.min(step, totalNumComponents - component); - const offset = currentOffset; - currentOffset += numComponents * data.BYTES_PER_ELEMENT; - const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor); - const normalize = array.normalize; - const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0); - const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}`; - // TODO: cleanup with generator? - const shaderLocation = shaderLocations.shift(); - if (shaderLocations.length === 0) { - shaderLocations.push(shaderLocation + 1); - } - attributes.push({ - offset, - format, - shaderLocation, - }); - typedArrays.push({ - data, - offset: component, - stride: totalNumComponents, - }); - } - if (!interleave) { - bufferLayouts.push({ - stepMode, - arrayStride: currentOffset, - attributes: attributes.slice(), - }); - currentOffset = 0; - attributes.length = 0; - } - }); - if (attributes.length) { - bufferLayouts.push({ - stepMode, - arrayStride: currentOffset, - attributes: attributes, - }); - } - return { - bufferLayouts, - typedArrays, - }; -} -function getTypedArrayWithOffsetAndStride(ta, numComponents) { - return (isTypedArray(ta) - ? { data: ta, offset: 0, stride: numComponents } - : ta); -} -/** - * Given an array of `GPUVertexAttribute`s and a corresponding array - * of TypedArrays, interleaves the contents of the typed arrays - * into the given ArrayBuffer - * - * example: - * - * ```js - * const attributes: GPUVertexAttribute[] = [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ]; - * const typedArrays = [ - * 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]), - * 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]), - * 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]), - * ]; - * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv - * const arrayBuffer = new ArrayBuffer(arrayStride * 24) - * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer) - * ``` - * - * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved - * - * See {@link Arrays} for details on the various types of arrays. - * - * Note: You can generate `attributes` and `typedArrays` above by calling - * {@link createBufferLayoutsFromArrays} - */ -function interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer) { - const views = new Map(); - const getView = (typedArray) => { - const Ctor = Object.getPrototypeOf(typedArray).constructor; - const view = views.get(Ctor); - if (view) { - return view; - } - const newView = new Ctor(arrayBuffer); - views.set(Ctor, newView); - return newView; - }; - attributes.forEach((attribute, ndx) => { - const { offset, format } = attribute; - const { numComponents } = numComponentsAndTypeFromVertexFormat(format); - const { data, offset: srcOffset, stride, } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents); - const view = getView(data); - for (let i = 0; i < data.length; i += stride) { - const ndx = i / stride; - const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT; - const srcOff = i + srcOffset; - const s = data.subarray(srcOff, srcOff + numComponents); - view.set(s, dstOffset); - } - }); -} -/** - * Given arrays, create buffers, fills the buffers with data if provided, optionally - * interleaves the data (the default). - * - * Example: - * - * ```js - * const { - * buffers, - * bufferLayouts, - * indexBuffer, - * indexFormat, - * numElements, - * } = createBuffersAndAttributesFromArrays(device, { - * 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], - * 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], - * 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], - * 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], - * }); - * ``` - * - * Where `bufferLayouts` will be - * - * ```js - * [ - * { - * stepMode: 'vertex', - * arrayStride: 32, - * attributes: [ - * { shaderLocation: 0, offset: 0, format: 'float32x3' }, - * { shaderLocation: 1, offset: 12, format: 'float32x3' }, - * { shaderLocation: 2, offset: 24, format: 'float32x2' }, - * ], - * }, - * ] - * ``` - * - * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX` - * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX` - * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices) - * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no - * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays}) - * - * See {@link Arrays} for details on the various types of arrays. - * Also see the cube and instancing examples. - */ -function createBuffersAndAttributesFromArrays(device, arrays, options = {}) { - const usage = (options.usage || 0); - const { bufferLayouts, typedArrays, } = createBufferLayoutsFromArrays(arrays, options); - const buffers = []; - let numElements = -1; - let bufferNdx = 0; - for (const { attributes, arrayStride } of bufferLayouts) { - const attribs = attributes; - const attrib0 = attribs[0]; - const { numComponents } = numComponentsAndTypeFromVertexFormat(attrib0.format); - const { data: data0, stride, } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents); - if (numElements < 0) { - numElements = data0.length / stride; - } - const size = arrayStride * numElements; - const buffer = device.createBuffer({ - usage: usage | GPUBufferUsage.VERTEX, - size, - mappedAtCreation: true, - }); - const arrayBuffer = buffer.getMappedRange(); - if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) { - const view = createTypedArrayOfSameType(data0, arrayBuffer); - view.set(data0); - } - else { - interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer); - } - buffer.unmap(); - buffers.push(buffer); - bufferNdx += attribs.length; - } - const buffersAndAttributes = { - numElements, - bufferLayouts, - buffers, - }; - const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName)); - if (indicesEntry) { - const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices'); - const indexBuffer = device.createBuffer({ - size: indices.byteLength, - usage: GPUBufferUsage.INDEX | usage, - mappedAtCreation: true, - }); - const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange()); - dst.set(indices); - indexBuffer.unmap(); - buffersAndAttributes.indexBuffer = indexBuffer; - buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32'; - buffersAndAttributes.numElements = indices.length; - } - return buffersAndAttributes; -} -/** - * Calls `passEncoder.setVertexBuffer` and optionally `passEncoder.setIndexBuffer` - * for the buffers specified in `buffersAndAttributes`. - * - * This is extremely simple function. It is equivalent to - * - * ```js - * buffersAndAttributes.buffers.forEach((buffer, i) => { - * passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer); - * }); -* - * if (buffersAndAttributes.indexBuffer) { - * passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat!); - * } - * ``` - * - * It exists solely for simple cases. If you have a complex case, call the passEncoder - * yourself as appropriate. - * - * @param passEncoder a render pass encoder - * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays} - * @param firstVertexBufferIndex The first vertex buffer index. default = 0. - */ -function setVertexAndIndexBuffers(passEncoder, buffersAndAttributes, firstVertexBufferIndex = 0) { - buffersAndAttributes.buffers.forEach((buffer, i) => { - passEncoder.setVertexBuffer(firstVertexBufferIndex + i, buffer); - }); - if (buffersAndAttributes.indexBuffer) { - passEncoder.setIndexBuffer(buffersAndAttributes.indexBuffer, buffersAndAttributes.indexFormat); - } -} -/** - * Calls {@link setVertexAndIndexBuffers} and then calls either `draw` or `drawIndexed` - * - * This is an extremely simple function. See {@link setVertexAndIndexBuffers}. - * If you need something more complex, call pass encoder functions yourself as appropriate. - * - * @param passEncoder a render pass encoder - * @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays} - */ -function drawArrays(passEncoder, buffersAndAttributes) { - setVertexAndIndexBuffers(passEncoder, buffersAndAttributes); - if (buffersAndAttributes.indexBuffer) { - passEncoder.drawIndexed(buffersAndAttributes.numElements); - } - else { - passEncoder.draw(buffersAndAttributes.numElements); - } -} - -function isTextureData(source) { - const src = source; - return isTypedArray(src.data) || Array.isArray(src.data); -} -function isTextureRawDataSource(source) { - return isTypedArray(source) || Array.isArray(source) || isTextureData(source); -} -function toTypedArray(v, format) { - if (isTypedArray(v)) { - return v; - } - const { Type } = getTextureFormatInfo(format); - return new Type(v); -} -function guessDimensions(width, height, numElements, dimension = '2d') { - if (numElements % 1 !== 0) { - throw new Error("can't guess dimensions"); - } - if (!width && !height) { - const size = Math.sqrt(numElements / (dimension === 'cube' ? 6 : 1)); - if (size % 1 === 0) { - width = size; - height = size; - } - else { - width = numElements; - height = 1; - } - } - else if (!height) { - height = numElements / width; - if (height % 1) { - throw new Error("can't guess dimensions"); - } - } - else if (!width) { - width = numElements / height; - if (width % 1) { - throw new Error("can't guess dimensions"); - } - } - const depth = numElements / width / height; - if (depth % 1) { - throw new Error("can't guess dimensions"); - } - return [width, height, depth]; -} -function textureViewDimensionToDimension(viewDimension) { - switch (viewDimension) { - case '1d': return '1d'; - case '3d': return '3d'; - default: return '2d'; - } -} -const kFormatToTypedArray = { - '8snorm': Int8Array, - '8unorm': Uint8Array, - '8sint': Int8Array, - '8uint': Uint8Array, - '16snorm': Int16Array, - '16unorm': Uint16Array, - '16sint': Int16Array, - '16uint': Uint16Array, - '32snorm': Int32Array, - '32unorm': Uint32Array, - '32sint': Int32Array, - '32uint': Uint32Array, - '16float': Uint16Array, - '32float': Float32Array, -}; -const kTextureFormatRE = /([a-z]+)(\d+)([a-z]+)/; -function getTextureFormatInfo(format) { - // this is a hack! It will only work for common formats - const [, channels, bits, typeName] = kTextureFormatRE.exec(format); - // TODO: if the regex fails, use table for other formats? - const numChannels = channels.length; - const bytesPerChannel = parseInt(bits) / 8; - const bytesPerElement = numChannels * bytesPerChannel; - const Type = kFormatToTypedArray[`${bits}${typeName}`]; - return { - channels, - numChannels, - bytesPerChannel, - bytesPerElement, - Type, - }; -} -/** - * Gets the size of a mipLevel. Returns an array of 3 numbers [width, height, depthOrArrayLayers] - */ -function getSizeForMipFromTexture(texture, mipLevel) { - return [ - texture.width, - texture.height, - texture.depthOrArrayLayers, - ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel))); -} -/** - * Uploads Data to a texture - */ -function uploadDataToTexture(device, texture, source, options) { - const data = toTypedArray(source.data || source, texture.format); - const mipLevel = 0; - const size = getSizeForMipFromTexture(texture, mipLevel); - const { bytesPerElement } = getTextureFormatInfo(texture.format); - const origin = options.origin || [0, 0, 0]; - device.queue.writeTexture({ texture, origin }, data, { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] }, size); -} -/** - * Copies a an array of "sources" (Video, Canvas, OffscreenCanvas, ImageBitmap) - * to a texture and then optionally generates mip levels - */ -function copySourcesToTexture(device, texture, sources, options = {}) { - sources.forEach((source, layer) => { - const origin = [0, 0, layer + (options.baseArrayLayer || 0)]; - if (isTextureRawDataSource(source)) { - uploadDataToTexture(device, texture, source, { origin }); - } - else { - const s = source; - const { flipY, premultipliedAlpha, colorSpace } = options; - device.queue.copyExternalImageToTexture({ source: s, flipY, }, { texture, premultipliedAlpha, colorSpace, origin }, getSizeFromSource(s, options)); - } - }); - if (texture.mipLevelCount > 1) { - generateMipmap(device, texture); - } -} -/** - * Copies a "source" (Video, Canvas, OffscreenCanvas, ImageBitmap) - * to a texture and then optionally generates mip levels - */ -function copySourceToTexture(device, texture, source, options = {}) { - copySourcesToTexture(device, texture, [source], options); -} -/** - * Gets the size from a source. This is to smooth out the fact that different - * sources have a different way to get their size. - */ -function getSizeFromSource(source, options) { - if (source instanceof HTMLVideoElement) { - return [source.videoWidth, source.videoHeight, 1]; - } - else { - const maybeHasWidthAndHeight = source; - const { width, height } = maybeHasWidthAndHeight; - if (width > 0 && height > 0 && !isTextureRawDataSource(source)) { - // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData - return [width, height, 1]; - } - const format = options.format || 'rgba8unorm'; - const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format); - const data = isTypedArray(source) || Array.isArray(source) - ? source - : source.data; - const numBytes = isTypedArray(data) - ? data.byteLength - : (data.length * bytesPerChannel); - const numElements = numBytes / bytesPerElement; - return guessDimensions(width, height, numElements); - } -} -/** - * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap) - * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount - * then it will automatically make the correct number of mip levels. - * - * Example: - * - * ```js - * const texture = createTextureFromSource( - * device, - * [ - * someCanvasOrVideoOrImageImageBitmap0, - * someCanvasOrVideoOrImageImageBitmap1, - * ], - * { - * usage: GPUTextureUsage.TEXTURE_BINDING | - * GPUTextureUsage.RENDER_ATTACHMENT | - * GPUTextureUsage.COPY_DST, - * mips: true, - * } - * ); - * ``` - */ -function createTextureFromSources(device, sources, options = {}) { - // NOTE: We assume all the sizes are the same. If they are not you'll get - // an error. - const size = getSizeFromSource(sources[0], options); - size[2] = size[2] > 1 ? size[2] : sources.length; - const texture = device.createTexture({ - dimension: textureViewDimensionToDimension(options.dimension), - format: options.format || 'rgba8unorm', - mipLevelCount: options.mipLevelCount - ? options.mipLevelCount - : options.mips ? numMipLevels(size) : 1, - size, - usage: (options.usage ?? 0) | - GPUTextureUsage.TEXTURE_BINDING | - GPUTextureUsage.COPY_DST | - GPUTextureUsage.RENDER_ATTACHMENT, - }); - copySourcesToTexture(device, texture, sources, options); - return texture; -} -/** - * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap) - * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount - * then it will automatically make the correct number of mip levels. - * - * Example: - * - * ```js - * const texture = createTextureFromSource( - * device, - * someCanvasOrVideoOrImageImageBitmap, - * { - * usage: GPUTextureUsage.TEXTURE_BINDING | - * GPUTextureUsage.RENDER_ATTACHMENT | - * GPUTextureUsage.COPY_DST, - * mips: true, - * } - * ); - * ``` - */ -function createTextureFromSource(device, source, options = {}) { - return createTextureFromSources(device, [source], options); -} -/** - * Load an ImageBitmap - * @param url - * @param options - * @returns the loaded ImageBitmap - */ -async function loadImageBitmap(url, options = {}) { - const res = await fetch(url); - const blob = await res.blob(); - const opt = { - ...options, - ...(options.colorSpaceConversion !== undefined && { colorSpaceConversion: 'none' }), - }; - return await createImageBitmap(blob, opt); -} -/** - * Load images and create a texture from them, optionally generating mip levels - * - * Assumes all the urls reference images of the same size. - * - * Example: - * - * ```js - * const texture = await createTextureFromImage( - * device, - * [ - * 'https://someimage1.url', - * 'https://someimage2.url', - * ], - * { - * mips: true, - * flipY: true, - * }, - * ); - * ``` - */ -async function createTextureFromImages(device, urls, options = {}) { - // TODO: start once we've loaded one? - // We need at least 1 to know the size of the texture to create - const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url))); - return createTextureFromSources(device, imgBitmaps, options); -} -/** - * Load an image and create a texture from it, optionally generating mip levels - * - * Example: - * - * ```js - * const texture = await createTextureFromImage(device, 'https://someimage.url', { - * mips: true, - * flipY: true, - * }); - * ``` - */ -async function createTextureFromImage(device, url, options = {}) { - return createTextureFromImages(device, [url], options); -} - -/* - * Copyright 2023 Gregg Tavares - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -/** - * A class to provide `push` on a typed array. - * - * example: - * - * ```js - * const positions = new TypedArrayWrapper(new Float32Array(300), 3); - * positions.push(1, 2, 3); // add a position - * positions.push([4, 5, 6]); // add a position - * positions.push(new Float32Array(6)); // add 2 positions - * const data = positions.typedArray; - * ``` - */ -class TypedArrayWrapper { - typedArray; - cursor = 0; - numComponents; - constructor(arr, numComponents) { - this.typedArray = arr; - this.numComponents = numComponents; - } - get numElements() { - return this.typedArray.length / this.numComponents; - } - push(...data) { - for (const value of data) { - if (Array.isArray(value) || isTypedArray(value)) { - const asArray = data; - this.typedArray.set(asArray, this.cursor); - this.cursor += asArray.length; - } - else { - this.typedArray[this.cursor++] = value; - } - } - } - reset(index = 0) { - this.cursor = index; - } -} -/** - * creates a typed array with a `push` function attached - * so that you can easily *push* values. - * - * `push` can take multiple arguments. If an argument is an array each element - * of the array will be added to the typed array. - * - * Example: - * - * const array = createAugmentedTypedArray(3, 2, Float32Array); - * array.push(1, 2, 3); - * array.push([4, 5, 6]); - * // array now contains [1, 2, 3, 4, 5, 6] - * - * Also has `numComponents` and `numElements` properties. - * - * @param numComponents number of components - * @param numElements number of elements. The total size of the array will be `numComponents * numElements`. - * @param Type A constructor for the type. Default = `Float32Array`. - */ -function createAugmentedTypedArray(numComponents, numElements, Type) { - return new TypedArrayWrapper(new Type(numComponents * numElements), numComponents); -} -/** - * Creates XY quad vertices - * - * The default with no parameters will return a 2x2 quad with values from -1 to +1. - * If you want a unit quad with that goes from 0 to 1 you'd call it with - * - * createXYQuadVertices(1, 0.5, 0.5); - * - * If you want a unit quad centered above 0,0 you'd call it with - * - * primitives.createXYQuadVertices(1, 0, 0.5); - * - * @param params - * @param params.size the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 - * @param params.xOffset the amount to offset the quad in X. Default = 0 - * @param params.yOffset the amount to offset the quad in Y. Default = 0 - * @return the created XY Quad vertices - */ -function createXYQuadVertices({ size: inSize = 2, xOffset = 0, yOffset = 0 } = {}) { - const size = inSize * 0.5; - return { - position: { - numComponents: 2, - data: [ - xOffset + -1 * size, yOffset + -1 * size, - xOffset + 1 * size, yOffset + -1 * size, - xOffset + -1 * size, yOffset + 1 * size, - xOffset + 1 * size, yOffset + 1 * size, - ], - }, - normal: [ - 0, 0, 1, - 0, 0, 1, - 0, 0, 1, - 0, 0, 1, - ], - texcoord: [ - 0, 0, - 1, 0, - 0, 1, - 1, 1, - ], - indices: [0, 1, 2, 2, 1, 3], - }; -} -/** - * Creates XZ plane vertices. - * - * The created plane has position, normal, and texcoord data - * - * @param params - * @param params.width Width of the plane. Default = 1 - * @param params.depth Depth of the plane. Default = 1 - * @param params.subdivisionsWidth Number of steps across the plane. Default = 1 - * @param params.subdivisionsDepth Number of steps down the plane. Default = 1 - * @return The created plane vertices. - */ -function createPlaneVertices({ width = 1, depth = 1, subdivisionsWidth = 1, subdivisionsDepth = 1, } = {}) { - const numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - for (let z = 0; z <= subdivisionsDepth; z++) { - for (let x = 0; x <= subdivisionsWidth; x++) { - const u = x / subdivisionsWidth; - const v = z / subdivisionsDepth; - positions.push(width * u - width * 0.5, 0, depth * v - depth * 0.5); - normals.push(0, 1, 0); - texcoords.push(u, v); - } - } - const numVertsAcross = subdivisionsWidth + 1; - const indices = createAugmentedTypedArray(3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array); - for (let z = 0; z < subdivisionsDepth; z++) { // eslint-disable-line - for (let x = 0; x < subdivisionsWidth; x++) { // eslint-disable-line - // Make triangle 1 of quad. - indices.push((z + 0) * numVertsAcross + x, (z + 1) * numVertsAcross + x, (z + 0) * numVertsAcross + x + 1); - // Make triangle 2 of quad. - indices.push((z + 1) * numVertsAcross + x, (z + 1) * numVertsAcross + x + 1, (z + 0) * numVertsAcross + x + 1); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} -/** - * Creates sphere vertices. - * - * The created sphere has position, normal, and texcoord data - * - * @param params - * @param params.radius radius of the sphere. Default = 1 - * @param params.subdivisionsAxis number of steps around the sphere. Default = 24 - * @param params.subdivisionsHeight number of vertically on the sphere. Default = 12 - * @param params.startLatitudeInRadians where to start the - * top of the sphere. Default = 0 - * @param params.endLatitudeInRadians Where to end the - * bottom of the sphere. Default = π - * @param params.startLongitudeInRadians where to start - * wrapping the sphere. Default = 0 - * @param params.endLongitudeInRadians where to end - * wrapping the sphere. Default = 2π - * @return The created sphere vertices. - */ -function createSphereVertices({ radius = 1, subdivisionsAxis = 24, subdivisionsHeight = 12, startLatitudeInRadians = 0, endLatitudeInRadians = Math.PI, startLongitudeInRadians = 0, endLongitudeInRadians = Math.PI * 2, } = {}) { - if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) { - throw new Error('subdivisionAxis and subdivisionHeight must be > 0'); - } - const latRange = endLatitudeInRadians - startLatitudeInRadians; - const longRange = endLongitudeInRadians - startLongitudeInRadians; - // We are going to generate our sphere by iterating through its - // spherical coordinates and generating 2 triangles for each quad on a - // ring of the sphere. - const numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - // Generate the individual vertices in our vertex buffer. - for (let y = 0; y <= subdivisionsHeight; y++) { - for (let x = 0; x <= subdivisionsAxis; x++) { - // Generate a vertex based on its spherical coordinates - const u = x / subdivisionsAxis; - const v = y / subdivisionsHeight; - const theta = longRange * u + startLongitudeInRadians; - const phi = latRange * v + startLatitudeInRadians; - const sinTheta = Math.sin(theta); - const cosTheta = Math.cos(theta); - const sinPhi = Math.sin(phi); - const cosPhi = Math.cos(phi); - const ux = cosTheta * sinPhi; - const uy = cosPhi; - const uz = sinTheta * sinPhi; - positions.push(radius * ux, radius * uy, radius * uz); - normals.push(ux, uy, uz); - texcoords.push(1 - u, v); - } - } - const numVertsAround = subdivisionsAxis + 1; - const indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array); - for (let x = 0; x < subdivisionsAxis; x++) { // eslint-disable-line - for (let y = 0; y < subdivisionsHeight; y++) { // eslint-disable-line - // Make triangle 1 of quad. - indices.push((y + 0) * numVertsAround + x, (y + 0) * numVertsAround + x + 1, (y + 1) * numVertsAround + x); - // Make triangle 2 of quad. - indices.push((y + 1) * numVertsAround + x, (y + 0) * numVertsAround + x + 1, (y + 1) * numVertsAround + x + 1); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} -/** - * Array of the indices of corners of each face of a cube. - */ -const CUBE_FACE_INDICES = [ - [3, 7, 5, 1], - [6, 2, 0, 4], - [6, 7, 3, 2], - [0, 1, 5, 4], - [7, 6, 4, 5], - [2, 3, 1, 0], // back -]; -/** - * Creates the vertices and indices for a cube. - * - * The cube is created around the origin. (-size / 2, size / 2). - * - * @param params - * @param params.size width, height and depth of the cube. Default = 1 - * @return The created vertices. - */ -function createCubeVertices({ size = 1 } = {}) { - const k = size / 2; - const cornerVertices = [ - [-k, -k, -k], - [+k, -k, -k], - [-k, +k, -k], - [+k, +k, -k], - [-k, -k, +k], - [+k, -k, +k], - [-k, +k, +k], - [+k, +k, +k], - ]; - const faceNormals = [ - [+1, +0, +0], - [-1, +0, +0], - [+0, +1, +0], - [+0, -1, +0], - [+0, +0, +1], - [+0, +0, -1], - ]; - const uvCoords = [ - [1, 0], - [0, 0], - [0, 1], - [1, 1], - ]; - const numVertices = 6 * 4; - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array); - for (let f = 0; f < 6; ++f) { - const faceIndices = CUBE_FACE_INDICES[f]; - for (let v = 0; v < 4; ++v) { - const position = cornerVertices[faceIndices[v]]; - const normal = faceNormals[f]; - const uv = uvCoords[v]; - // Each face needs all four vertices because the normals and texture - // coordinates are not all the same. - positions.push(...position); - normals.push(...normal); - texcoords.push(...uv); - } - // Two triangles make a square face. - const offset = 4 * f; - indices.push(offset + 0, offset + 1, offset + 2); - indices.push(offset + 0, offset + 2, offset + 3); - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} -/** - * Creates vertices for a truncated cone, which is like a cylinder - * except that it has different top and bottom radii. A truncated cone - * can also be used to create cylinders and regular cones. The - * truncated cone will be created centered about the origin, with the - * y axis as its vertical axis. . - * - * @param bottomRadius Bottom radius of truncated cone. Default = 1 - * @param topRadius Top radius of truncated cone. Default = 0 - * @param height Height of truncated cone. Default = 1 - * @param radialSubdivisions The number of subdivisions around the - * truncated cone. Default = 24 - * @param verticalSubdivisions The number of subdivisions down the - * truncated cone. Default = 1 - * @param topCap Create top cap. Default = true. - * @param bottomCap Create bottom cap. Default = true. - * @return The created cone vertices. - */ -function createTruncatedConeVertices({ bottomRadius = 1, topRadius = 0, height = 1, radialSubdivisions = 24, verticalSubdivisions = 1, topCap = true, bottomCap = true, } = {}) { - if (radialSubdivisions < 3) { - throw new Error('radialSubdivisions must be 3 or greater'); - } - if (verticalSubdivisions < 1) { - throw new Error('verticalSubdivisions must be 1 or greater'); - } - const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0); - const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array); - const vertsAroundEdge = radialSubdivisions + 1; - // The slant of the cone is constant across its surface - const slant = Math.atan2(bottomRadius - topRadius, height); - const cosSlant = Math.cos(slant); - const sinSlant = Math.sin(slant); - const start = topCap ? -2 : 0; - const end = verticalSubdivisions + (bottomCap ? 2 : 0); - for (let yy = start; yy <= end; ++yy) { - let v = yy / verticalSubdivisions; - let y = height * v; - let ringRadius; - if (yy < 0) { - y = 0; - v = 1; - ringRadius = bottomRadius; - } - else if (yy > verticalSubdivisions) { - y = height; - v = 1; - ringRadius = topRadius; - } - else { - ringRadius = bottomRadius + - (topRadius - bottomRadius) * (yy / verticalSubdivisions); - } - if (yy === -2 || yy === verticalSubdivisions + 2) { - ringRadius = 0; - v = 0; - } - y -= height / 2; - for (let ii = 0; ii < vertsAroundEdge; ++ii) { - const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions); - const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions); - positions.push(sin * ringRadius, y, cos * ringRadius); - if (yy < 0) { - normals.push(0, -1, 0); - } - else if (yy > verticalSubdivisions) { - normals.push(0, 1, 0); - } - else if (ringRadius === 0.0) { - normals.push(0, 0, 0); - } - else { - normals.push(sin * cosSlant, sinSlant, cos * cosSlant); - } - texcoords.push((ii / radialSubdivisions), 1 - v); - } - } - for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line - if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) { - continue; - } - for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line - indices.push(vertsAroundEdge * (yy + 0) + 0 + ii, vertsAroundEdge * (yy + 0) + 1 + ii, vertsAroundEdge * (yy + 1) + 1 + ii); - indices.push(vertsAroundEdge * (yy + 0) + 0 + ii, vertsAroundEdge * (yy + 1) + 1 + ii, vertsAroundEdge * (yy + 1) + 0 + ii); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} -/** - * Expands RLE data - * @param rleData data in format of run-length, x, y, z, run-length, x, y, z - * @param padding value to add each entry with. - * @return the expanded rleData - */ -function expandRLEData(rleData, padding = []) { - padding = padding || []; - const data = []; - for (let ii = 0; ii < rleData.length; ii += 4) { - const runLength = rleData[ii]; - const element = rleData.slice(ii + 1, ii + 4); - element.push(...padding); - for (let jj = 0; jj < runLength; ++jj) { - data.push(...element); - } - } - return data; -} -/** - * Creates 3D 'F' vertices. - * An 'F' is useful because you can easily tell which way it is oriented. - * The created 'F' has position, normal, texcoord, and color arrays. - * - * @return The created vertices. - */ -function create3DFVertices() { - const positions = [ - // left column front - 0, 0, 0, - 0, 150, 0, - 30, 0, 0, - 0, 150, 0, - 30, 150, 0, - 30, 0, 0, - // top rung front - 30, 0, 0, - 30, 30, 0, - 100, 0, 0, - 30, 30, 0, - 100, 30, 0, - 100, 0, 0, - // middle rung front - 30, 60, 0, - 30, 90, 0, - 67, 60, 0, - 30, 90, 0, - 67, 90, 0, - 67, 60, 0, - // left column back - 0, 0, 30, - 30, 0, 30, - 0, 150, 30, - 0, 150, 30, - 30, 0, 30, - 30, 150, 30, - // top rung back - 30, 0, 30, - 100, 0, 30, - 30, 30, 30, - 30, 30, 30, - 100, 0, 30, - 100, 30, 30, - // middle rung back - 30, 60, 30, - 67, 60, 30, - 30, 90, 30, - 30, 90, 30, - 67, 60, 30, - 67, 90, 30, - // top - 0, 0, 0, - 100, 0, 0, - 100, 0, 30, - 0, 0, 0, - 100, 0, 30, - 0, 0, 30, - // top rung front - 100, 0, 0, - 100, 30, 0, - 100, 30, 30, - 100, 0, 0, - 100, 30, 30, - 100, 0, 30, - // under top rung - 30, 30, 0, - 30, 30, 30, - 100, 30, 30, - 30, 30, 0, - 100, 30, 30, - 100, 30, 0, - // between top rung and middle - 30, 30, 0, - 30, 60, 30, - 30, 30, 30, - 30, 30, 0, - 30, 60, 0, - 30, 60, 30, - // top of middle rung - 30, 60, 0, - 67, 60, 30, - 30, 60, 30, - 30, 60, 0, - 67, 60, 0, - 67, 60, 30, - // front of middle rung - 67, 60, 0, - 67, 90, 30, - 67, 60, 30, - 67, 60, 0, - 67, 90, 0, - 67, 90, 30, - // bottom of middle rung. - 30, 90, 0, - 30, 90, 30, - 67, 90, 30, - 30, 90, 0, - 67, 90, 30, - 67, 90, 0, - // front of bottom - 30, 90, 0, - 30, 150, 30, - 30, 90, 30, - 30, 90, 0, - 30, 150, 0, - 30, 150, 30, - // bottom - 0, 150, 0, - 0, 150, 30, - 30, 150, 30, - 0, 150, 0, - 30, 150, 30, - 30, 150, 0, - // left side - 0, 0, 0, - 0, 0, 30, - 0, 150, 30, - 0, 0, 0, - 0, 150, 30, - 0, 150, 0, - ]; - const texcoords = [ - // left column front - 0.22, 0.19, - 0.22, 0.79, - 0.34, 0.19, - 0.22, 0.79, - 0.34, 0.79, - 0.34, 0.19, - // top rung front - 0.34, 0.19, - 0.34, 0.31, - 0.62, 0.19, - 0.34, 0.31, - 0.62, 0.31, - 0.62, 0.19, - // middle rung front - 0.34, 0.43, - 0.34, 0.55, - 0.49, 0.43, - 0.34, 0.55, - 0.49, 0.55, - 0.49, 0.43, - // left column back - 0, 0, - 1, 0, - 0, 1, - 0, 1, - 1, 0, - 1, 1, - // top rung back - 0, 0, - 1, 0, - 0, 1, - 0, 1, - 1, 0, - 1, 1, - // middle rung back - 0, 0, - 1, 0, - 0, 1, - 0, 1, - 1, 0, - 1, 1, - // top - 0, 0, - 1, 0, - 1, 1, - 0, 0, - 1, 1, - 0, 1, - // top rung front - 0, 0, - 1, 0, - 1, 1, - 0, 0, - 1, 1, - 0, 1, - // under top rung - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - // between top rung and middle - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // top of middle rung - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // front of middle rung - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // bottom of middle rung. - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - // front of bottom - 0, 0, - 1, 1, - 0, 1, - 0, 0, - 1, 0, - 1, 1, - // bottom - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - // left side - 0, 0, - 0, 1, - 1, 1, - 0, 0, - 1, 1, - 1, 0, - ]; - const normals = expandRLEData([ - // left column front - // top rung front - // middle rung front - 18, 0, 0, 1, - // left column back - // top rung back - // middle rung back - 18, 0, 0, -1, - // top - 6, 0, 1, 0, - // top rung front - 6, 1, 0, 0, - // under top rung - 6, 0, -1, 0, - // between top rung and middle - 6, 1, 0, 0, - // top of middle rung - 6, 0, 1, 0, - // front of middle rung - 6, 1, 0, 0, - // bottom of middle rung. - 6, 0, -1, 0, - // front of bottom - 6, 1, 0, 0, - // bottom - 6, 0, -1, 0, - // left side - 6, -1, 0, 0, - ]); - const colors = expandRLEData([ - // left column front - // top rung front - // middle rung front - 18, 200, 70, 120, - // left column back - // top rung back - // middle rung back - 18, 80, 70, 200, - // top - 6, 70, 200, 210, - // top rung front - 6, 200, 200, 70, - // under top rung - 6, 210, 100, 70, - // between top rung and middle - 6, 210, 160, 70, - // top of middle rung - 6, 70, 180, 210, - // front of middle rung - 6, 100, 70, 210, - // bottom of middle rung. - 6, 76, 210, 100, - // front of bottom - 6, 140, 210, 80, - // bottom - 6, 90, 130, 110, - // left side - 6, 160, 160, 220, - ], [255]); - const numVerts = positions.length / 3; - const arrays = { - position: createAugmentedTypedArray(3, numVerts, Float32Array), - texcoord: createAugmentedTypedArray(2, numVerts, Float32Array), - normal: createAugmentedTypedArray(3, numVerts, Float32Array), - color: createAugmentedTypedArray(4, numVerts, Uint8Array), - indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array), - }; - arrays.position.push(positions); - arrays.texcoord.push(texcoords); - arrays.normal.push(normals); - arrays.color.push(colors); - for (let ii = 0; ii < numVerts; ++ii) { - arrays.indices.push(ii); - } - return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray])); -} -/** - * Creates crescent vertices. - * - * @param params - * @param params.verticalRadius The vertical radius of the crescent. Default = 2 - * @param params.outerRadius The outer radius of the crescent. Default = 1 - * @param params.innerRadius The inner radius of the crescent. Default = 0 - * @param params.thickness The thickness of the crescent. Default = 1 - * @param params.subdivisionsDown number of steps around the crescent. Default = 12 - * @param params.startOffset Where to start arc. Default 0. Default = 0 - * @param params.endOffset Where to end arg. Default 1. Default = 1 - * @return The created vertices. - */ -function createCrescentVertices({ verticalRadius = 2, outerRadius = 1, innerRadius = 0, thickness = 1, subdivisionsDown = 12, startOffset = 0, endOffset = 1, } = {}) { - if (subdivisionsDown <= 0) { - throw new Error('subdivisionDown must be > 0'); - } - const subdivisionsThick = 2; - const offsetRange = endOffset - startOffset; - const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - function lerp(a, b, s) { - return a + (b - a) * s; - } - function vAdd(a, b) { - return a.map((v, i) => v + b[i]); - } - function vMultiply(a, b) { - return a.map((v, i) => v * b[i]); - } - function createArc(arcRadius, x, normalMult, normalAdd, uMult, uAdd) { - for (let z = 0; z <= subdivisionsDown; z++) { - const uBack = x / (subdivisionsThick - 1); - const v = z / subdivisionsDown; - const xBack = (uBack - 0.5) * 2; - const angle = (startOffset + (v * offsetRange)) * Math.PI; - const s = Math.sin(angle); - const c = Math.cos(angle); - const radius = lerp(verticalRadius, arcRadius, s); - const px = xBack * thickness; - const py = c * verticalRadius; - const pz = s * radius; - positions.push(px, py, pz); - const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd); - normals.push(n); - texcoords.push(uBack * uMult + uAdd, v); - } - } - // Generate the individual vertices in our vertex buffer. - for (let x = 0; x < subdivisionsThick; x++) { - const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2; - createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); - createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0); - createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); - createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1); - } - // Do outer surface. - const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array); - function createSurface(leftArcOffset, rightArcOffset) { - for (let z = 0; z < subdivisionsDown; ++z) { - // Make triangle 1 of quad. - indices.push(leftArcOffset + z + 0, leftArcOffset + z + 1, rightArcOffset + z + 0); - // Make triangle 2 of quad. - indices.push(leftArcOffset + z + 1, rightArcOffset + z + 1, rightArcOffset + z + 0); - } - } - const numVerticesDown = subdivisionsDown + 1; - // front - createSurface(numVerticesDown * 0, numVerticesDown * 4); - // right - createSurface(numVerticesDown * 5, numVerticesDown * 7); - // back - createSurface(numVerticesDown * 6, numVerticesDown * 2); - // left - createSurface(numVerticesDown * 3, numVerticesDown * 1); - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} -/** - * Creates cylinder vertices. The cylinder will be created around the origin - * along the y-axis. - * - * @param params - * @param params.radius Radius of cylinder. Default = 1 - * @param params.height Height of cylinder. Default = 1 - * @param params.radialSubdivisions The number of subdivisions around the cylinder. Default = 24 - * @param params.verticalSubdivisions The number of subdivisions down the cylinder. Default = 1 - * @param params.topCap Create top cap. Default = true. - * @param params.bottomCap Create bottom cap. Default = true. - * @return The created vertices. - */ -function createCylinderVertices({ radius = 1, height = 1, radialSubdivisions = 24, verticalSubdivisions = 1, topCap = true, bottomCap = true, } = {}) { - return createTruncatedConeVertices({ - bottomRadius: radius, - topRadius: radius, - height, - radialSubdivisions, - verticalSubdivisions, - topCap, - bottomCap, - }); -} -/** - * Creates vertices for a torus - * - * @param params - * @param params.radius radius of center of torus circle. Default = 1 - * @param params.thickness radius of torus ring. Default = 0.24 - * @param params.radialSubdivisions The number of subdivisions around the torus. Default = 24 - * @param params.bodySubdivisions The number of subdivisions around the body torus. Default = 12 - * @param params.startAngle start angle in radians. Default = 0. - * @param params.endAngle end angle in radians. Default = Math.PI * 2. - * @return The created vertices. - */ -function createTorusVertices({ radius = 1, thickness = 0.24, radialSubdivisions = 24, bodySubdivisions = 12, startAngle = 0, endAngle = Math.PI * 2, } = {}) { - if (radialSubdivisions < 3) { - throw new Error('radialSubdivisions must be 3 or greater'); - } - if (bodySubdivisions < 3) { - throw new Error('verticalSubdivisions must be 3 or greater'); - } - const range = endAngle - startAngle; - const radialParts = radialSubdivisions + 1; - const bodyParts = bodySubdivisions + 1; - const numVertices = radialParts * bodyParts; - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, (radialSubdivisions) * (bodySubdivisions) * 2, Uint16Array); - for (let slice = 0; slice < bodyParts; ++slice) { - const v = slice / bodySubdivisions; - const sliceAngle = v * Math.PI * 2; - const sliceSin = Math.sin(sliceAngle); - const ringRadius = radius + sliceSin * thickness; - const ny = Math.cos(sliceAngle); - const y = ny * thickness; - for (let ring = 0; ring < radialParts; ++ring) { - const u = ring / radialSubdivisions; - const ringAngle = startAngle + u * range; - const xSin = Math.sin(ringAngle); - const zCos = Math.cos(ringAngle); - const x = xSin * ringRadius; - const z = zCos * ringRadius; - const nx = xSin * sliceSin; - const nz = zCos * sliceSin; - positions.push(x, y, z); - normals.push(nx, ny, nz); - texcoords.push(u, 1 - v); - } - } - for (let slice = 0; slice < bodySubdivisions; ++slice) { // eslint-disable-line - for (let ring = 0; ring < radialSubdivisions; ++ring) { // eslint-disable-line - const nextRingIndex = 1 + ring; - const nextSliceIndex = 1 + slice; - indices.push(radialParts * slice + ring, radialParts * nextSliceIndex + ring, radialParts * slice + nextRingIndex); - indices.push(radialParts * nextSliceIndex + ring, radialParts * nextSliceIndex + nextRingIndex, radialParts * slice + nextRingIndex); - } - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} -/** - * Creates disc vertices. The disc will be in the xz plane, centered at - * the origin. When creating, at least 3 divisions, or pie - * pieces, need to be specified, otherwise the triangles making - * up the disc will be degenerate. You can also specify the - * number of radial pieces `stacks`. A value of 1 for - * stacks will give you a simple disc of pie pieces. If you - * want to create an annulus you can set `innerRadius` to a - * value > 0. Finally, `stackPower` allows you to have the widths - * increase or decrease as you move away from the center. This - * is particularly useful when using the disc as a ground plane - * with a fixed camera such that you don't need the resolution - * of small triangles near the perimeter. For example, a value - * of 2 will produce stacks whose outside radius increases with - * the square of the stack index. A value of 1 will give uniform - * stacks. - * - * @param params - * @param params.radius Radius of the ground plane. Default = 1 - * @param params.divisions Number of triangles in the ground plane (at least 3). Default = 24 - * @param params.stacks Number of radial divisions. Default = 1 - * @param params.innerRadius Default = 0 - * @param params.stackPower Power to raise stack size to for decreasing width. Default = 1 - * @return The created vertices. - */ -function createDiscVertices({ radius = 1, divisions = 24, stacks = 1, innerRadius = 0, stackPower = 1, } = {}) { - if (divisions < 3) { - throw new Error('divisions must be at least 3'); - } - // Note: We don't share the center vertex because that would - // mess up texture coordinates. - const numVertices = (divisions + 1) * (stacks + 1); - const positions = createAugmentedTypedArray(3, numVertices, Float32Array); - const normals = createAugmentedTypedArray(3, numVertices, Float32Array); - const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array); - const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array); - let firstIndex = 0; - const radiusSpan = radius - innerRadius; - const pointsPerStack = divisions + 1; - // Build the disk one stack at a time. - for (let stack = 0; stack <= stacks; ++stack) { - const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower); - for (let i = 0; i <= divisions; ++i) { - const theta = 2.0 * Math.PI * i / divisions; - const x = stackRadius * Math.cos(theta); - const z = stackRadius * Math.sin(theta); - positions.push(x, 0, z); - normals.push(0, 1, 0); - texcoords.push(1 - (i / divisions), stack / stacks); - if (stack > 0 && i !== divisions) { - // a, b, c and d are the indices of the vertices of a quad. unless - // the current stack is the one closest to the center, in which case - // the vertices a and b connect to the center vertex. - const a = firstIndex + (i + 1); - const b = firstIndex + i; - const c = firstIndex + i - pointsPerStack; - const d = firstIndex + (i + 1) - pointsPerStack; - // Make a quad of the vertices a, b, c, d. - indices.push(a, b, c); - indices.push(a, c, d); - } - } - firstIndex += divisions + 1; - } - return { - position: positions.typedArray, - normal: normals.typedArray, - texcoord: texcoords.typedArray, - indices: indices.typedArray, - }; -} - -var primitives = /*#__PURE__*/Object.freeze({ - __proto__: null, - TypedArrayWrapper: TypedArrayWrapper, - create3DFVertices: create3DFVertices, - createCrescentVertices: createCrescentVertices, - createCubeVertices: createCubeVertices, - createCylinderVertices: createCylinderVertices, - createDiscVertices: createDiscVertices, - createPlaneVertices: createPlaneVertices, - createSphereVertices: createSphereVertices, - createTorusVertices: createTorusVertices, - createTruncatedConeVertices: createTruncatedConeVertices, - createXYQuadVertices: createXYQuadVertices -}); - -export { TypedArrayViewGenerator, copySourceToTexture, copySourcesToTexture, createBufferLayoutsFromArrays, createBuffersAndAttributesFromArrays, createTextureFromImage, createTextureFromImages, createTextureFromSource, createTextureFromSources, drawArrays, generateMipmap, getSizeAndAlignmentOfUnsizedArrayElement, getSizeForMipFromTexture, getSizeFromSource, interleaveVertexData, isTypedArray, kTypes, loadImageBitmap, makeBindGroupLayoutDescriptors, makeShaderDataDefinitions, makeStructuredView, makeTypedArrayViews, normalizeGPUExtent3D, numMipLevels, primitives, setIntrinsicsToView, setStructuredValues, setStructuredView, setTypedValues, setVertexAndIndexBuffers, subarray }; -//# sourceMappingURL=webgpu-utils.module.js.map diff --git a/dist/1.x/webgpu-utils.module.js.map b/dist/1.x/webgpu-utils.module.js.map deleted file mode 100644 index f8de624..0000000 --- a/dist/1.x/webgpu-utils.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webgpu-utils.module.js","sources":["../../../src/utils.ts","../../../src/typed-arrays.ts","../../../src/buffer-views.ts","../../node_modules/wgsl_reflect/wgsl_reflect.module.js","../../../src/data-definitions.ts","../../../src/generate-mipmap.ts","../../../src/attribute-utils.ts","../../../src/texture-utils.ts","../../../src/primitives.ts"],"sourcesContent":["export const roundUpToMultipleOf = (v: number, multiple: number) => (((v + multiple - 1) / multiple) | 0) * multiple;\n\nexport function keysOf(obj: { [k in T]: unknown }): readonly T[] {\n return (Object.keys(obj) as unknown[]) as T[];\n}\n\nexport function range(count: number, fn: (i: number) => T) {\n return new Array(count).fill(0).map((_, i) => fn(i));\n}\n","import {\n roundUpToMultipleOf,\n} from './utils.js';\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n\nexport class TypedArrayViewGenerator {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n constructor(sizeInBytes: number) {\n this.arrayBuffer = new ArrayBuffer(sizeInBytes);\n this.byteOffset = 0;\n }\n align(alignment: number) {\n this.byteOffset = roundUpToMultipleOf(this.byteOffset, alignment);\n }\n pad(numBytes: number) {\n this.byteOffset += numBytes;\n }\n getView(Ctor: TypedArrayConstructor, numElements: number): T {\n const view = new Ctor(this.arrayBuffer, this.byteOffset, numElements);\n this.byteOffset += view.byteLength;\n return view as T;\n }\n}\n\nexport function subarray(arr: TypedArray, offset: number, length: number): T {\n return arr.subarray(offset, offset + length) as T;\n}\n\n// TODO: fix better?\nexport const isTypedArray = (arr: any) =>\n arr && typeof arr.length === 'number' && arr.buffer instanceof ArrayBuffer && typeof arr.byteLength === 'number';\n","import {\n IntrinsicDefinition,\n StructDefinition,\n ArrayDefinition,\n TypeDefinition,\n VariableDefinition,\n} from './data-definitions.js';\nimport {\n isTypedArray,\n TypedArrayConstructor,\n TypedArray,\n} from './typed-arrays.js';\nimport { roundUpToMultipleOf, keysOf, range } from './utils.js';\n\ntype TypeDef = {\n numElements: number;\n align: number;\n size: number;\n type: string;\n View: TypedArrayConstructor;\n flatten?: boolean,\n pad?: readonly number[];\n};\n\nconst b: { readonly [K: string]: TypeDef } = {\n i32: { numElements: 1, align: 4, size: 4, type: 'i32', View: Int32Array },\n u32: { numElements: 1, align: 4, size: 4, type: 'u32', View: Uint32Array },\n f32: { numElements: 1, align: 4, size: 4, type: 'f32', View: Float32Array },\n f16: { numElements: 1, align: 2, size: 2, type: 'u16', View: Uint16Array },\n\n vec2f: { numElements: 2, align: 8, size: 8, type: 'f32', View: Float32Array },\n vec2i: { numElements: 2, align: 8, size: 8, type: 'i32', View: Int32Array },\n vec2u: { numElements: 2, align: 8, size: 8, type: 'u32', View: Uint32Array },\n vec2h: { numElements: 2, align: 4, size: 4, type: 'u16', View: Uint16Array },\n vec3i: { numElements: 3, align: 16, size: 12, type: 'i32', View: Int32Array },\n vec3u: { numElements: 3, align: 16, size: 12, type: 'u32', View: Uint32Array },\n vec3f: { numElements: 3, align: 16, size: 12, type: 'f32', View: Float32Array },\n vec3h: { numElements: 3, align: 8, size: 6, type: 'u16', View: Uint16Array },\n vec4i: { numElements: 4, align: 16, size: 16, type: 'i32', View: Int32Array },\n vec4u: { numElements: 4, align: 16, size: 16, type: 'u32', View: Uint32Array },\n vec4f: { numElements: 4, align: 16, size: 16, type: 'f32', View: Float32Array },\n vec4h: { numElements: 4, align: 8, size: 8, type: 'u16', View: Uint16Array },\n\n // AlignOf(vecR)\tSizeOf(array)\n mat2x2f: { numElements: 4, align: 8, size: 16, type: 'f32', View: Float32Array },\n mat2x2h: { numElements: 4, align: 4, size: 8, type: 'u16', View: Uint16Array },\n mat3x2f: { numElements: 6, align: 8, size: 24, type: 'f32', View: Float32Array },\n mat3x2h: { numElements: 6, align: 4, size: 12, type: 'u16', View: Uint16Array },\n mat4x2f: { numElements: 8, align: 8, size: 32, type: 'f32', View: Float32Array },\n mat4x2h: { numElements: 8, align: 4, size: 16, type: 'u16', View: Uint16Array },\n mat2x3f: { numElements: 8, align: 16, size: 32, pad: [3, 1], type: 'f32', View: Float32Array },\n mat2x3h: { numElements: 8, align: 8, size: 16, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat3x3f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x3h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x3f: { numElements: 16, align: 16, size: 64, pad: [3, 1], type: 'f32', View: Float32Array },\n mat4x3h: { numElements: 16, align: 8, size: 32, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat2x4f: { numElements: 8, align: 16, size: 32, type: 'f32', View: Float32Array },\n mat2x4h: { numElements: 8, align: 8, size: 16, type: 'u16', View: Uint16Array },\n mat3x4f: { numElements: 12, align: 16, size: 48, pad: [3, 1], type: 'f32', View: Float32Array },\n mat3x4h: { numElements: 12, align: 8, size: 24, pad: [3, 1], type: 'u16', View: Uint16Array },\n mat4x4f: { numElements: 16, align: 16, size: 64, type: 'f32', View: Float32Array },\n mat4x4h: { numElements: 16, align: 8, size: 32, type: 'u16', View: Uint16Array },\n\n // Note: At least as of WGSL V1 you can not create a bool for uniform or storage.\n // You can only create one in an internal struct. But, this code generates\n // views of structs and it needs to not fail if the struct has a bool\n bool: { numElements: 0, align: 1, size: 0, type: 'bool', View: Uint32Array },\n} as const;\n\nconst typeInfo: { readonly [K: string]: TypeDef } = {\n ...b,\n\n 'vec2': b.vec2i,\n 'vec2': b.vec2u,\n 'vec2': b.vec2f,\n 'vec2': b.vec2h,\n 'vec3': b.vec3i,\n 'vec3': b.vec3u,\n 'vec3': b.vec3f,\n 'vec3': b.vec3h,\n 'vec4': b.vec4i,\n 'vec4': b.vec4u,\n 'vec4': b.vec4f,\n 'vec4': b.vec4h,\n\n 'mat2x2': b.mat2x2f,\n 'mat2x2': b.mat2x2h,\n 'mat3x2': b.mat3x2f,\n 'mat3x2': b.mat3x2h,\n 'mat4x2': b.mat4x2f,\n 'mat4x2': b.mat4x2h,\n 'mat2x3': b.mat2x3f,\n 'mat2x3': b.mat2x3h,\n 'mat3x3': b.mat3x3f,\n 'mat3x3': b.mat3x3h,\n 'mat4x3': b.mat4x3f,\n 'mat4x3': b.mat4x3h,\n 'mat2x4': b.mat2x4f,\n 'mat2x4': b.mat2x4h,\n 'mat3x4': b.mat3x4f,\n 'mat3x4': b.mat3x4h,\n 'mat4x4': b.mat4x4f,\n 'mat4x4': b.mat4x4h,\n} as const;\nexport type kType = Extract;\nexport const kTypes: readonly kType[] = keysOf(typeInfo);\n\n/**\n * Set which intrinsic types to make views for.\n *\n * Example:\n *\n * Given a an array of intrinsics like this\n * `array`\n *\n * The default is to create a single `Float32Array(4 * 200)`\n * because creating 200 `Float32Array` views is not usually\n * what you want.\n *\n * If you do want individual views then you'd call\n * `setIntrinsicsToView(['vec3f`])` and now you get\n * an array of 200 `Float32Array`s.\n *\n * Note: `setIntrinsicsToView` always sets ALL types. The list you\n * pass it is the types you want views created for, all other types\n * will be reset to do the default. In other words\n *\n * ```js\n * setIntrinsicsToView(['vec3f`])\n * setIntrinsicsToView(['vec2f`])\n * ```\n *\n * Only `vec2f` will have views created. `vec3f` has been reset to the default by\n * the second call\n *\n * You can pass in `true` as the 2nd parameter to make it set which types\n * to flatten and all others will be set to have views created. 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 kType[] = [], flatten?: boolean) {\n // we need to track what we've viewed because for example `vec3f` references\n // the same info as `vec3` so we'd set one and reset the other.\n const visited = new Set();\n for (const type of kTypes) {\n const info = typeInfo[type];\n if (!visited.has(info)) {\n visited.add(info);\n info.flatten = types.includes(type) ? flatten : !flatten;\n }\n }\n}\nsetIntrinsicsToView();\n\nexport type TypedArrayOrViews = TypedArray | Views | Views[];\nexport interface Views {\n [x: string]: TypedArrayOrViews;\n}\nexport type ArrayBufferViews = {\n views: TypedArrayOrViews;\n arrayBuffer: ArrayBuffer;\n}\n\n// This needs to be fixed! 😱\nfunction getSizeOfTypeDef(typeDef: TypeDefinition): number {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n return asArrayDef.size;\n /*\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return roundUpToMultipleOf(typeDef.size, align) * asArrayDef.numElements;\n } else {\n return asArrayDef.numElements * getSizeOfTypeDef(elementType);\n }\n */\n } else {\n const asStructDef = typeDef as StructDefinition;\n const numElements = asArrayDef.numElements || 1;\n if (asStructDef.fields) {\n return typeDef.size * numElements;\n } else {\n const asIntrinsicDef = typeDef as IntrinsicDefinition;\n const { align } = typeInfo[asIntrinsicDef.type];\n return numElements > 1\n ? roundUpToMultipleOf(typeDef.size, align) * numElements\n : typeDef.size;\n }\n }\n}\n\n// If numElements is undefined this is NOT an array. If it is defined then it IS an array\n// Sizes for arrays are different than sizes for non-arrays. Example\n// a vec3f non array is Float32Array(3)\n// a vec3f array of 2 is Float32Array(4 * 2)\n// a vec3f array of 1 is Float32Array(4 * 1)\nfunction makeIntrinsicTypedArrayView(typeDef: TypeDefinition, buffer: ArrayBuffer, baseOffset: number, numElements?: number): TypedArray {\n const { size, type } = typeDef as IntrinsicDefinition;\n try {\n const { View, align } = typeInfo[type];\n const isArray = numElements !== undefined;\n const sizeInBytes = isArray\n ? roundUpToMultipleOf(size, align)\n : size;\n const baseNumElements = sizeInBytes / View.BYTES_PER_ELEMENT;\n const effectiveNumElements = isArray\n ? (numElements === 0\n ? (buffer.byteLength - baseOffset) / sizeInBytes\n : numElements)\n : 1;\n\n return new View(buffer, baseOffset, baseNumElements * effectiveNumElements);\n } catch {\n throw new Error(`unknown type: ${type}`);\n }\n\n}\n\nfunction isIntrinsic(typeDef: TypeDefinition) {\n return !(typeDef as StructDefinition).fields &&\n !(typeDef as ArrayDefinition).elementType;\n}\n\n/**\n * Creates a set of named TypedArray views on an ArrayBuffer. If you don't\n * pass in an ArrayBuffer, one will be created. If you're using an unsized\n * array then you must pass in your own arraybuffer\n *\n * Example:\n *\n * ```js\n * const code = `\n * struct Stuff {\n * direction: vec3f,\n * strength: f32,\n * matrix: mat4x4f,\n * };\n * @group(0) @binding(0) var uni: Stuff;\n * `;\n * const defs = makeShaderDataDefinitions(code);\n * const views = makeTypedArrayViews(devs.uniforms.uni.typeDefinition);\n * ```\n *\n * views would effectively be\n *\n * ```js\n * views = {\n * direction: Float32Array(arrayBuffer, 0, 3),\n * strength: Float32Array(arrayBuffer, 3, 4),\n * matrix: Float32Array(arraybuffer, 4, 20),\n * };\n * ```\n *\n * You can use the views directly or you can use @link {setStructuredView}\n *\n * @param typeDef Definition of the various types of views.\n * @param arrayBuffer Optional ArrayBuffer to use (if one provided one will be created)\n * @param offset Optional offset in existing ArrayBuffer to start the views.\n * @returns A bunch of named TypedArray views and the ArrayBuffer\n */\nexport function makeTypedArrayViews(typeDef: TypeDefinition, arrayBuffer?: ArrayBuffer, offset?: number): ArrayBufferViews {\n const baseOffset = offset || 0;\n const buffer = arrayBuffer || new ArrayBuffer(getSizeOfTypeDef(typeDef));\n\n const makeViews = (typeDef: TypeDefinition, baseOffset: number): TypedArrayOrViews => {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // TODO: Should be optional? Per Type? Depth set? Per field?\n // The issue is, if we have `array` we don't likely\n // want 1000 `Float32Array(4)` views. We want 1 `Float32Array(1000 * 4)` view.\n // On the other hand, if we have `array` the maybe we do want\n // 10 `Float32Array(16)` views since you might want to do\n // `mat4.perspective(fov, aspect, near, far, foo.bar.arrayOf10Mat4s[3])`;\n if (isIntrinsic(elementType) && typeInfo[(elementType as IntrinsicDefinition).type].flatten) {\n return makeIntrinsicTypedArrayView(elementType, buffer, baseOffset, asArrayDef.numElements);\n } else {\n const {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 = typeInfo[asIntrinsicDefinition.type];\n const view = getView(arrayBuffer, type.View);\n const index = offset / view.BYTES_PER_ELEMENT;\n if (typeof data === 'number') {\n view[index] = data;\n } else {\n view.set(data, index);\n }\n}\n\n/**\n * Sets values on an existing array buffer from a TypeDefinition\n * @param typeDef A type definition provided by @link {makeShaderDataDefinitions}\n * @param data The source data\n * @param arrayBuffer The arrayBuffer who's data to set.\n * @param offset An offset in the arrayBuffer to start at.\n */\nexport function setTypedValues(typeDef: TypeDefinition, data: any, arrayBuffer: ArrayBuffer, offset = 0) {\n const asArrayDef = typeDef as ArrayDefinition;\n const elementType = asArrayDef.elementType;\n if (elementType) {\n // It's ArrayDefinition\n if (isIntrinsic(elementType)) {\n const asIntrinsicDef = elementType as IntrinsicDefinition;\n if (isArrayLikeOfNumber(data)) {\n setIntrinsicFromArrayLikeOfNumber(asIntrinsicDef, data, arrayBuffer, offset);\n return;\n }\n }\n data.forEach((newValue: any, ndx: number) => {\n setTypedValues(elementType, newValue, arrayBuffer, offset + elementType.size * ndx);\n });\n return;\n }\n\n const asStructDef = typeDef as StructDefinition;\n const fields = asStructDef.fields;\n if (fields) {\n // It's StructDefinition\n for (const [key, newValue] of Object.entries(data)) {\n const fieldDef = fields[key];\n if (fieldDef) {\n setTypedValues(fieldDef.type, newValue, arrayBuffer, offset + fieldDef.offset);\n }\n }\n } else {\n // It's IntrinsicDefinition\n setIntrinsicFromArrayLikeOfNumber(typeDef as IntrinsicDefinition, data, arrayBuffer, offset);\n }\n}\n\n/**\n * Same as @link {setTypedValues} except it takes a @link {VariableDefinition}.\n * @param 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 } = typeInfo[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) {\n super();\n this.name = name;\n this.args = args;\n this.returnType = returnType;\n this.body = body;\n }\n get astNodeType() {\n return \"function\";\n }\n 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 (_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 (_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.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}\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 Alias\n * @extends Statement\n * @category AST\n */\nclass Alias extends Statement {\n constructor(name, type) {\n super();\n this.name = name;\n this.type = type;\n }\n get astNodeType() {\n return \"alias\";\n }\n}\n/**\n * @class Discard\n * @extends Statement\n * @category AST\n */\nclass Discard extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"discard\";\n }\n}\n/**\n * @class Break\n * @extends Statement\n * @category AST\n */\nclass Break extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"break\";\n }\n}\n/**\n * @class Continue\n * @extends Statement\n * @category AST\n */\nclass Continue extends Statement {\n constructor() {\n super();\n }\n get astNodeType() {\n return \"continue\";\n }\n}\n/**\n * @class Type\n * @extends Statement\n * @category AST\n */\nclass Type extends Statement {\n constructor(name) {\n super();\n this.name = name;\n }\n get astNodeType() {\n return \"type\";\n }\n get isStruct() {\n return false;\n }\n get isArray() {\n return false;\n }\n}\n/**\n * @class StructType\n * @extends Type\n * @category AST\n */\nclass Struct extends Type {\n constructor(name, members) {\n super(name);\n this.members = members;\n }\n get astNodeType() {\n return \"struct\";\n }\n get isStruct() {\n return true;\n }\n /// Return the index of the member with the given name, or -1 if not found.\n getMemberIndex(name) {\n for (let i = 0; i < this.members.length; i++) {\n if (this.members[i].name == name)\n return i;\n }\n return -1;\n }\n}\n/**\n * @class TemplateType\n * @extends Type\n * @category AST\n */\nclass TemplateType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"template\";\n }\n}\n/**\n * @class PointerType\n * @extends Type\n * @category AST\n */\nclass PointerType extends Type {\n constructor(name, storage, type, access) {\n super(name);\n this.storage = storage;\n this.type = type;\n this.access = access;\n }\n get astNodeType() {\n return \"pointer\";\n }\n}\n/**\n * @class ArrayType\n * @extends Type\n * @category AST\n */\nclass ArrayType extends Type {\n constructor(name, attributes, format, count) {\n super(name);\n this.attributes = attributes;\n this.format = format;\n this.count = count;\n }\n get astNodeType() {\n return \"array\";\n }\n get isArray() {\n return true;\n }\n}\n/**\n * @class SamplerType\n * @extends Type\n * @category AST\n */\nclass SamplerType extends Type {\n constructor(name, format, access) {\n super(name);\n this.format = format;\n this.access = access;\n }\n get astNodeType() {\n return \"sampler\";\n }\n}\n/**\n * @class Expression\n * @extends Node\n * @category AST\n */\nclass Expression extends Node {\n constructor() {\n super();\n }\n}\n/**\n * @class StringExpr\n * @extends Expression\n * @category AST\n */\nclass StringExpr extends Expression {\n constructor(value) {\n super();\n this.value = value;\n }\n get astNodeType() {\n return \"stringExpr\";\n }\n toString() {\n return this.value;\n }\n evaluateString() {\n return this.value;\n }\n}\n/**\n * @class CreateExpr\n * @extends Expression\n * @category AST\n */\nclass CreateExpr extends Expression {\n constructor(type, args) {\n super();\n this.type = type;\n this.args = args;\n }\n get astNodeType() {\n return \"createExpr\";\n }\n}\n/**\n * @class CallExpr\n * @extends Expression\n * @category AST\n */\nclass CallExpr extends Expression {\n constructor(name, args) {\n super();\n this.name = name;\n this.args = args;\n }\n get astNodeType() {\n return \"callExpr\";\n }\n evaluate(context) {\n switch (this.name) {\n case \"abs\":\n return Math.abs(this.args[0].evaluate(context));\n case \"acos\":\n return Math.acos(this.args[0].evaluate(context));\n case \"acosh\":\n return Math.acosh(this.args[0].evaluate(context));\n case \"asin\":\n return Math.asin(this.args[0].evaluate(context));\n case \"asinh\":\n return Math.asinh(this.args[0].evaluate(context));\n case \"atan\":\n return Math.atan(this.args[0].evaluate(context));\n case \"atan2\":\n return Math.atan2(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"atanh\":\n return Math.atanh(this.args[0].evaluate(context));\n case \"ceil\":\n return Math.ceil(this.args[0].evaluate(context));\n case \"clamp\":\n return Math.min(Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context)), this.args[2].evaluate(context));\n case \"cos\":\n return Math.cos(this.args[0].evaluate(context));\n //case \"cross\":\n //TODO: (x[i] * y[j] - x[j] * y[i])\n case \"degrees\":\n return (this.args[0].evaluate(context) * 180) / Math.PI;\n //case \"determinant\":\n //TODO implement\n case \"distance\":\n return Math.sqrt(Math.pow(this.args[0].evaluate(context) - this.args[1].evaluate(context), 2));\n case \"dot\":\n //TODO: (x[i] * y[i])\n case \"exp\":\n return Math.exp(this.args[0].evaluate(context));\n case \"exp2\":\n return Math.pow(2, this.args[0].evaluate(context));\n //case \"extractBits\":\n //TODO: implement\n //case \"firstLeadingBit\":\n //TODO: implement\n case \"floor\":\n return Math.floor(this.args[0].evaluate(context));\n case \"fma\":\n return (this.args[0].evaluate(context) * this.args[1].evaluate(context) +\n this.args[2].evaluate(context));\n case \"fract\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n //case \"frexp\":\n //TODO: implement\n case \"inverseSqrt\":\n return 1 / Math.sqrt(this.args[0].evaluate(context));\n //case \"length\":\n //TODO: implement\n case \"log\":\n return Math.log(this.args[0].evaluate(context));\n case \"log2\":\n return Math.log2(this.args[0].evaluate(context));\n case \"max\":\n return Math.max(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"min\":\n return Math.min(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"mix\":\n return (this.args[0].evaluate(context) *\n (1 - this.args[2].evaluate(context)) +\n this.args[1].evaluate(context) * this.args[2].evaluate(context));\n case \"modf\":\n return (this.args[0].evaluate(context) -\n Math.floor(this.args[0].evaluate(context)));\n case \"pow\":\n return Math.pow(this.args[0].evaluate(context), this.args[1].evaluate(context));\n case \"radians\":\n return (this.args[0].evaluate(context) * Math.PI) / 180;\n case \"round\":\n return Math.round(this.args[0].evaluate(context));\n case \"sign\":\n return Math.sign(this.args[0].evaluate(context));\n case \"sin\":\n return Math.sin(this.args[0].evaluate(context));\n case \"sinh\":\n return Math.sinh(this.args[0].evaluate(context));\n case \"saturate\":\n return Math.min(Math.max(this.args[0].evaluate(context), 0), 1);\n case \"smoothstep\":\n return (this.args[0].evaluate(context) *\n this.args[0].evaluate(context) *\n (3 - 2 * this.args[0].evaluate(context)));\n case \"sqrt\":\n return Math.sqrt(this.args[0].evaluate(context));\n case \"step\":\n return this.args[0].evaluate(context) < this.args[1].evaluate(context)\n ? 0\n : 1;\n case \"tan\":\n return Math.tan(this.args[0].evaluate(context));\n case \"tanh\":\n return Math.tanh(this.args[0].evaluate(context));\n case \"trunc\":\n return Math.trunc(this.args[0].evaluate(context));\n default:\n throw new Error(\"Non const function: \" + this.name);\n }\n }\n 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 }\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 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 discard: new TokenType(\"discard\", TokenClass.keyword, \"discard\"),\n else: new TokenType(\"else\", TokenClass.keyword, \"else\"),\n enable: new TokenType(\"enable\", TokenClass.keyword, \"enable\"),\n fallthrough: new TokenType(\"fallthrough\", TokenClass.keyword, \"fallthrough\"),\n false: new TokenType(\"false\", TokenClass.keyword, \"false\"),\n fn: new TokenType(\"fn\", TokenClass.keyword, \"fn\"),\n for: new TokenType(\"for\", TokenClass.keyword, \"for\"),\n function: new TokenType(\"function\", TokenClass.keyword, \"function\"),\n if: new TokenType(\"if\", TokenClass.keyword, \"if\"),\n let: new TokenType(\"let\", TokenClass.keyword, \"let\"),\n const: new TokenType(\"const\", TokenClass.keyword, \"const\"),\n loop: new TokenType(\"loop\", TokenClass.keyword, \"loop\"),\n while: new TokenType(\"while\", TokenClass.keyword, \"while\"),\n private: new TokenType(\"private\", TokenClass.keyword, \"private\"),\n read: new TokenType(\"read\", TokenClass.keyword, \"read\"),\n read_write: new TokenType(\"read_write\", TokenClass.keyword, \"read_write\"),\n return: new TokenType(\"return\", TokenClass.keyword, \"return\"),\n storage: new TokenType(\"storage\", TokenClass.keyword, \"storage\"),\n switch: new TokenType(\"switch\", TokenClass.keyword, \"switch\"),\n true: new TokenType(\"true\", TokenClass.keyword, \"true\"),\n alias: new TokenType(\"alias\", TokenClass.keyword, \"alias\"),\n type: new TokenType(\"type\", TokenClass.keyword, \"type\"),\n uniform: new TokenType(\"uniform\", TokenClass.keyword, \"uniform\"),\n var: new TokenType(\"var\", TokenClass.keyword, \"var\"),\n override: new TokenType(\"override\", TokenClass.keyword, \"override\"),\n workgroup: new TokenType(\"workgroup\", TokenClass.keyword, \"workgroup\"),\n write: new TokenType(\"write\", TokenClass.keyword, \"write\"),\n r8unorm: new TokenType(\"r8unorm\", TokenClass.keyword, \"r8unorm\"),\n r8snorm: new TokenType(\"r8snorm\", TokenClass.keyword, \"r8snorm\"),\n r8uint: new TokenType(\"r8uint\", TokenClass.keyword, \"r8uint\"),\n r8sint: new TokenType(\"r8sint\", TokenClass.keyword, \"r8sint\"),\n r16uint: new TokenType(\"r16uint\", TokenClass.keyword, \"r16uint\"),\n r16sint: new TokenType(\"r16sint\", TokenClass.keyword, \"r16sint\"),\n r16float: new TokenType(\"r16float\", TokenClass.keyword, \"r16float\"),\n rg8unorm: new TokenType(\"rg8unorm\", TokenClass.keyword, \"rg8unorm\"),\n rg8snorm: new TokenType(\"rg8snorm\", TokenClass.keyword, \"rg8snorm\"),\n rg8uint: new TokenType(\"rg8uint\", TokenClass.keyword, \"rg8uint\"),\n rg8sint: new TokenType(\"rg8sint\", TokenClass.keyword, \"rg8sint\"),\n r32uint: new TokenType(\"r32uint\", TokenClass.keyword, \"r32uint\"),\n r32sint: new TokenType(\"r32sint\", TokenClass.keyword, \"r32sint\"),\n r32float: new TokenType(\"r32float\", TokenClass.keyword, \"r32float\"),\n rg16uint: new TokenType(\"rg16uint\", TokenClass.keyword, \"rg16uint\"),\n rg16sint: new TokenType(\"rg16sint\", TokenClass.keyword, \"rg16sint\"),\n rg16float: new TokenType(\"rg16float\", TokenClass.keyword, \"rg16float\"),\n rgba8unorm: new TokenType(\"rgba8unorm\", TokenClass.keyword, \"rgba8unorm\"),\n rgba8unorm_srgb: new TokenType(\"rgba8unorm_srgb\", TokenClass.keyword, \"rgba8unorm_srgb\"),\n rgba8snorm: new TokenType(\"rgba8snorm\", TokenClass.keyword, \"rgba8snorm\"),\n rgba8uint: new TokenType(\"rgba8uint\", TokenClass.keyword, \"rgba8uint\"),\n rgba8sint: new TokenType(\"rgba8sint\", TokenClass.keyword, \"rgba8sint\"),\n bgra8unorm: new TokenType(\"bgra8unorm\", TokenClass.keyword, \"bgra8unorm\"),\n bgra8unorm_srgb: new TokenType(\"bgra8unorm_srgb\", TokenClass.keyword, \"bgra8unorm_srgb\"),\n rgb10a2unorm: new TokenType(\"rgb10a2unorm\", TokenClass.keyword, \"rgb10a2unorm\"),\n rg11b10float: new TokenType(\"rg11b10float\", TokenClass.keyword, \"rg11b10float\"),\n rg32uint: new TokenType(\"rg32uint\", TokenClass.keyword, \"rg32uint\"),\n rg32sint: new TokenType(\"rg32sint\", TokenClass.keyword, \"rg32sint\"),\n rg32float: new TokenType(\"rg32float\", TokenClass.keyword, \"rg32float\"),\n rgba16uint: new TokenType(\"rgba16uint\", TokenClass.keyword, \"rgba16uint\"),\n rgba16sint: new TokenType(\"rgba16sint\", TokenClass.keyword, \"rgba16sint\"),\n rgba16float: new TokenType(\"rgba16float\", TokenClass.keyword, \"rgba16float\"),\n rgba32uint: new TokenType(\"rgba32uint\", TokenClass.keyword, \"rgba32uint\"),\n rgba32sint: new TokenType(\"rgba32sint\", TokenClass.keyword, \"rgba32sint\"),\n rgba32float: new TokenType(\"rgba32float\", TokenClass.keyword, \"rgba32float\"),\n static_assert: new TokenType(\"static_assert\", TokenClass.keyword, \"static_assert\"),\n // WGSL grammar has a few keywords that have different token names than the strings they\n // represent. Aliasing them here.\n /*int32: new TokenType(\"i32\", TokenClass.keyword, \"i32\"),\n uint32: new TokenType(\"u32\", TokenClass.keyword, \"u32\"),\n float32: new TokenType(\"f32\", TokenClass.keyword, \"f32\"),\n pointer: new TokenType(\"ptr\", TokenClass.keyword, \"ptr\"),*/\n};\nTokenTypes.tokens = {\n decimal_float_literal: new TokenType(\"decimal_float_literal\", TokenClass.token, /((-?[0-9]*\\.[0-9]+|-?[0-9]+\\.[0-9]*)((e|E)(\\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\\+|-)?[0-9]+f?)|([0-9]+f)/),\n hex_float_literal: new TokenType(\"hex_float_literal\", TokenClass.token, /-?0x((([0-9a-fA-F]*\\.[0-9a-fA-F]+|[0-9a-fA-F]+\\.[0-9a-fA-F]*)((p|P)(\\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\\+|-)?[0-9]+f?))/),\n int_literal: new TokenType(\"int_literal\", TokenClass.token, /-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),\n uint_literal: new TokenType(\"uint_literal\", TokenClass.token, /0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),\n ident: new TokenType(\"ident\", TokenClass.token, /[a-zA-Z][0-9a-zA-Z_]*/),\n and: new TokenType(\"and\", TokenClass.token, \"&\"),\n and_and: new TokenType(\"and_and\", TokenClass.token, \"&&\"),\n arrow: new TokenType(\"arrow \", TokenClass.token, \"->\"),\n attr: new TokenType(\"attr\", TokenClass.token, \"@\"),\n attr_left: new TokenType(\"attr_left\", TokenClass.token, \"[[\"),\n attr_right: new TokenType(\"attr_right\", TokenClass.token, \"]]\"),\n forward_slash: new TokenType(\"forward_slash\", TokenClass.token, \"/\"),\n bang: new TokenType(\"bang\", TokenClass.token, \"!\"),\n bracket_left: new TokenType(\"bracket_left\", TokenClass.token, \"[\"),\n bracket_right: new TokenType(\"bracket_right\", TokenClass.token, \"]\"),\n brace_left: new TokenType(\"brace_left\", TokenClass.token, \"{\"),\n brace_right: new TokenType(\"brace_right\", TokenClass.token, \"}\"),\n colon: new TokenType(\"colon\", TokenClass.token, \":\"),\n comma: new TokenType(\"comma\", TokenClass.token, \",\"),\n equal: new TokenType(\"equal\", TokenClass.token, \"=\"),\n equal_equal: new TokenType(\"equal_equal\", TokenClass.token, \"==\"),\n not_equal: new TokenType(\"not_equal\", TokenClass.token, \"!=\"),\n greater_than: new TokenType(\"greater_than\", TokenClass.token, \">\"),\n greater_than_equal: new TokenType(\"greater_than_equal\", TokenClass.token, \">=\"),\n shift_right: new TokenType(\"shift_right\", TokenClass.token, \">>\"),\n less_than: new TokenType(\"less_than\", TokenClass.token, \"<\"),\n less_than_equal: new TokenType(\"less_than_equal\", TokenClass.token, \"<=\"),\n shift_left: new TokenType(\"shift_left\", TokenClass.token, \"<<\"),\n modulo: new TokenType(\"modulo\", TokenClass.token, \"%\"),\n minus: new TokenType(\"minus\", TokenClass.token, \"-\"),\n minus_minus: new TokenType(\"minus_minus\", TokenClass.token, \"--\"),\n period: new TokenType(\"period\", TokenClass.token, \".\"),\n plus: new TokenType(\"plus\", TokenClass.token, \"+\"),\n plus_plus: new TokenType(\"plus_plus\", TokenClass.token, \"++\"),\n or: new TokenType(\"or\", TokenClass.token, \"|\"),\n or_or: new TokenType(\"or_or\", TokenClass.token, \"||\"),\n paren_left: new TokenType(\"paren_left\", TokenClass.token, \"(\"),\n paren_right: new TokenType(\"paren_right\", TokenClass.token, \")\"),\n semicolon: new TokenType(\"semicolon\", TokenClass.token, \";\"),\n star: new TokenType(\"star\", TokenClass.token, \"*\"),\n tilde: new TokenType(\"tilde\", TokenClass.token, \"~\"),\n underscore: new TokenType(\"underscore\", TokenClass.token, \"_\"),\n xor: new TokenType(\"xor\", TokenClass.token, \"^\"),\n plus_equal: new TokenType(\"plus_equal\", TokenClass.token, \"+=\"),\n minus_equal: new TokenType(\"minus_equal\", TokenClass.token, \"-=\"),\n times_equal: new TokenType(\"times_equal\", TokenClass.token, \"*=\"),\n division_equal: new TokenType(\"division_equal\", TokenClass.token, \"/=\"),\n modulo_equal: new TokenType(\"modulo_equal\", TokenClass.token, \"%=\"),\n and_equal: new TokenType(\"and_equal\", TokenClass.token, \"&=\"),\n or_equal: new TokenType(\"or_equal\", TokenClass.token, \"|=\"),\n xor_equal: new TokenType(\"xor_equal\", TokenClass.token, \"^=\"),\n shift_right_equal: new TokenType(\"shift_right_equal\", TokenClass.token, \">>=\"),\n shift_left_equal: new TokenType(\"shift_left_equal\", TokenClass.token, \"<<=\"),\n};\nTokenTypes.storage_class = [\n _a.keywords.function,\n _a.keywords.private,\n _a.keywords.workgroup,\n _a.keywords.uniform,\n _a.keywords.storage,\n];\nTokenTypes.access_mode = [\n _a.keywords.read,\n _a.keywords.write,\n _a.keywords.read_write,\n];\nTokenTypes.sampler_type = [\n _a.keywords.sampler,\n _a.keywords.sampler_comparison,\n];\nTokenTypes.sampled_texture_type = [\n _a.keywords.texture_1d,\n _a.keywords.texture_2d,\n _a.keywords.texture_2d_array,\n _a.keywords.texture_3d,\n _a.keywords.texture_cube,\n _a.keywords.texture_cube_array,\n];\nTokenTypes.multisampled_texture_type = [\n _a.keywords.texture_multisampled_2d,\n];\nTokenTypes.storage_texture_type = [\n _a.keywords.texture_storage_1d,\n _a.keywords.texture_storage_2d,\n _a.keywords.texture_storage_2d_array,\n _a.keywords.texture_storage_3d,\n];\nTokenTypes.depth_texture_type = [\n _a.keywords.texture_depth_2d,\n _a.keywords.texture_depth_2d_array,\n _a.keywords.texture_depth_cube,\n _a.keywords.texture_depth_cube_array,\n _a.keywords.texture_depth_multisampled_2d,\n];\nTokenTypes.texture_external_type = [_a.keywords.texture_external];\nTokenTypes.any_texture_type = [\n ..._a.sampled_texture_type,\n ..._a.multisampled_texture_type,\n ..._a.storage_texture_type,\n ..._a.depth_texture_type,\n ..._a.texture_external_type,\n];\nTokenTypes.texel_format = [\n _a.keywords.r8unorm,\n _a.keywords.r8snorm,\n _a.keywords.r8uint,\n _a.keywords.r8sint,\n _a.keywords.r16uint,\n _a.keywords.r16sint,\n _a.keywords.r16float,\n _a.keywords.rg8unorm,\n _a.keywords.rg8snorm,\n _a.keywords.rg8uint,\n _a.keywords.rg8sint,\n _a.keywords.r32uint,\n _a.keywords.r32sint,\n _a.keywords.r32float,\n _a.keywords.rg16uint,\n _a.keywords.rg16sint,\n _a.keywords.rg16float,\n _a.keywords.rgba8unorm,\n _a.keywords.rgba8unorm_srgb,\n _a.keywords.rgba8snorm,\n _a.keywords.rgba8uint,\n _a.keywords.rgba8sint,\n _a.keywords.bgra8unorm,\n _a.keywords.bgra8unorm_srgb,\n _a.keywords.rgb10a2unorm,\n _a.keywords.rg11b10float,\n _a.keywords.rg32uint,\n _a.keywords.rg32sint,\n _a.keywords.rg32float,\n _a.keywords.rgba16uint,\n _a.keywords.rgba16sint,\n _a.keywords.rgba16float,\n _a.keywords.rgba32uint,\n _a.keywords.rgba32sint,\n _a.keywords.rgba32float,\n];\nTokenTypes.const_literal = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n _a.keywords.true,\n _a.keywords.false,\n];\nTokenTypes.literal_or_ident = [\n _a.tokens.ident,\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.decimal_float_literal,\n _a.tokens.hex_float_literal,\n];\nTokenTypes.element_count_expression = [\n _a.tokens.int_literal,\n _a.tokens.uint_literal,\n _a.tokens.ident,\n];\nTokenTypes.template_types = [\n _a.keywords.vec2,\n _a.keywords.vec3,\n _a.keywords.vec4,\n _a.keywords.mat2x2,\n _a.keywords.mat2x3,\n _a.keywords.mat2x4,\n _a.keywords.mat3x2,\n _a.keywords.mat3x3,\n _a.keywords.mat3x4,\n _a.keywords.mat4x2,\n _a.keywords.mat4x3,\n _a.keywords.mat4x4,\n _a.keywords.atomic,\n _a.keywords.bitcast,\n ..._a.any_texture_type,\n];\n// The grammar calls out 'block', but attribute grammar is defined to use a 'ident'.\n// The attribute grammar should be ident | block.\nTokenTypes.attribute_name = [_a.tokens.ident, _a.keywords.block];\nTokenTypes.assignment_operators = [\n _a.tokens.equal,\n _a.tokens.plus_equal,\n _a.tokens.minus_equal,\n _a.tokens.times_equal,\n _a.tokens.division_equal,\n _a.tokens.modulo_equal,\n _a.tokens.and_equal,\n _a.tokens.or_equal,\n _a.tokens.xor_equal,\n _a.tokens.shift_right_equal,\n _a.tokens.shift_left_equal,\n];\nTokenTypes.increment_operators = [\n _a.tokens.plus_plus,\n _a.tokens.minus_minus,\n];\n/// A token parsed by the WgslScanner.\nclass Token {\n constructor(type, lexeme, line) {\n this.type = type;\n this.lexeme = lexeme;\n this.line = line;\n }\n toString() {\n return this.lexeme;\n }\n isTemplateType() {\n return TokenTypes.template_types.indexOf(this.type) != -1;\n }\n isArrayType() {\n return this.type == TokenTypes.keywords.array;\n }\n isArrayOrTemplateType() {\n return this.isArrayType() || this.isTemplateType();\n }\n}\n/// Lexical scanner for the WGSL language. This takes an input source text and generates a list\n/// of Token objects, which can then be fed into the WgslParser to generate an AST.\nclass WgslScanner {\n constructor(source) {\n this._tokens = [];\n this._start = 0;\n this._current = 0;\n this._line = 1;\n this._source = source !== null && source !== void 0 ? source : \"\";\n }\n /// Scan all tokens from the source.\n scanTokens() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n if (!this.scanToken())\n throw `Invalid syntax at line ${this._line}`;\n }\n this._tokens.push(new Token(TokenTypes.eof, \"\", this._line));\n return this._tokens;\n }\n /// Scan a single token from the source.\n scanToken() {\n // Find the longest consecutive set of characters that match a rule.\n let lexeme = this._advance();\n // Skip line-feed, adding to the line counter.\n if (lexeme == \"\\n\") {\n this._line++;\n return true;\n }\n // Skip whitespace\n if (this._isWhitespace(lexeme)) {\n return true;\n }\n if (lexeme == \"/\") {\n // If it's a // comment, skip everything until the next line-feed.\n if (this._peekAhead() == \"/\") {\n while (lexeme != \"\\n\") {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n }\n // skip the linefeed\n this._line++;\n return true;\n }\n else if (this._peekAhead() == \"*\") {\n // If it's a / * block comment, skip everything until the matching * /,\n // allowing for nested block comments.\n this._advance();\n let commentLevel = 1;\n while (commentLevel > 0) {\n if (this._isAtEnd())\n return true;\n lexeme = this._advance();\n if (lexeme == \"\\n\") {\n this._line++;\n }\n else if (lexeme == \"*\") {\n if (this._peekAhead() == \"/\") {\n this._advance();\n commentLevel--;\n if (commentLevel == 0) {\n return true;\n }\n }\n }\n else if (lexeme == \"/\") {\n if (this._peekAhead() == \"*\") {\n this._advance();\n commentLevel++;\n }\n }\n }\n return true;\n }\n }\n let matchType = TokenTypes.none;\n for (;;) {\n let matchedType = this._findType(lexeme);\n // An exception to \"longest lexeme\" rule is '>>'. In the case of 1>>2, it's a\n // shift_right.\n // In the case of array>, it's two greater_than's (one to close the vec4,\n // and one to close the array).\n // Another ambiguity is '>='. In the case of vec2=vec2(1,2),\n // it's a greather_than and an equal, not a greater_than_equal.\n // WGSL requires context sensitive parsing to resolve these ambiguities. Both of these cases\n // are predicated on it the > either closing a template, or being part of an operator.\n // The solution here is to check if there was a less_than up to some number of tokens\n // previously, and the token prior to that is a keyword that requires a '<', then it will be\n // split into two operators; otherwise it's a single operator.\n const nextLexeme = this._peekAhead();\n if (lexeme == \">\" && (nextLexeme == \">\" || nextLexeme == \"=\")) {\n let foundLessThan = false;\n let ti = this._tokens.length - 1;\n for (let count = 0; count < 5 && ti >= 0; ++count, --ti) {\n if (this._tokens[ti].type === TokenTypes.tokens.less_than) {\n if (ti > 0 && this._tokens[ti - 1].isArrayOrTemplateType()) {\n foundLessThan = true;\n }\n break;\n }\n }\n // If there was a less_than in the recent token history, then this is probably a\n // greater_than.\n if (foundLessThan) {\n this._addToken(matchedType);\n return true;\n }\n }\n // The current lexeme may not match any rule, but some token types may be invalid for\n // part of the string but valid after a few more characters.\n // For example, 0x.5 is a hex_float_literal. But as it's being scanned,\n // \"0\" is a int_literal, then \"0x\" is invalid. If we stopped there, it would return\n // the int_literal \"0\", but that's incorrect. So if we look forward a few characters,\n // we'd get \"0x.\", which is still invalid, followed by \"0x.5\" which is the correct\n // hex_float_literal. So that means if we hit an non-matching string, we should look\n // ahead up to two characters to see if the string starts matching a valid rule again.\n if (matchedType === TokenTypes.none) {\n let lookAheadLexeme = lexeme;\n let lookAhead = 0;\n const maxLookAhead = 2;\n for (let li = 0; li < maxLookAhead; ++li) {\n lookAheadLexeme += this._peekAhead(li);\n matchedType = this._findType(lookAheadLexeme);\n if (matchedType !== TokenTypes.none) {\n lookAhead = li;\n break;\n }\n }\n if (matchedType === TokenTypes.none) {\n if (matchType === TokenTypes.none)\n return false;\n this._current--;\n this._addToken(matchType);\n return true;\n }\n lexeme = lookAheadLexeme;\n this._current += lookAhead + 1;\n }\n matchType = matchedType;\n if (this._isAtEnd())\n break;\n lexeme += this._advance();\n }\n // We got to the end of the input stream. Then the token we've ready so far is it.\n if (matchType === TokenTypes.none)\n return false;\n this._addToken(matchType);\n return true;\n }\n _findType(lexeme) {\n for (const name in TokenTypes.keywords) {\n const type = TokenTypes.keywords[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n for (const name in TokenTypes.tokens) {\n const type = TokenTypes.tokens[name];\n if (this._match(lexeme, type.rule)) {\n return type;\n }\n }\n return TokenTypes.none;\n }\n _match(lexeme, rule) {\n if (typeof rule === \"string\") {\n if (rule == lexeme) {\n return true;\n }\n }\n else {\n // regex\n const match = rule.exec(lexeme);\n if (match && match.index == 0 && match[0] == lexeme)\n return true;\n }\n return false;\n }\n _isAtEnd() {\n return this._current >= this._source.length;\n }\n _isWhitespace(c) {\n return c == \" \" || c == \"\\t\" || c == \"\\r\";\n }\n _advance(amount = 0) {\n let c = this._source[this._current];\n amount = amount || 0;\n amount++;\n this._current += amount;\n return c;\n }\n _peekAhead(offset = 0) {\n offset = offset || 0;\n if (this._current + offset >= this._source.length)\n return \"\\0\";\n return this._source[this._current + offset];\n }\n _addToken(type) {\n const text = this._source.substring(this._start, this._current);\n this._tokens.push(new Token(type, text, this._line));\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\n/// Parse a sequence of tokens from the WgslScanner into an Abstract Syntax Tree (AST).\nclass WgslParser {\n constructor() {\n this._tokens = [];\n this._current = 0;\n this._context = new ParseContext();\n }\n parse(tokensOrCode) {\n this._initialize(tokensOrCode);\n let statements = [];\n while (!this._isAtEnd()) {\n const statement = this._global_decl_or_directive();\n if (!statement)\n break;\n statements.push(statement);\n }\n return statements;\n }\n _initialize(tokensOrCode) {\n if (tokensOrCode) {\n if (typeof tokensOrCode == \"string\") {\n const scanner = new WgslScanner(tokensOrCode);\n this._tokens = scanner.scanTokens();\n }\n else {\n this._tokens = tokensOrCode;\n }\n }\n else {\n this._tokens = [];\n }\n this._current = 0;\n }\n _error(token, message) {\n console.error(token, message);\n return {\n token,\n message,\n toString: function () {\n return `${message}`;\n },\n };\n }\n _isAtEnd() {\n return (this._current >= this._tokens.length ||\n this._peek().type == TokenTypes.eof);\n }\n _match(types) {\n if (types instanceof TokenType) {\n if (this._check(types)) {\n this._advance();\n return true;\n }\n return false;\n }\n for (let i = 0, l = types.length; i < l; ++i) {\n const type = types[i];\n if (this._check(type)) {\n this._advance();\n return true;\n }\n }\n return false;\n }\n _consume(types, message) {\n if (this._check(types))\n return this._advance();\n throw this._error(this._peek(), message);\n }\n _check(types) {\n if (this._isAtEnd())\n return false;\n const tk = this._peek();\n if (types instanceof Array) {\n let t = tk.type;\n let index = types.indexOf(t);\n return index != -1;\n }\n return tk.type == types;\n }\n _advance() {\n if (!this._isAtEnd())\n this._current++;\n return this._previous();\n }\n _peek() {\n return this._tokens[this._current];\n }\n _previous() {\n return this._tokens[this._current - 1];\n }\n _global_decl_or_directive() {\n // semicolon\n // global_variable_decl semicolon\n // global_constant_decl semicolon\n // type_alias semicolon\n // struct_decl\n // function_decl\n // enable_directive\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._match(TokenTypes.keywords.alias)) {\n const type = this._type_alias();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return type;\n }\n if (this._match(TokenTypes.keywords.enable)) {\n const enable = this._enable_directive();\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return enable;\n }\n // The following statements have an optional attribute*\n const attrs = this._attribute();\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._global_variable_decl();\n if (_var != null)\n _var.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _var;\n }\n if (this._check(TokenTypes.keywords.override)) {\n const _override = this._override_variable_decl();\n if (_override != null)\n _override.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _override;\n }\n if (this._check(TokenTypes.keywords.let)) {\n const _let = this._global_let_decl();\n if (_let != null)\n _let.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _let;\n }\n if (this._check(TokenTypes.keywords.const)) {\n const _const = this._global_const_decl();\n if (_const != null)\n _const.attributes = attrs;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n return _const;\n }\n if (this._check(TokenTypes.keywords.struct)) {\n const _struct = this._struct_decl();\n if (_struct != null)\n _struct.attributes = attrs;\n return _struct;\n }\n if (this._check(TokenTypes.keywords.fn)) {\n const _fn = this._function_decl();\n if (_fn != null)\n _fn.attributes = attrs;\n return _fn;\n }\n return null;\n }\n _function_decl() {\n // attribute* function_header compound_statement\n // function_header: fn ident paren_left param_list? paren_right (arrow attribute* type_decl)?\n if (!this._match(TokenTypes.keywords.fn))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\").toString();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '(' for function arguments.\");\n const args = [];\n if (!this._check(TokenTypes.tokens.paren_right)) {\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const argAttrs = this._attribute();\n const name = this._consume(TokenTypes.tokens.ident, \"Expected argument name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for argument type.\");\n const typeAttrs = this._attribute();\n const type = this._type_decl();\n if (type != null) {\n type.attributes = typeAttrs;\n args.push(new Argument(name, type, argAttrs));\n }\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' after function arguments.\");\n let _return = null;\n if (this._match(TokenTypes.tokens.arrow)) {\n const attrs = this._attribute();\n _return = this._type_decl();\n if (_return != null)\n _return.attributes = attrs;\n }\n const body = this._compound_statement();\n return new Function(name, args, _return, body);\n }\n _compound_statement() {\n // brace_left statement* brace_right\n const statements = [];\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for block.\");\n while (!this._check(TokenTypes.tokens.brace_right)) {\n const statement = this._statement();\n if (statement !== null)\n statements.push(statement);\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for block.\");\n return statements;\n }\n _statement() {\n // semicolon\n // return_statement semicolon\n // if_statement\n // switch_statement\n // loop_statement\n // for_statement\n // func_call_statement semicolon\n // variable_statement semicolon\n // break_statement semicolon\n // continue_statement semicolon\n // continuing_statement compound_statement\n // discard semicolon\n // assignment_statement semicolon\n // compound_statement\n // increment_statement semicolon\n // decrement_statement semicolon\n // static_assert_statement semicolon\n // Ignore any stand-alone semicolons\n while (this._match(TokenTypes.tokens.semicolon) && !this._isAtEnd())\n ;\n if (this._check(TokenTypes.keywords.if))\n return this._if_statement();\n if (this._check(TokenTypes.keywords.switch))\n return this._switch_statement();\n if (this._check(TokenTypes.keywords.loop))\n return this._loop_statement();\n if (this._check(TokenTypes.keywords.for))\n return this._for_statement();\n if (this._check(TokenTypes.keywords.while))\n return this._while_statement();\n if (this._check(TokenTypes.keywords.continuing))\n return this._continuing_statement();\n if (this._check(TokenTypes.keywords.static_assert))\n return this._static_assert_statement();\n if (this._check(TokenTypes.tokens.brace_left))\n return this._compound_statement();\n let result = null;\n if (this._check(TokenTypes.keywords.return))\n result = this._return_statement();\n else if (this._check([\n TokenTypes.keywords.var,\n TokenTypes.keywords.let,\n TokenTypes.keywords.const,\n ]))\n result = this._variable_statement();\n else if (this._match(TokenTypes.keywords.discard))\n result = new Discard();\n else if (this._match(TokenTypes.keywords.break))\n result = new Break();\n else if (this._match(TokenTypes.keywords.continue))\n result = new Continue();\n else\n result =\n this._increment_decrement_statement() ||\n this._func_call_statement() ||\n this._assignment_statement();\n if (result != null)\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';' after statement.\");\n return result;\n }\n _static_assert_statement() {\n if (!this._match(TokenTypes.keywords.static_assert))\n return null;\n let expression = this._optional_paren_expression();\n return new StaticAssert(expression);\n }\n _while_statement() {\n if (!this._match(TokenTypes.keywords.while))\n return null;\n let condition = this._optional_paren_expression();\n const block = this._compound_statement();\n return new While(condition, block);\n }\n _continuing_statement() {\n if (!this._match(TokenTypes.keywords.continuing))\n return null;\n const block = this._compound_statement();\n return new Continuing(block);\n }\n _for_statement() {\n // for paren_left for_header paren_right compound_statement\n if (!this._match(TokenTypes.keywords.for))\n return null;\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n // for_header: (variable_statement assignment_statement func_call_statement)? semicolon short_circuit_or_expression? semicolon (assignment_statement func_call_statement)?\n const init = !this._check(TokenTypes.tokens.semicolon)\n ? this._for_init()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const condition = !this._check(TokenTypes.tokens.semicolon)\n ? this._short_circuit_or_expression()\n : null;\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'.\");\n const increment = !this._check(TokenTypes.tokens.paren_right)\n ? this._for_increment()\n : null;\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n const body = this._compound_statement();\n return new For(init, condition, increment, body);\n }\n _for_init() {\n // (variable_statement assignment_statement func_call_statement)?\n return (this._variable_statement() ||\n this._func_call_statement() ||\n this._assignment_statement());\n }\n _for_increment() {\n // (assignment_statement func_call_statement increment_statement)?\n return (this._func_call_statement() ||\n this._increment_decrement_statement() ||\n this._assignment_statement());\n }\n _variable_statement() {\n // variable_decl\n // variable_decl equal short_circuit_or_expression\n // let (ident variable_ident_decl) equal short_circuit_or_expression\n // const (ident variable_ident_decl) equal short_circuit_or_expression\n if (this._check(TokenTypes.keywords.var)) {\n const _var = this._variable_decl();\n if (_var === null)\n throw this._error(this._peek(), \"Variable declaration expected.\");\n let value = null;\n if (this._match(TokenTypes.tokens.equal))\n value = this._short_circuit_or_expression();\n return new Var(_var.name, _var.type, _var.storage, _var.access, value);\n }\n if (this._match(TokenTypes.keywords.let)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for let.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for let.\");\n const value = this._short_circuit_or_expression();\n return new Let(name, type, null, null, value);\n }\n if (this._match(TokenTypes.keywords.const)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for const.\").toString();\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const typeAttrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = typeAttrs;\n }\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for const.\");\n const value = this._short_circuit_or_expression();\n return new Const(name, type, null, null, value);\n }\n return null;\n }\n _increment_decrement_statement() {\n const savedPos = this._current;\n const _var = this._unary_expression();\n if (_var == null)\n return null;\n if (!this._check(TokenTypes.increment_operators)) {\n this._current = savedPos;\n return null;\n }\n const token = this._consume(TokenTypes.increment_operators, \"Expected increment operator\");\n return new Increment(token.type === TokenTypes.tokens.plus_plus\n ? IncrementOperator.increment\n : IncrementOperator.decrement, _var);\n }\n _assignment_statement() {\n // (unary_expression underscore) equal short_circuit_or_expression\n let _var = null;\n if (this._check(TokenTypes.tokens.brace_right)) {\n return null;\n }\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 const savedPos = this._current;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected function name.\");\n const args = this._argument_expression_list();\n if (args === null) {\n this._current = savedPos;\n return null;\n }\n return new Call(name.lexeme, args);\n }\n _loop_statement() {\n // loop brace_left statement* continuing_statement? brace_right\n if (!this._match(TokenTypes.keywords.loop))\n return null;\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for loop.\");\n // statement*\n const statements = [];\n let statement = this._statement();\n while (statement !== null) {\n if (Array.isArray(statement)) {\n for (let s of statement) {\n statements.push(s);\n }\n }\n else {\n statements.push(statement);\n }\n statement = this._statement();\n }\n // continuing_statement: continuing compound_statement\n let continuing = null;\n if (this._match(TokenTypes.keywords.continuing))\n continuing = this._compound_statement();\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for loop.\");\n return new Loop(statements, continuing);\n }\n _switch_statement() {\n // switch optional_paren_expression brace_left switch_body+ brace_right\n if (!this._match(TokenTypes.keywords.switch))\n return null;\n const condition = this._optional_paren_expression();\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for switch.\");\n const body = this._switch_body();\n if (body == null || body.length == 0)\n throw this._error(this._previous(), \"Expected 'case' or 'default'.\");\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' for switch.\");\n return new Switch(condition, body);\n }\n _switch_body() {\n // case case_selectors colon brace_left case_body? brace_right\n // default colon brace_left case_body? brace_right\n const cases = [];\n if (this._match(TokenTypes.keywords.case)) {\n const selector = this._case_selectors();\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch case.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch case.\");\n cases.push(new Case(selector, body));\n }\n if (this._match(TokenTypes.keywords.default)) {\n this._match(TokenTypes.tokens.colon); // colon is optional\n this._consume(TokenTypes.tokens.brace_left, \"Exected '{' for switch default.\");\n const body = this._case_body();\n this._consume(TokenTypes.tokens.brace_right, \"Exected '}' for switch default.\");\n cases.push(new Default(body));\n }\n if (this._check([TokenTypes.keywords.default, TokenTypes.keywords.case])) {\n const _cases = this._switch_body();\n cases.push(_cases[0]);\n }\n return cases;\n }\n _case_selectors() {\n var _a, _b, _c, _d;\n // const_literal (comma const_literal)* comma?\n const selectors = [\n (_b = (_a = this._shift_expression()) === null || _a === void 0 ? void 0 : _a.evaluate(this._context).toString()) !== null && _b !== void 0 ? _b : \"\",\n ];\n while (this._match(TokenTypes.tokens.comma)) {\n selectors.push((_d = (_c = this._shift_expression()) === null || _c === void 0 ? void 0 : _c.evaluate(this._context).toString()) !== null && _d !== void 0 ? _d : \"\");\n }\n return selectors;\n }\n _case_body() {\n // statement case_body?\n // fallthrough semicolon\n if (this._match(TokenTypes.keywords.fallthrough)) {\n this._consume(TokenTypes.tokens.semicolon, \"Expected ';'\");\n return [];\n }\n let statement = this._statement();\n if (statement == null)\n return [];\n if (!(statement instanceof Array)) {\n statement = [statement];\n }\n const nextStatement = this._case_body();\n if (nextStatement.length == 0)\n return statement;\n return [...statement, nextStatement[0]];\n }\n _if_statement() {\n // if optional_paren_expression compound_statement elseif_statement? else_statement?\n if (!this._match(TokenTypes.keywords.if))\n return null;\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n let elseif = [];\n if (this._match_elseif()) {\n elseif = this._elseif_statement(elseif);\n }\n let _else = null;\n if (this._match(TokenTypes.keywords.else))\n _else = this._compound_statement();\n return new If(condition, block, elseif, _else);\n }\n _match_elseif() {\n if (this._tokens[this._current].type === TokenTypes.keywords.else &&\n this._tokens[this._current + 1].type === TokenTypes.keywords.if) {\n this._advance();\n this._advance();\n return true;\n }\n return false;\n }\n _elseif_statement(elseif = []) {\n // else_if optional_paren_expression compound_statement elseif_statement?\n const condition = this._optional_paren_expression();\n const block = this._compound_statement();\n elseif.push(new ElseIf(condition, block));\n if (this._match_elseif()) {\n this._elseif_statement(elseif);\n }\n return elseif;\n }\n _return_statement() {\n // return short_circuit_or_expression?\n if (!this._match(TokenTypes.keywords.return))\n return null;\n const value = this._short_circuit_or_expression();\n return new Return(value);\n }\n _short_circuit_or_expression() {\n // short_circuit_and_expression\n // short_circuit_or_expression or_or short_circuit_and_expression\n let expr = this._short_circuit_and_expr();\n while (this._match(TokenTypes.tokens.or_or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._short_circuit_and_expr());\n }\n return expr;\n }\n _short_circuit_and_expr() {\n // inclusive_or_expression\n // short_circuit_and_expression and_and inclusive_or_expression\n let expr = this._inclusive_or_expression();\n while (this._match(TokenTypes.tokens.and_and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._inclusive_or_expression());\n }\n return expr;\n }\n _inclusive_or_expression() {\n // exclusive_or_expression\n // inclusive_or_expression or exclusive_or_expression\n let expr = this._exclusive_or_expression();\n while (this._match(TokenTypes.tokens.or)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._exclusive_or_expression());\n }\n return expr;\n }\n _exclusive_or_expression() {\n // and_expression\n // exclusive_or_expression xor and_expression\n let expr = this._and_expression();\n while (this._match(TokenTypes.tokens.xor)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._and_expression());\n }\n return expr;\n }\n _and_expression() {\n // equality_expression\n // and_expression and equality_expression\n let expr = this._equality_expression();\n while (this._match(TokenTypes.tokens.and)) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._equality_expression());\n }\n return expr;\n }\n _equality_expression() {\n // relational_expression\n // relational_expression equal_equal relational_expression\n // relational_expression not_equal relational_expression\n const expr = this._relational_expression();\n if (this._match([TokenTypes.tokens.equal_equal, TokenTypes.tokens.not_equal])) {\n return new BinaryOperator(this._previous().toString(), expr, this._relational_expression());\n }\n return expr;\n }\n _relational_expression() {\n // shift_expression\n // relational_expression less_than shift_expression\n // relational_expression greater_than shift_expression\n // relational_expression less_than_equal shift_expression\n // relational_expression greater_than_equal shift_expression\n let expr = this._shift_expression();\n while (this._match([\n TokenTypes.tokens.less_than,\n TokenTypes.tokens.greater_than,\n TokenTypes.tokens.less_than_equal,\n TokenTypes.tokens.greater_than_equal,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._shift_expression());\n }\n return expr;\n }\n _shift_expression() {\n // additive_expression\n // shift_expression shift_left additive_expression\n // shift_expression shift_right additive_expression\n let expr = this._additive_expression();\n while (this._match([TokenTypes.tokens.shift_left, TokenTypes.tokens.shift_right])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._additive_expression());\n }\n return expr;\n }\n _additive_expression() {\n // multiplicative_expression\n // additive_expression plus multiplicative_expression\n // additive_expression minus multiplicative_expression\n let expr = this._multiplicative_expression();\n while (this._match([TokenTypes.tokens.plus, TokenTypes.tokens.minus])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._multiplicative_expression());\n }\n return expr;\n }\n _multiplicative_expression() {\n // unary_expression\n // multiplicative_expression star unary_expression\n // multiplicative_expression forward_slash unary_expression\n // multiplicative_expression modulo unary_expression\n let expr = this._unary_expression();\n while (this._match([\n TokenTypes.tokens.star,\n TokenTypes.tokens.forward_slash,\n TokenTypes.tokens.modulo,\n ])) {\n expr = new BinaryOperator(this._previous().toString(), expr, this._unary_expression());\n }\n return expr;\n }\n _unary_expression() {\n // singular_expression\n // minus unary_expression\n // bang unary_expression\n // tilde unary_expression\n // star unary_expression\n // and unary_expression\n if (this._match([\n TokenTypes.tokens.minus,\n TokenTypes.tokens.bang,\n TokenTypes.tokens.tilde,\n TokenTypes.tokens.star,\n TokenTypes.tokens.and,\n ])) {\n return new UnaryOperator(this._previous().toString(), this._unary_expression());\n }\n return this._singular_expression();\n }\n _singular_expression() {\n // primary_expression postfix_expression ?\n const expr = this._primary_expression();\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n _postfix_expression() {\n // bracket_left short_circuit_or_expression bracket_right postfix_expression?\n if (this._match(TokenTypes.tokens.bracket_left)) {\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.bracket_right, \"Expected ']'.\");\n const p = this._postfix_expression();\n if (p)\n expr.postfix = p;\n return expr;\n }\n // period ident postfix_expression?\n if (this._match(TokenTypes.tokens.period)) {\n const name = this._consume(TokenTypes.tokens.ident, \"Expected member name.\");\n const p = this._postfix_expression();\n const expr = new StringExpr(name.lexeme);\n if (p)\n expr.postfix = p;\n return expr;\n }\n return null;\n }\n _getStruct(name) {\n if (this._context.aliases.has(name)) {\n const alias = this._context.aliases.get(name).type;\n return alias;\n }\n if (this._context.structs.has(name)) {\n const struct = this._context.structs.get(name);\n return struct;\n }\n return null;\n }\n _primary_expression() {\n // ident argument_expression_list?\n if (this._match(TokenTypes.tokens.ident)) {\n const name = this._previous().toString();\n if (this._check(TokenTypes.tokens.paren_left)) {\n const args = this._argument_expression_list();\n const struct = this._getStruct(name);\n if (struct != null) {\n return new CreateExpr(struct, args);\n }\n return new CallExpr(name, args);\n }\n if (this._context.constants.has(name)) {\n const c = this._context.constants.get(name);\n return new ConstExpr(name, c.value);\n }\n return new VariableExpr(name);\n }\n // const_literal\n if (this._match(TokenTypes.const_literal)) {\n return new LiteralExpr(parseFloat(this._previous().toString()));\n }\n // paren_expression\n if (this._check(TokenTypes.tokens.paren_left)) {\n return this._paren_expression();\n }\n // bitcast less_than type_decl greater_than paren_expression\n if (this._match(TokenTypes.keywords.bitcast)) {\n this._consume(TokenTypes.tokens.less_than, \"Expected '<'.\");\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n const value = this._paren_expression();\n return new BitcastExpr(type, value);\n }\n // type_decl argument_expression_list\n const type = this._type_decl();\n const args = this._argument_expression_list();\n return new TypecastExpr(type, args);\n }\n _argument_expression_list() {\n // paren_left ((short_circuit_or_expression comma)* short_circuit_or_expression comma?)? paren_right\n if (!this._match(TokenTypes.tokens.paren_left))\n return null;\n const args = [];\n do {\n if (this._check(TokenTypes.tokens.paren_right))\n break;\n const arg = this._short_circuit_or_expression();\n args.push(arg);\n } while (this._match(TokenTypes.tokens.comma));\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')' for agument list\");\n return args;\n }\n _optional_paren_expression() {\n // [paren_left] short_circuit_or_expression [paren_right]\n this._match(TokenTypes.tokens.paren_left);\n const expr = this._short_circuit_or_expression();\n this._match(TokenTypes.tokens.paren_right);\n return new GroupingExpr([expr]);\n }\n _paren_expression() {\n // paren_left short_circuit_or_expression paren_right\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n const expr = this._short_circuit_or_expression();\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new GroupingExpr([expr]);\n }\n _struct_decl() {\n // attribute* struct ident struct_body_decl\n if (!this._match(TokenTypes.keywords.struct))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected name for struct.\").toString();\n // struct_body_decl: brace_left (struct_member comma)* struct_member comma? brace_right\n this._consume(TokenTypes.tokens.brace_left, \"Expected '{' for struct body.\");\n const members = [];\n while (!this._check(TokenTypes.tokens.brace_right)) {\n // struct_member: attribute* variable_ident_decl\n const memberAttrs = this._attribute();\n const memberName = this._consume(TokenTypes.tokens.ident, \"Expected variable name.\").toString();\n this._consume(TokenTypes.tokens.colon, \"Expected ':' for struct member type.\");\n const typeAttrs = this._attribute();\n const memberType = this._type_decl();\n if (memberType != null)\n memberType.attributes = typeAttrs;\n if (!this._check(TokenTypes.tokens.brace_right))\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for struct member.\");\n else\n this._match(TokenTypes.tokens.comma); // trailing comma optional.\n members.push(new Member(memberName, memberType, memberAttrs));\n }\n this._consume(TokenTypes.tokens.brace_right, \"Expected '}' after struct body.\");\n const structNode = new Struct(name, members);\n this._context.structs.set(name, structNode);\n return structNode;\n }\n _global_variable_decl() {\n // attribute* variable_decl (equal const_expression)?\n const _var = this._variable_decl();\n if (_var && this._match(TokenTypes.tokens.equal))\n _var.value = this._const_expression();\n return _var;\n }\n _override_variable_decl() {\n // attribute* override_decl (equal const_expression)?\n const _override = this._override_decl();\n if (_override && this._match(TokenTypes.tokens.equal))\n _override.value = this._const_expression();\n return _override;\n }\n _global_const_decl() {\n // attribute* const (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.const))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n const valueExpr = this._short_circuit_or_expression();\n if (valueExpr instanceof CreateExpr) {\n value = valueExpr;\n }\n else if (valueExpr instanceof ConstExpr &&\n valueExpr.initializer instanceof CreateExpr) {\n value = valueExpr.initializer;\n }\n else {\n try {\n const constValue = valueExpr.evaluate(this._context);\n value = new LiteralExpr(constValue);\n }\n catch (_a) {\n value = valueExpr;\n }\n }\n }\n const c = new Const(name.toString(), type, \"\", \"\", value);\n this._context.constants.set(c.name, c);\n return c;\n }\n _global_let_decl() {\n // attribute* let (ident variable_ident_decl) global_const_initializer?\n if (!this._match(TokenTypes.keywords.let))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n let value = null;\n if (this._match(TokenTypes.tokens.equal)) {\n value = this._const_expression();\n }\n return new Let(name.toString(), type, \"\", \"\", value);\n }\n _const_expression() {\n // type_decl paren_left ((const_expression comma)* const_expression comma?)? paren_right\n // const_literal\n if (this._match(TokenTypes.const_literal))\n return new StringExpr(this._previous().toString());\n const type = this._type_decl();\n this._consume(TokenTypes.tokens.paren_left, \"Expected '('.\");\n let args = [];\n while (!this._check(TokenTypes.tokens.paren_right)) {\n args.push(this._const_expression());\n if (!this._check(TokenTypes.tokens.comma))\n break;\n this._advance();\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'.\");\n return new CreateExpr(type, args);\n }\n _variable_decl() {\n // var variable_qualifier? (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.var))\n return null;\n // variable_qualifier: less_than storage_class (comma access_mode)? greater_than\n let storage = \"\";\n let access = \"\";\n if (this._match(TokenTypes.tokens.less_than)) {\n storage = this._consume(TokenTypes.storage_class, \"Expected storage_class.\").toString();\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>'.\");\n }\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Var(name.toString(), type, storage, access, null);\n }\n _override_decl() {\n // override (ident variable_ident_decl)\n if (!this._match(TokenTypes.keywords.override))\n return null;\n const name = this._consume(TokenTypes.tokens.ident, \"Expected variable name\");\n let type = null;\n if (this._match(TokenTypes.tokens.colon)) {\n const attrs = this._attribute();\n type = this._type_decl();\n if (type != null)\n type.attributes = attrs;\n }\n return new Override(name.toString(), type, null);\n }\n _enable_directive() {\n // enable ident semicolon\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n return new Enable(name.toString());\n }\n _type_alias() {\n // type ident equal type_decl\n const name = this._consume(TokenTypes.tokens.ident, \"identity expected.\");\n this._consume(TokenTypes.tokens.equal, \"Expected '=' for type alias.\");\n let aliasType = this._type_decl();\n if (aliasType === null) {\n throw this._error(this._peek(), \"Expected Type for Alias.\");\n }\n if (this._context.aliases.has(aliasType.name)) {\n aliasType = this._context.aliases.get(aliasType.name).type;\n }\n const aliasNode = new Alias(name.toString(), aliasType);\n this._context.aliases.set(aliasNode.name, aliasNode);\n return aliasNode;\n }\n _type_decl() {\n // ident\n // bool\n // float32\n // int32\n // uint32\n // vec2 less_than type_decl greater_than\n // vec3 less_than type_decl greater_than\n // vec4 less_than type_decl greater_than\n // mat2x2 less_than type_decl greater_than\n // mat2x3 less_than type_decl greater_than\n // mat2x4 less_than type_decl greater_than\n // mat3x2 less_than type_decl greater_than\n // mat3x3 less_than type_decl greater_than\n // mat3x4 less_than type_decl greater_than\n // mat4x2 less_than type_decl greater_than\n // mat4x3 less_than type_decl greater_than\n // mat4x4 less_than type_decl greater_than\n // atomic less_than type_decl greater_than\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n // array_type_decl\n // texture_sampler_types\n if (this._check([\n TokenTypes.tokens.ident,\n ...TokenTypes.texel_format,\n TokenTypes.keywords.bool,\n TokenTypes.keywords.f32,\n TokenTypes.keywords.i32,\n TokenTypes.keywords.u32,\n ])) {\n const type = this._advance();\n const typeName = type.toString();\n if (this._context.structs.has(typeName)) {\n return this._context.structs.get(typeName);\n }\n if (this._context.aliases.has(typeName)) {\n return this._context.aliases.get(typeName).type;\n }\n return new Type(type.toString());\n }\n // texture_sampler_types\n let type = this._texture_sampler_types();\n if (type)\n return type;\n if (this._check(TokenTypes.template_types)) {\n let type = this._advance().toString();\n let format = null;\n let access = null;\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for type.\");\n }\n return new TemplateType(type, format, access);\n }\n // pointer less_than storage_class comma type_decl (comma access_mode)? greater_than\n if (this._match(TokenTypes.keywords.ptr)) {\n let pointer = this._previous().toString();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for pointer.\");\n const storage = this._consume(TokenTypes.storage_class, \"Expected storage_class for pointer\");\n this._consume(TokenTypes.tokens.comma, \"Expected ',' for pointer.\");\n const decl = this._type_decl();\n let access = null;\n if (this._match(TokenTypes.tokens.comma))\n access = this._consume(TokenTypes.access_mode, \"Expected access_mode for pointer\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for pointer.\");\n return new PointerType(pointer, storage.toString(), decl, access);\n }\n // The following type_decl's have an optional attribyte_list*\n const attrs = this._attribute();\n // attribute* array\n // attribute* array less_than type_decl (comma element_count_expression)? greater_than\n if (this._match(TokenTypes.keywords.array)) {\n let format = null;\n let countInt = -1;\n const array = this._previous();\n if (this._match(TokenTypes.tokens.less_than)) {\n format = this._type_decl();\n if (this._context.aliases.has(format.name)) {\n format = this._context.aliases.get(format.name).type;\n }\n let count = \"\";\n if (this._match(TokenTypes.tokens.comma)) {\n let c = this._shift_expression();\n count = c.evaluate(this._context).toString();\n }\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for array.\");\n countInt = count ? parseInt(count) : 0;\n }\n return new ArrayType(array.toString(), attrs, format, countInt);\n }\n return null;\n }\n _texture_sampler_types() {\n // sampler_type\n if (this._match(TokenTypes.sampler_type))\n return new SamplerType(this._previous().toString(), null, null);\n // depth_texture_type\n if (this._match(TokenTypes.depth_texture_type))\n return new SamplerType(this._previous().toString(), null, null);\n // sampled_texture_type less_than type_decl greater_than\n // multisampled_texture_type less_than type_decl greater_than\n if (this._match(TokenTypes.sampled_texture_type) ||\n this._match(TokenTypes.multisampled_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._type_decl();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, null);\n }\n // storage_texture_type less_than texel_format comma access_mode greater_than\n if (this._match(TokenTypes.storage_texture_type)) {\n const sampler = this._previous();\n this._consume(TokenTypes.tokens.less_than, \"Expected '<' for sampler type.\");\n const format = this._consume(TokenTypes.texel_format, \"Invalid texel format.\").toString();\n this._consume(TokenTypes.tokens.comma, \"Expected ',' after texel format.\");\n const access = this._consume(TokenTypes.access_mode, \"Expected access mode for storage texture type.\").toString();\n this._consume(TokenTypes.tokens.greater_than, \"Expected '>' for sampler type.\");\n return new SamplerType(sampler.toString(), format, access);\n }\n return null;\n }\n _attribute() {\n // attr ident paren_left (literal_or_ident comma)* literal_or_ident paren_right\n // attr ident\n let attributes = [];\n while (this._match(TokenTypes.tokens.attr)) {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n if (!(attr.value instanceof Array)) {\n attr.value = [attr.value];\n }\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n }\n // Deprecated:\n // attr_left (attribute comma)* attribute attr_right\n while (this._match(TokenTypes.tokens.attr_left)) {\n if (!this._check(TokenTypes.tokens.attr_right)) {\n do {\n const name = this._consume(TokenTypes.attribute_name, \"Expected attribute name\");\n const attr = new Attribute(name.toString(), null);\n if (this._match(TokenTypes.tokens.paren_left)) {\n // literal_or_ident\n attr.value = [\n this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString(),\n ];\n if (this._check(TokenTypes.tokens.comma)) {\n this._advance();\n do {\n const v = this._consume(TokenTypes.literal_or_ident, \"Expected attribute value\").toString();\n attr.value.push(v);\n } while (this._match(TokenTypes.tokens.comma));\n }\n this._consume(TokenTypes.tokens.paren_right, \"Expected ')'\");\n }\n attributes.push(attr);\n } while (this._match(TokenTypes.tokens.comma));\n }\n // Consume ]]\n this._consume(TokenTypes.tokens.attr_right, \"Expected ']]' after attribute declarations\");\n }\n if (attributes.length == 0)\n return null;\n return attributes;\n }\n}\n\n/**\n * @author Brendan Duncan / https://github.com/brendan-duncan\n */\nclass TypeInfo {\n constructor(name, attributes) {\n this.name = name;\n this.attributes = attributes;\n this.size = 0;\n }\n get isArray() {\n return false;\n }\n get isStruct() {\n return false;\n }\n get isTemplate() {\n return false;\n }\n}\nclass MemberInfo {\n constructor(name, type, attributes) {\n this.name = name;\n this.type = type;\n this.attributes = attributes;\n this.offset = 0;\n this.size = 0;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass StructInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.members = [];\n this.align = 0;\n }\n get isStruct() {\n return true;\n }\n}\nclass ArrayInfo extends TypeInfo {\n constructor(name, attributes) {\n super(name, attributes);\n this.count = 0;\n this.stride = 0;\n }\n get isArray() {\n return true;\n }\n}\nclass TemplateInfo extends TypeInfo {\n constructor(name, format, attributes, access) {\n super(name, attributes);\n this.format = format;\n this.access = access;\n }\n get isTemplate() {\n return true;\n }\n}\nvar ResourceType;\n(function (ResourceType) {\n ResourceType[ResourceType[\"Uniform\"] = 0] = \"Uniform\";\n ResourceType[ResourceType[\"Storage\"] = 1] = \"Storage\";\n ResourceType[ResourceType[\"Texture\"] = 2] = \"Texture\";\n ResourceType[ResourceType[\"Sampler\"] = 3] = \"Sampler\";\n ResourceType[ResourceType[\"StorageTexture\"] = 4] = \"StorageTexture\";\n})(ResourceType || (ResourceType = {}));\nclass VariableInfo {\n constructor(name, type, group, binding, attributes, resourceType, access) {\n this.name = name;\n this.type = type;\n this.group = group;\n this.binding = binding;\n this.attributes = attributes;\n this.resourceType = resourceType;\n this.access = access;\n }\n get isArray() {\n return this.type.isArray;\n }\n get isStruct() {\n return this.type.isStruct;\n }\n get isTemplate() {\n return this.type.isTemplate;\n }\n get size() {\n return this.type.size;\n }\n get align() {\n return this.type.isStruct ? this.type.align : 0;\n }\n get members() {\n return this.type.isStruct ? this.type.members : null;\n }\n get format() {\n return this.type.isArray\n ? this.type.format\n : this.type.isTemplate\n ? this.type.format\n : null;\n }\n get count() {\n return this.type.isArray ? this.type.count : 0;\n }\n get stride() {\n return this.type.isArray ? this.type.stride : this.size;\n }\n}\nclass AliasInfo {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n }\n}\nclass _TypeSize {\n constructor(align, size) {\n this.align = align;\n this.size = size;\n }\n}\nclass InputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n this.interpolation = null;\n }\n}\nclass OutputInfo {\n constructor(name, type, locationType, location) {\n this.name = name;\n this.type = type;\n this.locationType = locationType;\n this.location = location;\n }\n}\nclass FunctionInfo {\n constructor(name, stage = null) {\n this.stage = null;\n this.inputs = [];\n this.outputs = [];\n this.resources = [];\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.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 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 continue;\n }\n if (node instanceof Alias) {\n this.aliases.push(this._getAliasInfo(node));\n continue;\n }\n if (node instanceof Override) {\n const v = node;\n const id = this._getAttributeNum(v.attributes, \"id\", 0);\n const type = v.type != null ? this._getTypeInfo(v.type, v.attributes) : null;\n this.overrides.push(new OverrideInfo(v.name, type, v.attributes, id));\n continue;\n }\n if (this._isUniformVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Uniform, v.access);\n this.uniforms.push(varInfo);\n continue;\n }\n if (this._isStorageVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Storage, v.access);\n this.storage.push(varInfo);\n continue;\n }\n if (this._isTextureVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const isStorageTexture = this._isStorageTexture(type);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, isStorageTexture ? ResourceType.StorageTexture : ResourceType.Texture, v.access);\n if (isStorageTexture) {\n this.storage.push(varInfo);\n }\n else {\n this.textures.push(varInfo);\n }\n continue;\n }\n if (this._isSamplerVar(node)) {\n const v = node;\n const g = this._getAttributeNum(v.attributes, \"group\", 0);\n const b = this._getAttributeNum(v.attributes, \"binding\", 0);\n const type = this._getTypeInfo(v.type, v.attributes);\n const varInfo = new VariableInfo(v.name, type, g, b, v.attributes, ResourceType.Sampler, v.access);\n this.samplers.push(varInfo);\n continue;\n }\n if (node instanceof Function) {\n const vertexStage = this._getAttribute(node, \"vertex\");\n const fragmentStage = this._getAttribute(node, \"fragment\");\n const computeStage = this._getAttribute(node, \"compute\");\n const stage = vertexStage || fragmentStage || computeStage;\n if (stage) {\n const fn = new FunctionInfo(node.name, stage === null || stage === void 0 ? void 0 : stage.name);\n fn.inputs = this._getInputs(node.args);\n fn.outputs = this._getOutputs(node.returnType);\n fn.resources = this._findResources(node);\n this.entry[stage.name].push(fn);\n }\n continue;\n }\n }\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 _findResources(fn) {\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 if (varStack.length > 0) {\n const v = node;\n varStack[varStack.length - 1][v.name] = v;\n }\n }\n else if (node instanceof Let) {\n if (varStack.length > 0) {\n const v = node;\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 fn = self._functions.get(c.name);\n if (fn) {\n if (fn.resources === null) {\n fn.resources = self._findResources(fn.node);\n }\n resources.push(...fn.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 if (groups[group] === undefined)\n groups[group] = [];\n if (binding >= groups[group].length)\n groups[group].length = binding + 1;\n }\n for (const u of this.uniforms) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const u of this.storage) {\n _makeRoom(u.group, u.binding);\n const group = groups[u.group];\n group[u.binding] = u;\n }\n for (const t of this.textures) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n for (const t of this.samplers) {\n _makeRoom(t.group, t.binding);\n const group = groups[t.group];\n group[t.binding] = t;\n }\n return groups;\n }\n _getOutputs(type, outputs = undefined) {\n if (outputs === undefined)\n outputs = [];\n if (type instanceof Struct) {\n this._getStructOutputs(type, outputs);\n }\n else {\n const output = this._getOutputInfo(type);\n if (output !== null)\n outputs.push(output);\n }\n return outputs;\n }\n _getStructOutputs(struct, outputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructOutputs(m.type, outputs);\n }\n else {\n const location = this._getAttribute(m, \"location\") || this._getAttribute(m, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(m.type, m.type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(m.name, typeInfo, location.name, locationValue);\n outputs.push(info);\n }\n }\n }\n }\n _getOutputInfo(type) {\n const location = this._getAttribute(type, \"location\") ||\n this._getAttribute(type, \"builtin\");\n if (location !== null) {\n const typeInfo = this._getTypeInfo(type, type.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new OutputInfo(\"\", typeInfo, location.name, locationValue);\n return info;\n }\n return null;\n }\n _getInputs(args, inputs = undefined) {\n if (inputs === undefined)\n inputs = [];\n for (const arg of args) {\n if (arg.type instanceof Struct) {\n this._getStructInputs(arg.type, inputs);\n }\n else {\n const input = this._getInputInfo(arg);\n if (input !== null)\n inputs.push(input);\n }\n }\n return inputs;\n }\n _getStructInputs(struct, inputs) {\n for (const m of struct.members) {\n if (m.type instanceof Struct) {\n this._getStructInputs(m.type, inputs);\n }\n else {\n const input = this._getInputInfo(m);\n if (input !== null)\n inputs.push(input);\n }\n }\n }\n _getInputInfo(node) {\n const location = this._getAttribute(node, \"location\") ||\n this._getAttribute(node, \"builtin\");\n if (location !== null) {\n const interpolation = this._getAttribute(node, \"interpolation\");\n const type = this._getTypeInfo(node.type, node.attributes);\n const locationValue = this._parseInt(location.value);\n const info = new InputInfo(node.name, type, location.name, locationValue);\n if (interpolation !== null) {\n info.interpolation = this._parseString(interpolation.value);\n }\n return info;\n }\n return null;\n }\n _parseString(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n return s;\n }\n _parseInt(s) {\n if (s instanceof Array) {\n s = s[0];\n }\n const n = parseInt(s);\n return isNaN(n) ? s : n;\n }\n _getAlias(name) {\n for (const a of this.aliases) {\n if (a.name == name)\n return a.type;\n }\n return null;\n }\n _getAliasInfo(node) {\n return new AliasInfo(node.name, this._getTypeInfo(node.type, null));\n }\n _getTypeInfo(type, attributes) {\n if (this._types.has(type)) {\n return this._types.get(type);\n }\n if (type instanceof ArrayType) {\n const a = type;\n const t = this._getTypeInfo(a.format, a.attributes);\n const info = new ArrayInfo(a.name, attributes);\n info.format = t;\n info.count = a.count;\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof Struct) {\n const s = type;\n const info = new StructInfo(s.name, attributes);\n for (const m of s.members) {\n const t = this._getTypeInfo(m.type, m.attributes);\n info.members.push(new MemberInfo(m.name, t, m.attributes));\n }\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof SamplerType) {\n const s = type;\n const formatIsType = s.format instanceof Type;\n const format = s.format\n ? formatIsType\n ? this._getTypeInfo(s.format, null)\n : new TypeInfo(s.format, null)\n : null;\n const info = new TemplateInfo(s.name, format, attributes, s.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n if (type instanceof TemplateType) {\n const t = type;\n const format = t.format ? this._getTypeInfo(t.format, null) : null;\n const info = new TemplateInfo(t.name, format, attributes, t.access);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n const info = new TypeInfo(type.name, attributes);\n this._types.set(type, info);\n this._updateTypeInfo(info);\n return info;\n }\n _updateTypeInfo(type) {\n var _a, _b;\n const typeSize = this._getTypeSize(type);\n type.size = (_a = typeSize === null || typeSize === void 0 ? void 0 : typeSize.size) !== null && _a !== void 0 ? _a : 0;\n if (type instanceof ArrayInfo) {\n const formatInfo = this._getTypeSize(type[\"format\"]);\n type.stride = (_b = formatInfo === null || formatInfo === void 0 ? void 0 : formatInfo.size) !== null && _b !== void 0 ? _b : 0;\n this._updateTypeInfo(type[\"format\"]);\n }\n if (type instanceof StructInfo) {\n this._updateStructInfo(type);\n }\n }\n _updateStructInfo(struct) {\n var _a;\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n let structAlign = 0;\n for (let mi = 0, ml = struct.members.length; mi < ml; ++mi) {\n const member = struct.members[mi];\n const sizeInfo = this._getTypeSize(member);\n if (!sizeInfo)\n continue;\n (_a = this._getAlias(member.type.name)) !== null && _a !== void 0 ? _a : member.type;\n const align = sizeInfo.align;\n const size = sizeInfo.size;\n offset = this._roundUp(align, offset + lastSize);\n lastSize = size;\n lastOffset = offset;\n structAlign = Math.max(structAlign, align);\n member.offset = offset;\n member.size = size;\n this._updateTypeInfo(member.type);\n }\n struct.size = this._roundUp(structAlign, lastOffset + lastSize);\n struct.align = structAlign;\n }\n _getTypeSize(type) {\n var _a;\n if (type === null || type === undefined)\n return null;\n const explicitSize = this._getAttributeNum(type.attributes, \"size\", 0);\n const explicitAlign = this._getAttributeNum(type.attributes, \"align\", 0);\n if (type instanceof MemberInfo)\n type = type.type;\n if (type instanceof TypeInfo) {\n const alias = this._getAlias(type.name);\n if (alias !== null) {\n type = alias;\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name];\n if (info !== undefined) {\n const divisor = type[\"format\"] === \"f16\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n {\n const info = WgslReflect._typeInfo[type.name.substring(0, type.name.length - 1)];\n if (info) {\n const divisor = type.name[type.name.length - 1] === \"h\" ? 2 : 1;\n return new _TypeSize(Math.max(explicitAlign, info.align / divisor), Math.max(explicitSize, info.size / divisor));\n }\n }\n if (type instanceof ArrayInfo) {\n let arrayType = type;\n let align = 8;\n let size = 8;\n // Type AlignOf(T) Sizeof(T)\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E))\n // array AlignOf(E) N * roundUp(AlignOf(E), SizeOf(E)) (N determined at runtime)\n //\n // @stride(Q)\n // array AlignOf(E) N * Q\n //\n // @stride(Q)\n // array AlignOf(E) Nruntime * Q\n //const E = type.format.name;\n const E = this._getTypeSize(arrayType.format);\n if (E !== null) {\n size = E.size;\n align = E.align;\n }\n const N = arrayType.count;\n const stride = this._getAttributeNum((_a = type === null || type === void 0 ? void 0 : type.attributes) !== null && _a !== void 0 ? _a : null, \"stride\", this._roundUp(align, size));\n size = N * stride;\n if (explicitSize)\n size = explicitSize;\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n if (type instanceof StructInfo) {\n let align = 0;\n let size = 0;\n // struct S AlignOf: max(AlignOfMember(S, M1), ... , AlignOfMember(S, MN))\n // SizeOf: roundUp(AlignOf(S), OffsetOfMember(S, L) + SizeOfMember(S, L))\n // Where L is the last member of the structure\n let offset = 0;\n let lastSize = 0;\n let lastOffset = 0;\n for (const m of type.members) {\n const mi = this._getTypeSize(m.type);\n if (mi !== null) {\n align = Math.max(mi.align, align);\n offset = this._roundUp(mi.align, offset + lastSize);\n lastSize = mi.size;\n lastOffset = offset;\n }\n }\n size = this._roundUp(align, lastOffset + lastSize);\n return new _TypeSize(Math.max(explicitAlign, align), Math.max(explicitSize, size));\n }\n return null;\n }\n _isUniformVar(node) {\n return node instanceof Var && node.storage == \"uniform\";\n }\n _isStorageVar(node) {\n return node instanceof Var && node.storage == \"storage\";\n }\n _isTextureVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._textureTypes.indexOf(node.type.name) != -1);\n }\n _isSamplerVar(node) {\n return (node instanceof Var &&\n node.type !== null &&\n WgslReflect._samplerTypes.indexOf(node.type.name) != -1);\n }\n _getAttribute(node, name) {\n const obj = node;\n if (!obj || !obj[\"attributes\"])\n return null;\n const attrs = obj[\"attributes\"];\n for (let a of attrs) {\n if (a.name == name)\n return a;\n }\n return null;\n }\n _getAttributeNum(attributes, name, defaultValue) {\n if (attributes === null)\n return defaultValue;\n for (let a of attributes) {\n if (a.name == name) {\n let v = a !== null && a.value !== null ? a.value : defaultValue;\n if (v instanceof Array) {\n v = v[0];\n }\n if (typeof v === \"number\") {\n return v;\n }\n if (typeof v === \"string\") {\n return parseInt(v);\n }\n return defaultValue;\n }\n }\n return defaultValue;\n }\n _roundUp(k, n) {\n return Math.ceil(n / k) * k;\n }\n}\n// Type AlignOf(T) Sizeof(T)\n// i32, u32, or f32 4 4\n// atomic 4 4\n// vec2 8 8\n// vec3 16 12\n// vec4 16 16\n// mat2x2 8 16\n// mat3x2 8 24\n// mat4x2 8 32\n// mat2x3 16 32\n// mat3x3 16 48\n// mat4x3 16 64\n// mat2x4 16 32\n// mat3x4 16 48\n// mat4x4 16 64\nWgslReflect._typeInfo = {\n f16: { align: 2, size: 2 },\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n atomic: { align: 4, size: 4 },\n vec2: { align: 8, size: 8 },\n vec3: { align: 16, size: 12 },\n vec4: { align: 16, size: 16 },\n mat2x2: { align: 8, size: 16 },\n mat3x2: { align: 8, size: 24 },\n mat4x2: { align: 8, size: 32 },\n mat2x3: { align: 16, size: 32 },\n mat3x3: { align: 16, size: 48 },\n mat4x3: { align: 16, size: 64 },\n mat2x4: { align: 16, size: 32 },\n mat3x4: { align: 16, size: 48 },\n mat4x4: { align: 16, size: 64 },\n};\nWgslReflect._textureTypes = TokenTypes.any_texture_type.map((t) => {\n return t.name;\n});\nWgslReflect._samplerTypes = TokenTypes.sampler_type.map((t) => {\n return t.name;\n});\n\nexport { Alias, AliasInfo, Argument, ArrayInfo, ArrayType, Assign, AssignOperator, Attribute, BinaryOperator, BitcastExpr, Break, Call, CallExpr, Case, Const, ConstExpr, Continue, Continuing, CreateExpr, Default, Discard, ElseIf, Enable, EntryFunctions, Expression, For, Function, FunctionInfo, GroupingExpr, If, Increment, IncrementOperator, InputInfo, Let, LiteralExpr, Loop, Member, MemberInfo, Node, Operator, OutputInfo, Override, OverrideInfo, ParseContext, PointerType, ResourceType, Return, SamplerType, Statement, StaticAssert, StringExpr, Struct, StructInfo, Switch, SwitchCase, TemplateInfo, TemplateType, Token, TokenClass, TokenType, TokenTypes, Type, TypeInfo, TypecastExpr, UnaryOperator, Var, VariableExpr, VariableInfo, WgslParser, WgslReflect, WgslScanner, While, _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';\n\nexport type FieldDefinition = {\n offset: number;\n type: TypeDefinition;\n};\n\nexport type FieldDefinitions = {\n [x: string]: FieldDefinition;\n};\n\nexport type TypeDefinition = {\n size: number;\n};\n\n// These 3 types are wonky. Maybe we should make them inherit from a common\n// type with a `type` field. I wanted this to be a plain object though, not an object\n// with a constructor. In any case, right now, the way you tell them apart is\n// If it's got `elementType` then it's an ArrayDefinition\n// If it's got `fields` then it's a StructDefinition\n// else it's an IntrinsicDefinition\nexport type StructDefinition = TypeDefinition & {\n fields: FieldDefinitions;\n size: number;\n};\n\nexport type IntrinsicDefinition = TypeDefinition & {\n type: string;\n numElements?: number;\n};\n\nexport type ArrayDefinition = TypeDefinition & {\n elementType: TypeDefinition,\n numElements: number,\n};\n\n/**\n * @group(x) @binding(y) var<...> definition\n */\nexport interface VariableDefinition {\n binding: number;\n group: number;\n size: number;\n typeDefinition: TypeDefinition;\n}\n\nexport type StructDefinitions = {\n [x: string]: StructDefinition;\n};\n\nexport type VariableDefinitions = {\n [x: string]: VariableDefinition;\n};\n\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\ntype ShaderDataDefinitions = {\n uniforms: VariableDefinitions,\n storages: 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 return bindGroupLayoutDescriptorsByGroupByBinding.map(v => ({entries: [...v.values()].sort(byBinding) }));\n}\n\nfunction getNamedVariables(reflect: WgslReflect, variables: VariableInfo[]): VariableDefinitions {\n return Object.fromEntries(variables.map(v => {\n const typeDefinition = addType(reflect, v.type, 0);\n return [\n v.name,\n {\n typeDefinition,\n group: v.group,\n binding: v.binding,\n size: typeDefinition.size,\n },\n ];\n })) as VariableDefinitions;\n}\n\nfunction makeStructDefinition(reflect: WgslReflect, structInfo: StructInfo, offset: number) {\n // StructDefinition\n const fields: FieldDefinitions = Object.fromEntries(structInfo.members.map(m => {\n return [\n m.name,\n {\n offset: m.offset,\n type: addType(reflect, m.type, 0),\n },\n ];\n }));\n return {\n fields,\n size: structInfo.size,\n offset,\n };\n}\n\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 };\n case ResourceType.Storage:\n return {\n binding,\n visibility,\n buffer: {\n type: (access === '' || access === 'read') ? 'read-only-storage' : 'storage',\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);\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 structs,\n storages,\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 */\nfunction addType(reflect: WgslReflect, typeInfo: TypeInfo, offset: number):\n StructDefinition |\n IntrinsicDefinition |\n ArrayDefinition {\n if (typeInfo.isArray) {\n assert(!typeInfo.isStruct, 'struct array is invalid');\n assert(!typeInfo.isStruct, 'template array is invalid');\n const arrayInfo = typeInfo as ArrayInfo;\n // ArrayDefinition\n return {\n size: arrayInfo.size,\n elementType: addType(reflect, arrayInfo.format, offset),\n numElements: arrayInfo.count,\n };\n } else if (typeInfo.isStruct) {\n assert(!typeInfo.isTemplate, 'template struct is invalid');\n const structInfo = typeInfo as StructInfo;\n return makeStructDefinition(reflect, structInfo, offset);\n } else {\n // template is like vec4 or mat4x4\n const asTemplateInfo = typeInfo as TemplateInfo;\n const type = typeInfo.isTemplate\n ? `${asTemplateInfo.name}<${asTemplateInfo.format!.name}>`\n : typeInfo.name;\n // IntrinsicDefinition\n return {\n size: typeInfo.size,\n type,\n };\n }\n}\n","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) {\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\nfunction makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray {\n if (isTypedArray(array)) {\n return array as TypedArray;\n }\n\n let asFullSpec = array as FullArraySpec;\n if (isTypedArray(asFullSpec.data)) {\n return asFullSpec.data as TypedArray;\n }\n\n if (Array.isArray(array) || typeof array === 'number') {\n asFullSpec = {\n data: array,\n };\n }\n\n let Type = asFullSpec.type;\n if (!Type) {\n if (isIndices(name)) {\n Type = Uint32Array;\n } else {\n Type = Float32Array;\n }\n }\n return new Type(asFullSpec.data as any); // ugh!\n}\n\nfunction getArray(array: ArrayUnion): number[] | TypedArray {\n const arr = (array as TypedArray).length ? array : (array as FullArraySpec).data;\n return arr as TypedArray;\n}\n\nconst kNameToNumComponents = [\n { re: /coord|texture|uv/i, numComponents: 2 },\n { re: /color|colour/i, numComponents: 4 },\n];\n\nfunction guessNumComponentsFromNameImpl(name: string) {\n for (const {re, numComponents} of kNameToNumComponents) {\n if (re.test(name)) {\n return numComponents;\n }\n }\n return 3;\n}\n\nfunction guessNumComponentsFromName(name: string, length: number) {\n const numComponents = guessNumComponentsFromNameImpl(name);\n if (length % numComponents > 0) {\n throw new Error(`Can not guess numComponents for attribute '${name}'. Tried ${numComponents} but ${length} values is not evenly divisible by ${numComponents}. You should specify it.`);\n }\n return numComponents;\n}\n\nfunction getNumComponents(array: ArrayUnion , arrayName: string) {\n return (array as FullArraySpec).numComponents || guessNumComponentsFromName(arrayName, getArray(array).length);\n}\n\nconst kVertexFormatRE = /(\\w+)(?:x(\\d))$/;\nfunction numComponentsAndTypeFromVertexFormat(format: GPUVertexFormat) {\n const m = kVertexFormatRE.exec(format);\n const [prefix, numComponents] = m ? [m[1], parseInt(m[2])] : [format, 1];\n return {\n Type: kVertexFormatPrefixToType.get(prefix),\n numComponents,\n };\n}\n\nfunction createTypedArrayOfSameType(typedArray: TypedArray, arrayBuffer: ArrayBuffer) {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n return new Ctor(arrayBuffer);\n}\n\ntype TypedArrayWithOffsetAndStride = {\n data: TypedArray,\n offset: number, /** In elements not bytes */\n stride: number, /** In elements not bytes */\n};\n\n/**\n * Given a set of named arrays, generates an array `GPUBufferLayout`s\n *\n * Examples:\n *\n * ```js\n * const arrays = {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * };\n *\n * const { bufferLayouts, typedArrays } = createBufferLayoutsFromArrays(arrays);\n * ```\n *\n * results in `bufferLayouts` being\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * and `typedArrays` being\n *\n * ```\n * [\n * someFloat32Array0,\n * someFloat32Array1,\n * someFloat32Array2,\n * ]\n * ```\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: If typed arrays are passed in the same typed arrays will come out (copies will not be made)\n */\nexport function createBufferLayoutsFromArrays(arrays: Arrays, options: ArraysOptions = {}) {\n const interleave = options.interleave === undefined ? true : options.interleave;\n const stepMode = options.stepMode || 'vertex';\n const shaderLocations: number[] = options.shaderLocation\n ? (Array.isArray(options.shaderLocation) ? options.shaderLocation : [options.shaderLocation])\n : [0];\n let currentOffset = 0;\n const bufferLayouts: GPUVertexBufferLayout[] = [];\n const attributes: GPUVertexAttribute[] = [];\n const typedArrays: TypedArrayWithOffsetAndStride[] = [];\n Object.keys(arrays)\n .filter(arrayName => !isIndices(arrayName))\n .forEach(arrayName => {\n const array = arrays[arrayName];\n const data = makeTypedArrayFromArrayUnion(array, arrayName);\n const totalNumComponents = getNumComponents(array, arrayName);\n // if totalNumComponents > 4 then we clearly need to split this into multiple\n // attributes\n // (a) <= 4 doesn't mean don't split and\n // (b) how to split? We could divide by 4 and if it's not even then divide by 3\n // as a guess?\n // 5 is error? or 1x4 + 1x1?\n // 6 is 2x3\n // 7 is error? or 1x4 + 1x3?\n // 8 is 2x4\n // 9 is 3x3\n // 10 is error? or 2x4 + 1x2?\n // 11 is error? or 2x4 + 1x3?\n // 12 is 3x4 or 4x3?\n // 13 is error? or 3x4 + 1x1 or 4x3 + 1x1?\n // 14 is error? or 3x4 + 1x2 or 4x3 + 1x2?\n // 15 is error? or 3x4 + 1x3 or 4x3 + 1x3?\n // 16 is 4x4\n const by4 = totalNumComponents / 4;\n const by3 = totalNumComponents / 3;\n const step = by4 % 1 === 0 ? 4 : (by3 % 1 === 0 ? 3 : 4);\n for (let component = 0; component < totalNumComponents; component += step) {\n const numComponents = Math.min(step, totalNumComponents - component);\n const offset = currentOffset;\n currentOffset += numComponents * data.BYTES_PER_ELEMENT;\n const { defaultForType, formats } = kTypedArrayToAttribFormat.get(Object.getPrototypeOf(data).constructor)!;\n const normalize = (array as FullArraySpec).normalize;\n const formatNdx = typeof normalize === 'undefined' ? defaultForType : (normalize ? 1 : 0);\n const format = `${formats[formatNdx]}${numComponents > 1 ? `x${numComponents}` : ''}` as GPUVertexFormat;\n\n // TODO: cleanup with generator?\n const shaderLocation = shaderLocations.shift()!;\n if (shaderLocations.length === 0) {\n shaderLocations.push(shaderLocation + 1);\n }\n attributes.push({\n offset,\n format,\n shaderLocation,\n });\n typedArrays.push({\n data,\n offset: component,\n stride: totalNumComponents,\n });\n }\n if (!interleave) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes.slice(),\n });\n currentOffset = 0;\n attributes.length = 0;\n }\n });\n if (attributes.length) {\n bufferLayouts.push({\n stepMode,\n arrayStride: currentOffset,\n attributes: attributes,\n });\n }\n return {\n bufferLayouts,\n typedArrays,\n };\n}\n\nfunction getTypedArrayWithOffsetAndStride(ta: TypedArray | TypedArrayWithOffsetAndStride, numComponents: number) {\n return (isTypedArray(ta)\n ? { data: ta, offset: 0, stride: numComponents }\n : ta) as TypedArrayWithOffsetAndStride;\n}\n\n/**\n * Given an array of `GPUVertexAttribute`s and a corresponding array\n * of TypedArrays, interleaves the contents of the typed arrays\n * into the given ArrayBuffer\n *\n * example:\n *\n * ```js\n * const attributes: GPUVertexAttribute[] = [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ];\n * const typedArrays = [\n * new Float32Array([1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1]),\n * new Float32Array([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1]),\n * new Float32Array([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1]),\n * ];\n * const arrayStride = (3 + 3 + 2) * 4; // pos + nrm + uv\n * const arrayBuffer = new ArrayBuffer(arrayStride * 24)\n * interleaveVertexData(attributes, typedArrays, arrayStride, arrayBuffer)\n * ```\n *\n * results in the contents of `arrayBuffer` to be the 3 TypedArrays interleaved\n *\n * See {@link Arrays} for details on the various types of arrays.\n *\n * Note: You can generate `attributes` and `typedArrays` above by calling\n * {@link createBufferLayoutsFromArrays}\n */\nexport function interleaveVertexData(\n attributes: GPUVertexAttribute[],\n typedArrays: (TypedArray | TypedArrayWithOffsetAndStride)[],\n arrayStride: number,\n arrayBuffer: ArrayBuffer,\n) {\n const views = new Map();\n const getView = (typedArray: TypedArray) => {\n const Ctor = Object.getPrototypeOf(typedArray).constructor;\n const view = views.get(Ctor);\n if (view) {\n return view;\n }\n const newView = new Ctor(arrayBuffer);\n views.set(Ctor, newView);\n return newView;\n };\n\n attributes.forEach((attribute, ndx) => {\n const { offset, format } = attribute;\n const { numComponents } = numComponentsAndTypeFromVertexFormat(format);\n const {\n data,\n offset: srcOffset,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[ndx], numComponents);\n\n const view = getView(data);\n for (let i = 0; i < data.length; i += stride) {\n const ndx = i / stride;\n const dstOffset = (offset + ndx * arrayStride) / view.BYTES_PER_ELEMENT;\n const srcOff = i + srcOffset;\n const s = data.subarray(srcOff, srcOff + numComponents);\n view.set(s, dstOffset);\n }\n });\n}\n\n/**\n * Given arrays, create buffers, fills the buffers with data if provided, optionally\n * interleaves the data (the default).\n *\n * Example:\n *\n * ```js\n * const {\n * buffers,\n * bufferLayouts,\n * indexBuffer,\n * indexFormat,\n * numElements,\n * } = createBuffersAndAttributesFromArrays(device, {\n * position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],\n * normal: [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],\n * texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n * indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],\n * });\n * ```\n *\n * Where `bufferLayouts` will be\n *\n * ```js\n * [\n * {\n * stepMode: 'vertex',\n * arrayStride: 32,\n * attributes: [\n * { shaderLocation: 0, offset: 0, format: 'float32x3' },\n * { shaderLocation: 1, offset: 12, format: 'float32x3' },\n * { shaderLocation: 2, offset: 24, format: 'float32x2' },\n * ],\n * },\n * ]\n * ```\n *\n * * `buffers` will have one `GPUBuffer` of usage `GPUBufferUsage.VERTEX`\n * * `indexBuffer` will be `GPUBuffer` of usage `GPUBufferUsage.INDEX`\n * * `indexFormat` will be `uint32` (use a full spec or a typedarray of `Uint16Array` if you want 16bit indices)\n * * `numElements` will be 36 (this is either the number entries in the array named `indices` or if no\n * indices are provided then it's the length of the first array divided by numComponents. See {@link Arrays})\n *\n * See {@link Arrays} for details on the various types of arrays.\n * Also see the cube and instancing examples.\n */\nexport function createBuffersAndAttributesFromArrays(device: GPUDevice, arrays: Arrays, options: ArraysOptions = {}) {\n const usage = (options.usage || 0);\n\n const {\n bufferLayouts,\n typedArrays,\n } = createBufferLayoutsFromArrays(arrays, options);\n\n const buffers = [];\n let numElements = -1;\n let bufferNdx = 0;\n for (const {attributes, arrayStride} of bufferLayouts) {\n const attribs = attributes as GPUVertexAttribute[];\n const attrib0 = attribs[0];\n const {numComponents} = numComponentsAndTypeFromVertexFormat(attrib0.format);\n\n const {\n data: data0,\n stride,\n } = getTypedArrayWithOffsetAndStride(typedArrays[bufferNdx], numComponents);\n\n if (numElements < 0) {\n numElements = data0.length / stride;\n }\n\n const size = arrayStride * numElements;\n const buffer = device.createBuffer({\n usage: usage | GPUBufferUsage.VERTEX,\n size,\n mappedAtCreation: true,\n });\n\n const arrayBuffer = buffer.getMappedRange();\n if (attribs.length === 1 && arrayStride === data0.BYTES_PER_ELEMENT * numComponents) {\n const view = createTypedArrayOfSameType(data0, arrayBuffer);\n view.set(data0);\n } else {\n interleaveVertexData(attribs, typedArrays.slice(bufferNdx), arrayStride, arrayBuffer);\n }\n buffer.unmap();\n buffers.push(buffer);\n bufferNdx += attribs.length;\n }\n\n const buffersAndAttributes: BuffersAndAttributes = {\n numElements,\n bufferLayouts,\n buffers,\n };\n\n const indicesEntry = Object.entries(arrays).find(([arrayName]) => isIndices(arrayName));\n if (indicesEntry) {\n const indices = makeTypedArrayFromArrayUnion(indicesEntry[1], 'indices');\n const indexBuffer = device.createBuffer({\n size: indices.byteLength,\n usage: GPUBufferUsage.INDEX | usage,\n mappedAtCreation: true,\n });\n const dst = createTypedArrayOfSameType(indices, indexBuffer.getMappedRange());\n dst.set(indices);\n indexBuffer.unmap();\n\n buffersAndAttributes.indexBuffer = indexBuffer;\n buffersAndAttributes.indexFormat = indices instanceof Uint16Array ? 'uint16' : 'uint32';\n buffersAndAttributes.numElements = indices.length;\n }\n\n return buffersAndAttributes;\n}\n\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) {\n return [\n texture.width,\n texture.height,\n texture.depthOrArrayLayers,\n ].map(v => Math.max(1, Math.floor(v / 2 ** mipLevel)));\n}\n\n/**\n * Uploads Data to a texture\n */\nfunction uploadDataToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureRawDataSource,\n options: { origin?: GPUOrigin3D },\n) {\n const data = toTypedArray((source as TextureData).data || source, texture.format);\n const mipLevel = 0;\n const size = getSizeForMipFromTexture(texture, mipLevel);\n const { bytesPerElement } = getTextureFormatInfo(texture.format);\n const origin = options.origin || [0, 0, 0];\n device.queue.writeTexture(\n { texture, origin },\n data,\n { bytesPerRow: bytesPerElement * size[0], rowsPerImage: size[1] },\n size,\n );\n}\n/**\n * Copies a an array of \"sources\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourcesToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n sources: TextureSource[],\n options: CopyTextureOptions = {},\n) {\n sources.forEach((source, layer) => {\n const origin = [0, 0, layer + (options.baseArrayLayer || 0)];\n if (isTextureRawDataSource(source)) {\n uploadDataToTexture(device, texture, source as TextureRawDataSource, { origin });\n } else {\n const s = source as GPUImageCopyExternalImage['source'];\n const {flipY, premultipliedAlpha, colorSpace} = options;\n device.queue.copyExternalImageToTexture(\n { source: s, flipY, },\n { texture, premultipliedAlpha, colorSpace, origin },\n getSizeFromSource(s, options),\n );\n }\n });\n\n if (texture.mipLevelCount > 1) {\n generateMipmap(device, texture);\n }\n}\n\n\n/**\n * Copies a \"source\" (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * to a texture and then optionally generates mip levels\n */\nexport function copySourceToTexture(\n device: GPUDevice,\n texture: GPUTexture,\n source: TextureSource,\n options: CopyTextureOptions = {}) {\n copySourcesToTexture(device, texture, [source], options);\n}\n\n/**\n * @property mips if true and mipLevelCount is not set then wll automatically generate\n * the correct number of mip levels.\n * @property format Defaults to \"rgba8unorm\"\n * @property mipLeveLCount Defaults to 1 or the number of mips needed for a full mipmap if `mips` is true\n */\nexport type CreateTextureOptions = CopyTextureOptions & {\n mips?: boolean,\n usage?: GPUTextureUsageFlags,\n format?: GPUTextureFormat,\n mipLevelCount?: number,\n};\n\n/**\n * Gets the size from a source. This is to smooth out the fact that different\n * sources have a different way to get their size.\n */\nexport function getSizeFromSource(source: TextureSource, options: CreateTextureOptions) {\n if (source instanceof HTMLVideoElement) {\n return [source.videoWidth, source.videoHeight, 1];\n } else {\n const maybeHasWidthAndHeight = source as { width: number, height: number };\n const { width, height } = maybeHasWidthAndHeight;\n if (width > 0 && height > 0 && !isTextureRawDataSource(source)) {\n // this should cover Canvas, Image, ImageData, ImageBitmap, TextureCreationData\n return [width, height, 1];\n }\n const format = options.format || 'rgba8unorm';\n const { bytesPerElement, bytesPerChannel } = getTextureFormatInfo(format);\n const data = isTypedArray(source) || Array.isArray(source)\n ? source\n : (source as TextureData).data;\n const numBytes = isTypedArray(data)\n ? (data as TypedArray).byteLength\n : ((data as number[]).length * bytesPerChannel);\n const numElements = numBytes / bytesPerElement;\n return guessDimensions(width, height, numElements);\n }\n}\n\n/**\n * Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * [\n * someCanvasOrVideoOrImageImageBitmap0,\n * someCanvasOrVideoOrImageImageBitmap1,\n * ],\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSources(\n device: GPUDevice,\n sources: TextureSource[],\n options: CreateTextureOptions = {}) {\n // NOTE: We assume all the sizes are the same. If they are not you'll get\n // an error.\n const size = getSizeFromSource(sources[0], options);\n size[2] = size[2] > 1 ? size[2] : sources.length;\n\n const texture = device.createTexture({\n dimension: textureViewDimensionToDimension(options.dimension),\n format: options.format || 'rgba8unorm',\n mipLevelCount: options.mipLevelCount\n ? options.mipLevelCount\n : options.mips ? numMipLevels(size) : 1,\n size,\n usage: (options.usage ?? 0) |\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n\n copySourcesToTexture(device, texture, sources, options);\n\n return texture;\n}\n\n/**\n * Create a texture from a source (Video, Canvas, OffscreenCanvas, ImageBitmap)\n * and optionally create mip levels. If you set `mips: true` and don't set a mipLevelCount\n * then it will automatically make the correct number of mip levels.\n *\n * Example:\n *\n * ```js\n * const texture = createTextureFromSource(\n * device,\n * someCanvasOrVideoOrImageImageBitmap,\n * {\n * usage: GPUTextureUsage.TEXTURE_BINDING |\n * GPUTextureUsage.RENDER_ATTACHMENT |\n * GPUTextureUsage.COPY_DST,\n * mips: true,\n * }\n * );\n * ```\n */\nexport function createTextureFromSource(\n device: GPUDevice,\n source: TextureSource,\n options: CreateTextureOptions = {}) {\n return createTextureFromSources(device, [source], options);\n}\n\nexport type CreateTextureFromBitmapOptions = CreateTextureOptions & ImageBitmapOptions;\n\n/**\n * Load an ImageBitmap\n * @param url\n * @param options\n * @returns the loaded ImageBitmap\n */\nexport async function loadImageBitmap(url: string, options: ImageBitmapOptions = {}) {\n const res = await fetch(url);\n const blob = await res.blob();\n const opt: ImageBitmapOptions = {\n ...options,\n ...(options.colorSpaceConversion !== undefined && {colorSpaceConversion: 'none'}),\n };\n return await createImageBitmap(blob, opt);\n}\n\n/**\n * Load images and create a texture from them, optionally generating mip levels\n *\n * Assumes all the urls reference images of the same size.\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(\n * device,\n * [\n * 'https://someimage1.url',\n * 'https://someimage2.url',\n * ],\n * {\n * mips: true,\n * flipY: true,\n * },\n * );\n * ```\n */\nexport async function createTextureFromImages(device: GPUDevice, urls: string[], options: CreateTextureFromBitmapOptions = {}) {\n // TODO: start once we've loaded one?\n // We need at least 1 to know the size of the texture to create\n const imgBitmaps = await Promise.all(urls.map(url => loadImageBitmap(url)));\n return createTextureFromSources(device, imgBitmaps, options);\n}\n\n/**\n * Load an image and create a texture from it, optionally generating mip levels\n *\n * Example:\n *\n * ```js\n * const texture = await createTextureFromImage(device, 'https://someimage.url', {\n * mips: true,\n * flipY: true,\n * });\n * ```\n */\nexport async function createTextureFromImage(device: GPUDevice, url: string, options: CreateTextureFromBitmapOptions = {}) {\n return createTextureFromImages(device, [url], options);\n}\n","/*\n * Copyright 2023 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nimport { isTypedArray, TypedArray, TypedArrayConstructor } from './typed-arrays.js';\nimport { Arrays } from './attribute-utils.js';\n\n/**\n * A class to provide `push` on a typed array.\n *\n * example:\n *\n * ```js\n * const positions = new TypedArrayWrapper(new Float32Array(300), 3);\n * positions.push(1, 2, 3); // add a position\n * positions.push([4, 5, 6]); // add a position\n * positions.push(new Float32Array(6)); // add 2 positions\n * const data = positions.typedArray;\n * ```\n */\nexport class TypedArrayWrapper {\n typedArray: T;\n cursor = 0;\n numComponents: number;\n\n constructor(arr: T, numComponents: number) {\n this.typedArray = arr;\n this.numComponents = numComponents;\n }\n get numElements() {\n return this.typedArray.length / this.numComponents;\n }\n push(...data: (number | Iterable)[]) {\n for (const value of data) {\n if (Array.isArray(value) || isTypedArray(value)) {\n const asArray = data as number[];\n this.typedArray.set(asArray, this.cursor);\n this.cursor += asArray.length;\n } else {\n this.typedArray[this.cursor++] = value as number;\n }\n }\n }\n reset(index = 0) {\n this.cursor = index;\n }\n}\n\n/**\n * creates a typed array with a `push` function attached\n * so that you can easily *push* values.\n *\n * `push` can take multiple arguments. If an argument is an array each element\n * of the array will be added to the typed array.\n *\n * Example:\n *\n * const array = createAugmentedTypedArray(3, 2, Float32Array);\n * array.push(1, 2, 3);\n * array.push([4, 5, 6]);\n * // array now contains [1, 2, 3, 4, 5, 6]\n *\n * Also has `numComponents` and `numElements` properties.\n *\n * @param numComponents number of components\n * @param numElements number of elements. The total size of the array will be `numComponents * numElements`.\n * @param Type A constructor for the type. Default = `Float32Array`.\n */\nfunction createAugmentedTypedArray(numComponents: number, numElements: number, Type: T) {\n return new TypedArrayWrapper(new Type(numComponents * numElements) as InstanceType, numComponents);\n}\n\n/**\n * Creates XY quad vertices\n *\n * The default with no parameters will return a 2x2 quad with values from -1 to +1.\n * If you want a unit quad with that goes from 0 to 1 you'd call it with\n *\n * createXYQuadVertices(1, 0.5, 0.5);\n *\n * If you want a unit quad centered above 0,0 you'd call it with\n *\n * primitives.createXYQuadVertices(1, 0, 0.5);\n *\n * @param 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 } = {}) {\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} = {}) {\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} = {}) {\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} = {}) {\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} = {}) {\n if (radialSubdivisions < 3) {\n throw new Error('radialSubdivisions must be 3 or greater');\n }\n\n if (verticalSubdivisions < 1) {\n throw new Error('verticalSubdivisions must be 1 or greater');\n }\n\n const extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0);\n\n const numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra / 2) * 2, Uint16Array);\n\n const vertsAroundEdge = radialSubdivisions + 1;\n\n // The slant of the cone is constant across its surface\n const slant = Math.atan2(bottomRadius - topRadius, height);\n const cosSlant = Math.cos(slant);\n const sinSlant = Math.sin(slant);\n\n const start = topCap ? -2 : 0;\n const end = verticalSubdivisions + (bottomCap ? 2 : 0);\n\n for (let yy = start; yy <= end; ++yy) {\n let v = yy / verticalSubdivisions;\n let y = height * v;\n let ringRadius;\n if (yy < 0) {\n y = 0;\n v = 1;\n ringRadius = bottomRadius;\n } else if (yy > verticalSubdivisions) {\n y = height;\n v = 1;\n ringRadius = topRadius;\n } else {\n ringRadius = bottomRadius +\n (topRadius - bottomRadius) * (yy / verticalSubdivisions);\n }\n if (yy === -2 || yy === verticalSubdivisions + 2) {\n ringRadius = 0;\n v = 0;\n }\n y -= height / 2;\n for (let ii = 0; ii < vertsAroundEdge; ++ii) {\n const sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions);\n const cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions);\n positions.push(sin * ringRadius, y, cos * ringRadius);\n if (yy < 0) {\n normals.push(0, -1, 0);\n } else if (yy > verticalSubdivisions) {\n normals.push(0, 1, 0);\n } else if (ringRadius === 0.0) {\n normals.push(0, 0, 0);\n } else {\n normals.push(sin * cosSlant, sinSlant, cos * cosSlant);\n }\n texcoords.push((ii / radialSubdivisions), 1 - v);\n }\n }\n\n for (let yy = 0; yy < verticalSubdivisions + extra; ++yy) { // eslint-disable-line\n if (yy === 1 && topCap || yy === verticalSubdivisions + extra - 2 && bottomCap) {\n continue;\n }\n for (let ii = 0; ii < radialSubdivisions; ++ii) { // eslint-disable-line\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 0) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii);\n indices.push(vertsAroundEdge * (yy + 0) + 0 + ii,\n vertsAroundEdge * (yy + 1) + 1 + ii,\n vertsAroundEdge * (yy + 1) + 0 + ii);\n }\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n/**\n * Expands RLE data\n * @param rleData data in format of run-length, x, y, z, run-length, x, y, z\n * @param padding value to add each entry with.\n * @return the expanded rleData\n */\nfunction expandRLEData(rleData: number[], padding: number[] = []) {\n padding = padding || [];\n const data: number[] = [];\n for (let ii = 0; ii < rleData.length; ii += 4) {\n const runLength = rleData[ii];\n const element = rleData.slice(ii + 1, ii + 4);\n element.push(...padding);\n for (let jj = 0; jj < runLength; ++jj) {\n data.push(...element);\n }\n }\n return data;\n}\n\n/**\n * Creates 3D 'F' vertices.\n * An 'F' is useful because you can easily tell which way it is oriented.\n * The created 'F' has position, normal, texcoord, and color arrays.\n *\n * @return The created vertices.\n */\nexport function create3DFVertices() {\n const positions = [\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung front\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // front of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // front of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0,\n ];\n\n const texcoords = [\n // left column front\n 0.22, 0.19,\n 0.22, 0.79,\n 0.34, 0.19,\n 0.22, 0.79,\n 0.34, 0.79,\n 0.34, 0.19,\n\n // top rung front\n 0.34, 0.19,\n 0.34, 0.31,\n 0.62, 0.19,\n 0.34, 0.31,\n 0.62, 0.31,\n 0.62, 0.19,\n\n // middle rung front\n 0.34, 0.43,\n 0.34, 0.55,\n 0.49, 0.43,\n 0.34, 0.55,\n 0.49, 0.55,\n 0.49, 0.43,\n\n // left column back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // middle rung back\n 0, 0,\n 1, 0,\n 0, 1,\n 0, 1,\n 1, 0,\n 1, 1,\n\n // top\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // top rung front\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 0,\n 1, 1,\n 0, 1,\n\n // under top rung\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // between top rung and middle\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // top of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // front of middle rung\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom of middle rung.\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // front of bottom\n 0, 0,\n 1, 1,\n 0, 1,\n 0, 0,\n 1, 0,\n 1, 1,\n\n // bottom\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n\n // left side\n 0, 0,\n 0, 1,\n 1, 1,\n 0, 0,\n 1, 1,\n 1, 0,\n ];\n\n const normals = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 0, 0, 1,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 0, 0, -1,\n\n // top\n 6, 0, 1, 0,\n\n // top rung front\n 6, 1, 0, 0,\n\n // under top rung\n 6, 0, -1, 0,\n\n // between top rung and middle\n 6, 1, 0, 0,\n\n // top of middle rung\n 6, 0, 1, 0,\n\n // front of middle rung\n 6, 1, 0, 0,\n\n // bottom of middle rung.\n 6, 0, -1, 0,\n\n // front of bottom\n 6, 1, 0, 0,\n\n // bottom\n 6, 0, -1, 0,\n\n // left side\n 6, -1, 0, 0,\n ]);\n\n const colors = expandRLEData([\n // left column front\n // top rung front\n // middle rung front\n 18, 200, 70, 120,\n\n // left column back\n // top rung back\n // middle rung back\n 18, 80, 70, 200,\n\n // top\n 6, 70, 200, 210,\n\n // top rung front\n 6, 200, 200, 70,\n\n // under top rung\n 6, 210, 100, 70,\n\n // between top rung and middle\n 6, 210, 160, 70,\n\n // top of middle rung\n 6, 70, 180, 210,\n\n // front of middle rung\n 6, 100, 70, 210,\n\n // bottom of middle rung.\n 6, 76, 210, 100,\n\n // front of bottom\n 6, 140, 210, 80,\n\n // bottom\n 6, 90, 130, 110,\n\n // left side\n 6, 160, 160, 220,\n ], [255]);\n\n const numVerts = positions.length / 3;\n\n const arrays = {\n position: createAugmentedTypedArray(3, numVerts, Float32Array),\n texcoord: createAugmentedTypedArray(2, numVerts, Float32Array),\n normal: createAugmentedTypedArray(3, numVerts, Float32Array),\n color: createAugmentedTypedArray(4, numVerts, Uint8Array),\n indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array),\n };\n\n arrays.position.push(positions);\n arrays.texcoord.push(texcoords);\n arrays.normal.push(normals);\n arrays.color.push(colors);\n\n for (let ii = 0; ii < numVerts; ++ii) {\n arrays.indices.push(ii);\n }\n\n return Object.fromEntries(Object.entries(arrays).map(([k, v]) => [k, v.typedArray]));\n}\n\n/**\n * Creates crescent vertices.\n *\n * @param params\n * @param params.verticalRadius The vertical radius of the crescent. Default = 2\n * @param params.outerRadius The outer radius of the crescent. Default = 1\n * @param params.innerRadius The inner radius of the crescent. Default = 0\n * @param params.thickness The thickness of the crescent. Default = 1\n * @param params.subdivisionsDown number of steps around the crescent. Default = 12\n * @param params.startOffset Where to start arc. Default 0. Default = 0\n * @param params.endOffset Where to end arg. Default 1. Default = 1\n * @return The created vertices.\n */\nexport function createCrescentVertices({\n verticalRadius = 2,\n outerRadius = 1,\n innerRadius = 0,\n thickness = 1,\n subdivisionsDown = 12,\n startOffset = 0,\n endOffset = 1,\n} = {}) {\n if (subdivisionsDown <= 0) {\n throw new Error('subdivisionDown must be > 0');\n }\n\n const subdivisionsThick = 2;\n\n const offsetRange = endOffset - startOffset;\n const numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick);\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n\n function lerp(a: number, b: number, s: number) {\n return a + (b - a) * s;\n }\n\n function vAdd(a: number[], b: number[]) {\n return a.map((v, i) => v + b[i]);\n }\n\n function vMultiply(a: number[], b: number[]) {\n return a.map((v, i) => v * b[i]);\n }\n\n function createArc(arcRadius: number, x: number, normalMult: number[], normalAdd: number[], uMult: number, uAdd: number) {\n for (let z = 0; z <= subdivisionsDown; z++) {\n const uBack = x / (subdivisionsThick - 1);\n const v = z / subdivisionsDown;\n const xBack = (uBack - 0.5) * 2;\n const angle = (startOffset + (v * offsetRange)) * Math.PI;\n const s = Math.sin(angle);\n const c = Math.cos(angle);\n const radius = lerp(verticalRadius, arcRadius, s);\n const px = xBack * thickness;\n const py = c * verticalRadius;\n const pz = s * radius;\n positions.push(px, py, pz);\n const n = vAdd(vMultiply([0, s, c], normalMult), normalAdd);\n normals.push(n);\n texcoords.push(uBack * uMult + uAdd, v);\n }\n }\n\n // Generate the individual vertices in our vertex buffer.\n for (let x = 0; x < subdivisionsThick; x++) {\n const uBack = (x / (subdivisionsThick - 1) - 0.5) * 2;\n createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0);\n createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0);\n createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1);\n }\n\n // Do outer surface.\n const indices = createAugmentedTypedArray(3, (subdivisionsDown * 2) * (2 + subdivisionsThick), Uint16Array);\n\n function createSurface(leftArcOffset: number, rightArcOffset: number) {\n for (let z = 0; z < subdivisionsDown; ++z) {\n // Make triangle 1 of quad.\n indices.push(\n leftArcOffset + z + 0,\n leftArcOffset + z + 1,\n rightArcOffset + z + 0);\n\n // Make triangle 2 of quad.\n indices.push(\n leftArcOffset + z + 1,\n rightArcOffset + z + 1,\n rightArcOffset + z + 0);\n }\n }\n\n const numVerticesDown = subdivisionsDown + 1;\n // front\n createSurface(numVerticesDown * 0, numVerticesDown * 4);\n // right\n createSurface(numVerticesDown * 5, numVerticesDown * 7);\n // back\n createSurface(numVerticesDown * 6, numVerticesDown * 2);\n // left\n createSurface(numVerticesDown * 3, numVerticesDown * 1);\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n\n /**\n * Creates cylinder vertices. The cylinder will be created around the origin\n * along the y-axis.\n *\n * @param 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} = {}) {\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} = {}) {\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} = {}) {\n if (divisions < 3) {\n throw new Error('divisions must be at least 3');\n }\n\n // Note: We don't share the center vertex because that would\n // mess up texture coordinates.\n const numVertices = (divisions + 1) * (stacks + 1);\n\n const positions = createAugmentedTypedArray(3, numVertices, Float32Array);\n const normals = createAugmentedTypedArray(3, numVertices, Float32Array);\n const texcoords = createAugmentedTypedArray(2, numVertices, Float32Array);\n const indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array);\n\n let firstIndex = 0;\n const radiusSpan = radius - innerRadius;\n const pointsPerStack = divisions + 1;\n\n // Build the disk one stack at a time.\n for (let stack = 0; stack <= stacks; ++stack) {\n const stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower);\n\n for (let i = 0; i <= divisions; ++i) {\n const theta = 2.0 * Math.PI * i / divisions;\n const x = stackRadius * Math.cos(theta);\n const z = stackRadius * Math.sin(theta);\n\n positions.push(x, 0, z);\n normals.push(0, 1, 0);\n texcoords.push(1 - (i / divisions), stack / stacks);\n if (stack > 0 && i !== divisions) {\n // a, b, c and d are the indices of the vertices of a quad. unless\n // the current stack is the one closest to the center, in which case\n // the vertices a and b connect to the center vertex.\n const a = firstIndex + (i + 1);\n const b = firstIndex + i;\n const c = firstIndex + i - pointsPerStack;\n const d = firstIndex + (i + 1) - pointsPerStack;\n\n // Make a quad of the vertices a, b, c, d.\n indices.push(a, b, c);\n indices.push(a, c, d);\n }\n }\n\n firstIndex += divisions + 1;\n }\n\n return {\n position: positions.typedArray,\n normal: normals.typedArray,\n texcoord: texcoords.typedArray,\n indices: indices.typedArray,\n };\n}\n"],"names":[],"mappings":";AAAO,MAAM,mBAAmB,GAAG,CAAC,CAAS,EAAE,QAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,C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2..d506eb4 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -21,8 +21,6 @@ --dark-hl-9: #C8C8C8; --light-hl-10: #267F99; --dark-hl-10: #4EC9B0; - --light-hl-11: #CD3131; - --dark-hl-11: #F44747; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } @@ -39,7 +37,6 @@ --hl-8: var(--light-hl-8); --hl-9: var(--light-hl-9); --hl-10: var(--light-hl-10); - --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } } @@ -55,7 +52,6 @@ --hl-8: var(--dark-hl-8); --hl-9: var(--dark-hl-9); --hl-10: var(--dark-hl-10); - --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } } @@ -71,7 +67,6 @@ --hl-8: var(--light-hl-8); --hl-9: var(--light-hl-9); --hl-10: var(--light-hl-10); - --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } @@ -87,7 +82,6 @@ --hl-8: var(--dark-hl-8); --hl-9: var(--dark-hl-9); --hl-10: var(--dark-hl-10); - --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } @@ -102,5 +96,4 @@ .hl-8 { color: var(--hl-8); } .hl-9 { color: var(--hl-9); } .hl-10 { color: var(--hl-10); } -.hl-11 { color: var(--hl-11); } pre, code { background: var(--code-background); } diff --git a/docs/assets/search.js b/docs/assets/search.js index 48b79c2..aa50b81 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":4,\"name\":\"primitives\",\"url\":\"modules/primitives.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createXYQuadVertices\",\"url\":\"functions/primitives.createXYQuadVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":64,\"name\":\"createPlaneVertices\",\"url\":\"functions/primitives.createPlaneVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":64,\"name\":\"createSphereVertices\",\"url\":\"functions/primitives.createSphereVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":64,\"name\":\"createCubeVertices\",\"url\":\"functions/primitives.createCubeVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":64,\"name\":\"createTruncatedConeVertices\",\"url\":\"functions/primitives.createTruncatedConeVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":64,\"name\":\"create3DFVertices\",\"url\":\"functions/primitives.create3DFVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.create3DFVertices.html#create3DFVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.create3DFVertices.create3DFVertices\"},{\"kind\":64,\"name\":\"createCrescentVertices\",\"url\":\"functions/primitives.createCrescentVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":64,\"name\":\"createCylinderVertices\",\"url\":\"functions/primitives.createCylinderVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":64,\"name\":\"createTorusVertices\",\"url\":\"functions/primitives.createTorusVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":64,\"name\":\"createDiscVertices\",\"url\":\"functions/primitives.createDiscVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":128,\"name\":\"TypedArrayWrapper\",\"url\":\"classes/primitives.TypedArrayWrapper.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/primitives.TypedArrayWrapper.html#constructor\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":1024,\"name\":\"typedArray\",\"url\":\"classes/primitives.TypedArrayWrapper.html#typedArray\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":1024,\"name\":\"cursor\",\"url\":\"classes/primitives.TypedArrayWrapper.html#cursor\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":1024,\"name\":\"numComponents\",\"url\":\"classes/primitives.TypedArrayWrapper.html#numComponents\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":262144,\"name\":\"numElements\",\"url\":\"classes/primitives.TypedArrayWrapper.html#numElements\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":2048,\"name\":\"push\",\"url\":\"classes/primitives.TypedArrayWrapper.html#push\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":2048,\"name\":\"reset\",\"url\":\"classes/primitives.TypedArrayWrapper.html#reset\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":64,\"name\":\"setIntrinsicsToView\",\"url\":\"functions/setIntrinsicsToView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"makeTypedArrayViews\",\"url\":\"functions/makeTypedArrayViews.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setStructuredView\",\"url\":\"functions/setStructuredView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"makeStructuredView\",\"url\":\"functions/makeStructuredView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setTypedValues\",\"url\":\"functions/setTypedValues.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setStructuredValues\",\"url\":\"functions/setStructuredValues.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"getSizeAndAlignmentOfUnsizedArrayElement\",\"url\":\"functions/getSizeAndAlignmentOfUnsizedArrayElement.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/getSizeAndAlignmentOfUnsizedArrayElement.html#getSizeAndAlignmentOfUnsizedArrayElement.__type\",\"classes\":\"\",\"parent\":\"getSizeAndAlignmentOfUnsizedArrayElement.getSizeAndAlignmentOfUnsizedArrayElement\"},{\"kind\":1024,\"name\":\"size\",\"url\":\"functions/getSizeAndAlignmentOfUnsizedArrayElement.html#getSizeAndAlignmentOfUnsizedArrayElement.__type.size\",\"classes\":\"\",\"parent\":\"getSizeAndAlignmentOfUnsizedArrayElement.getSizeAndAlignmentOfUnsizedArrayElement.__type\"},{\"kind\":1024,\"name\":\"align\",\"url\":\"functions/getSizeAndAlignmentOfUnsizedArrayElement.html#getSizeAndAlignmentOfUnsizedArrayElement.__type.align\",\"classes\":\"\",\"parent\":\"getSizeAndAlignmentOfUnsizedArrayElement.getSizeAndAlignmentOfUnsizedArrayElement.__type\"},{\"kind\":4194304,\"name\":\"kType\",\"url\":\"types/kType.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"kTypes\",\"url\":\"variables/kTypes.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TypedArrayOrViews\",\"url\":\"types/TypedArrayOrViews.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"Views\",\"url\":\"interfaces/Views.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"ArrayBufferViews\",\"url\":\"types/ArrayBufferViews.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/ArrayBufferViews.html#__type\",\"classes\":\"\",\"parent\":\"ArrayBufferViews\"},{\"kind\":1024,\"name\":\"views\",\"url\":\"types/ArrayBufferViews.html#__type.views\",\"classes\":\"\",\"parent\":\"ArrayBufferViews.__type\"},{\"kind\":1024,\"name\":\"arrayBuffer\",\"url\":\"types/ArrayBufferViews.html#__type.arrayBuffer\",\"classes\":\"\",\"parent\":\"ArrayBufferViews.__type\"},{\"kind\":4194304,\"name\":\"StructuredView\",\"url\":\"types/StructuredView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"makeBindGroupLayoutDescriptors\",\"url\":\"functions/makeBindGroupLayoutDescriptors.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"makeShaderDataDefinitions\",\"url\":\"functions/makeShaderDataDefinitions.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"FieldDefinition\",\"url\":\"types/FieldDefinition.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/FieldDefinition.html#__type\",\"classes\":\"\",\"parent\":\"FieldDefinition\"},{\"kind\":1024,\"name\":\"offset\",\"url\":\"types/FieldDefinition.html#__type.offset\",\"classes\":\"\",\"parent\":\"FieldDefinition.__type\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"types/FieldDefinition.html#__type.type\",\"classes\":\"\",\"parent\":\"FieldDefinition.__type\"},{\"kind\":4194304,\"name\":\"FieldDefinitions\",\"url\":\"types/FieldDefinitions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/FieldDefinitions.html#__type\",\"classes\":\"\",\"parent\":\"FieldDefinitions\"},{\"kind\":4194304,\"name\":\"TypeDefinition\",\"url\":\"types/TypeDefinition.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/TypeDefinition.html#__type\",\"classes\":\"\",\"parent\":\"TypeDefinition\"},{\"kind\":1024,\"name\":\"size\",\"url\":\"types/TypeDefinition.html#__type.size\",\"classes\":\"\",\"parent\":\"TypeDefinition.__type\"},{\"kind\":4194304,\"name\":\"StructDefinition\",\"url\":\"types/StructDefinition.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"IntrinsicDefinition\",\"url\":\"types/IntrinsicDefinition.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"ArrayDefinition\",\"url\":\"types/ArrayDefinition.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"VariableDefinition\",\"url\":\"interfaces/VariableDefinition.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"binding\",\"url\":\"interfaces/VariableDefinition.html#binding\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":1024,\"name\":\"group\",\"url\":\"interfaces/VariableDefinition.html#group\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":1024,\"name\":\"size\",\"url\":\"interfaces/VariableDefinition.html#size\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":1024,\"name\":\"typeDefinition\",\"url\":\"interfaces/VariableDefinition.html#typeDefinition\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":4194304,\"name\":\"StructDefinitions\",\"url\":\"types/StructDefinitions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/StructDefinitions.html#__type\",\"classes\":\"\",\"parent\":\"StructDefinitions\"},{\"kind\":4194304,\"name\":\"VariableDefinitions\",\"url\":\"types/VariableDefinitions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/VariableDefinitions.html#__type\",\"classes\":\"\",\"parent\":\"VariableDefinitions\"},{\"kind\":4194304,\"name\":\"Resource\",\"url\":\"types/Resource.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/Resource.html#__type\",\"classes\":\"\",\"parent\":\"Resource\"},{\"kind\":1024,\"name\":\"name\",\"url\":\"types/Resource.html#__type.name\",\"classes\":\"\",\"parent\":\"Resource.__type\"},{\"kind\":1024,\"name\":\"group\",\"url\":\"types/Resource.html#__type.group\",\"classes\":\"\",\"parent\":\"Resource.__type\"},{\"kind\":1024,\"name\":\"entry\",\"url\":\"types/Resource.html#__type.entry\",\"classes\":\"\",\"parent\":\"Resource.__type\"},{\"kind\":4194304,\"name\":\"EntryPoint\",\"url\":\"types/EntryPoint.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/EntryPoint.html#__type\",\"classes\":\"\",\"parent\":\"EntryPoint\"},{\"kind\":1024,\"name\":\"stage\",\"url\":\"types/EntryPoint.html#__type.stage\",\"classes\":\"\",\"parent\":\"EntryPoint.__type\"},{\"kind\":1024,\"name\":\"resources\",\"url\":\"types/EntryPoint.html#__type.resources\",\"classes\":\"\",\"parent\":\"EntryPoint.__type\"},{\"kind\":4194304,\"name\":\"EntryPoints\",\"url\":\"types/EntryPoints.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/EntryPoints.html#__type\",\"classes\":\"\",\"parent\":\"EntryPoints\"},{\"kind\":4194304,\"name\":\"ProgrammableStage\",\"url\":\"types/ProgrammableStage.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/ProgrammableStage.html#__type\",\"classes\":\"\",\"parent\":\"ProgrammableStage\"},{\"kind\":1024,\"name\":\"entryPoint\",\"url\":\"types/ProgrammableStage.html#__type.entryPoint\",\"classes\":\"\",\"parent\":\"ProgrammableStage.__type\"},{\"kind\":4194304,\"name\":\"PipelineDescriptor\",\"url\":\"types/PipelineDescriptor.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/PipelineDescriptor.html#__type\",\"classes\":\"\",\"parent\":\"PipelineDescriptor\"},{\"kind\":1024,\"name\":\"vertex\",\"url\":\"types/PipelineDescriptor.html#__type.vertex\",\"classes\":\"\",\"parent\":\"PipelineDescriptor.__type\"},{\"kind\":1024,\"name\":\"fragment\",\"url\":\"types/PipelineDescriptor.html#__type.fragment\",\"classes\":\"\",\"parent\":\"PipelineDescriptor.__type\"},{\"kind\":1024,\"name\":\"compute\",\"url\":\"types/PipelineDescriptor.html#__type.compute\",\"classes\":\"\",\"parent\":\"PipelineDescriptor.__type\"},{\"kind\":64,\"name\":\"normalizeGPUExtent3D\",\"url\":\"functions/normalizeGPUExtent3D.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"numMipLevels\",\"url\":\"functions/numMipLevels.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"generateMipmap\",\"url\":\"functions/generateMipmap.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createBufferLayoutsFromArrays\",\"url\":\"functions/createBufferLayoutsFromArrays.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/createBufferLayoutsFromArrays.html#createBufferLayoutsFromArrays.__type\",\"classes\":\"\",\"parent\":\"createBufferLayoutsFromArrays.createBufferLayoutsFromArrays\"},{\"kind\":1024,\"name\":\"bufferLayouts\",\"url\":\"functions/createBufferLayoutsFromArrays.html#createBufferLayoutsFromArrays.__type.bufferLayouts\",\"classes\":\"\",\"parent\":\"createBufferLayoutsFromArrays.createBufferLayoutsFromArrays.__type\"},{\"kind\":1024,\"name\":\"typedArrays\",\"url\":\"functions/createBufferLayoutsFromArrays.html#createBufferLayoutsFromArrays.__type.typedArrays\",\"classes\":\"\",\"parent\":\"createBufferLayoutsFromArrays.createBufferLayoutsFromArrays.__type\"},{\"kind\":64,\"name\":\"interleaveVertexData\",\"url\":\"functions/interleaveVertexData.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createBuffersAndAttributesFromArrays\",\"url\":\"functions/createBuffersAndAttributesFromArrays.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setVertexAndIndexBuffers\",\"url\":\"functions/setVertexAndIndexBuffers.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"drawArrays\",\"url\":\"functions/drawArrays.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"FullArraySpec\",\"url\":\"types/FullArraySpec.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/FullArraySpec.html#__type\",\"classes\":\"\",\"parent\":\"FullArraySpec\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"types/FullArraySpec.html#__type.data\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"types/FullArraySpec.html#__type.type\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"numComponents\",\"url\":\"types/FullArraySpec.html#__type.numComponents\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"shaderLocation\",\"url\":\"types/FullArraySpec.html#__type.shaderLocation\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"normalize\",\"url\":\"types/FullArraySpec.html#__type.normalize\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":4194304,\"name\":\"ArrayUnion\",\"url\":\"types/ArrayUnion.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"Arrays\",\"url\":\"types/Arrays.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/Arrays.html#__type\",\"classes\":\"\",\"parent\":\"Arrays\"},{\"kind\":4194304,\"name\":\"ArraysOptions\",\"url\":\"types/ArraysOptions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/ArraysOptions.html#__type\",\"classes\":\"\",\"parent\":\"ArraysOptions\"},{\"kind\":1024,\"name\":\"interleave\",\"url\":\"types/ArraysOptions.html#__type.interleave\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":1024,\"name\":\"stepMode\",\"url\":\"types/ArraysOptions.html#__type.stepMode\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":1024,\"name\":\"usage\",\"url\":\"types/ArraysOptions.html#__type.usage\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":1024,\"name\":\"shaderLocation\",\"url\":\"types/ArraysOptions.html#__type.shaderLocation\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":4194304,\"name\":\"BuffersAndAttributes\",\"url\":\"types/BuffersAndAttributes.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/BuffersAndAttributes.html#__type\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes\"},{\"kind\":1024,\"name\":\"numElements\",\"url\":\"types/BuffersAndAttributes.html#__type.numElements\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"bufferLayouts\",\"url\":\"types/BuffersAndAttributes.html#__type.bufferLayouts\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"buffers\",\"url\":\"types/BuffersAndAttributes.html#__type.buffers\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"indexBuffer\",\"url\":\"types/BuffersAndAttributes.html#__type.indexBuffer\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"indexFormat\",\"url\":\"types/BuffersAndAttributes.html#__type.indexFormat\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":64,\"name\":\"getSizeForMipFromTexture\",\"url\":\"functions/getSizeForMipFromTexture.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"copySourcesToTexture\",\"url\":\"functions/copySourcesToTexture.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"copySourceToTexture\",\"url\":\"functions/copySourceToTexture.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"getSizeFromSource\",\"url\":\"functions/getSizeFromSource.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromSources\",\"url\":\"functions/createTextureFromSources.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromSource\",\"url\":\"functions/createTextureFromSource.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"loadImageBitmap\",\"url\":\"functions/loadImageBitmap.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromImages\",\"url\":\"functions/createTextureFromImages.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromImage\",\"url\":\"functions/createTextureFromImage.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"CopyTextureOptions\",\"url\":\"types/CopyTextureOptions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/CopyTextureOptions.html#__type\",\"classes\":\"\",\"parent\":\"CopyTextureOptions\"},{\"kind\":1024,\"name\":\"flipY\",\"url\":\"types/CopyTextureOptions.html#__type.flipY\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"premultipliedAlpha\",\"url\":\"types/CopyTextureOptions.html#__type.premultipliedAlpha\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"colorSpace\",\"url\":\"types/CopyTextureOptions.html#__type.colorSpace\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"dimension\",\"url\":\"types/CopyTextureOptions.html#__type.dimension\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"baseArrayLayer\",\"url\":\"types/CopyTextureOptions.html#__type.baseArrayLayer\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":4194304,\"name\":\"TextureData\",\"url\":\"types/TextureData.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/TextureData.html#__type\",\"classes\":\"\",\"parent\":\"TextureData\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"types/TextureData.html#__type.data\",\"classes\":\"\",\"parent\":\"TextureData.__type\"},{\"kind\":4194304,\"name\":\"TextureCreationData\",\"url\":\"types/TextureCreationData.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TextureRawDataSource\",\"url\":\"types/TextureRawDataSource.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TextureSource\",\"url\":\"types/TextureSource.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"CreateTextureOptions\",\"url\":\"types/CreateTextureOptions.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"CreateTextureFromBitmapOptions\",\"url\":\"types/CreateTextureFromBitmapOptions.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"subarray\",\"url\":\"functions/subarray.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TypedArrayConstructor\",\"url\":\"types/TypedArrayConstructor.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TypedArray\",\"url\":\"types/TypedArray.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"TypedArrayViewGenerator\",\"url\":\"classes/TypedArrayViewGenerator.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/TypedArrayViewGenerator.html#constructor\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":1024,\"name\":\"arrayBuffer\",\"url\":\"classes/TypedArrayViewGenerator.html#arrayBuffer\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":1024,\"name\":\"byteOffset\",\"url\":\"classes/TypedArrayViewGenerator.html#byteOffset\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":2048,\"name\":\"align\",\"url\":\"classes/TypedArrayViewGenerator.html#align\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":2048,\"name\":\"pad\",\"url\":\"classes/TypedArrayViewGenerator.html#pad\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":2048,\"name\":\"getView\",\"url\":\"classes/TypedArrayViewGenerator.html#getView\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":64,\"name\":\"isTypedArray\",\"url\":\"functions/isTypedArray.html\",\"classes\":\"\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,48.468]],[\"comment/0\",[]],[\"name/1\",[1,48.468]],[\"comment/1\",[]],[\"name/2\",[2,48.468]],[\"comment/2\",[]],[\"name/3\",[3,19.024]],[\"comment/3\",[]],[\"name/4\",[4,31.122]],[\"comment/4\",[]],[\"name/5\",[5,31.122]],[\"comment/5\",[]],[\"name/6\",[6,31.122]],[\"comment/6\",[]],[\"name/7\",[7,31.122]],[\"comment/7\",[]],[\"name/8\",[8,48.468]],[\"comment/8\",[]],[\"name/9\",[3,19.024]],[\"comment/9\",[]],[\"name/10\",[4,31.122]],[\"comment/10\",[]],[\"name/11\",[5,31.122]],[\"comment/11\",[]],[\"name/12\",[6,31.122]],[\"comment/12\",[]],[\"name/13\",[7,31.122]],[\"comment/13\",[]],[\"name/14\",[9,48.468]],[\"comment/14\",[]],[\"name/15\",[3,19.024]],[\"comment/15\",[]],[\"name/16\",[4,31.122]],[\"comment/16\",[]],[\"name/17\",[5,31.122]],[\"comment/17\",[]],[\"name/18\",[6,31.122]],[\"comment/18\",[]],[\"name/19\",[7,31.122]],[\"comment/19\",[]],[\"name/20\",[10,48.468]],[\"comment/20\",[]],[\"name/21\",[3,19.024]],[\"comment/21\",[]],[\"name/22\",[4,31.122]],[\"comment/22\",[]],[\"name/23\",[5,31.122]],[\"comment/23\",[]],[\"name/24\",[6,31.122]],[\"comment/24\",[]],[\"name/25\",[7,31.122]],[\"comment/25\",[]],[\"name/26\",[11,48.468]],[\"comment/26\",[]],[\"name/27\",[3,19.024]],[\"comment/27\",[]],[\"name/28\",[12,48.468]],[\"comment/28\",[]],[\"name/29\",[3,19.024]],[\"comment/29\",[]],[\"name/30\",[4,31.122]],[\"comment/30\",[]],[\"name/31\",[5,31.122]],[\"comment/31\",[]],[\"name/32\",[6,31.122]],[\"comment/32\",[]],[\"name/33\",[7,31.122]],[\"comment/33\",[]],[\"name/34\",[13,48.468]],[\"comment/34\",[]],[\"name/35\",[3,19.024]],[\"comment/35\",[]],[\"name/36\",[4,31.122]],[\"comment/36\",[]],[\"name/37\",[5,31.122]],[\"comment/37\",[]],[\"name/38\",[6,31.122]],[\"comment/38\",[]],[\"name/39\",[7,31.122]],[\"comment/39\",[]],[\"name/40\",[14,48.468]],[\"comment/40\",[]],[\"name/41\",[3,19.024]],[\"comment/41\",[]],[\"name/42\",[4,31.122]],[\"comment/42\",[]],[\"name/43\",[5,31.122]],[\"comment/43\",[]],[\"name/44\",[6,31.122]],[\"comment/44\",[]],[\"name/45\",[7,31.122]],[\"comment/45\",[]],[\"name/46\",[15,48.468]],[\"comment/46\",[]],[\"name/47\",[3,19.024]],[\"comment/47\",[]],[\"name/48\",[4,31.122]],[\"comment/48\",[]],[\"name/49\",[5,31.122]],[\"comment/49\",[]],[\"name/50\",[6,31.122]],[\"comment/50\",[]],[\"name/51\",[7,31.122]],[\"comment/51\",[]],[\"name/52\",[16,48.468]],[\"comment/52\",[]],[\"name/53\",[17,43.36]],[\"comment/53\",[]],[\"name/54\",[18,43.36]],[\"comment/54\",[]],[\"name/55\",[19,48.468]],[\"comment/55\",[]],[\"name/56\",[20,43.36]],[\"comment/56\",[]],[\"name/57\",[21,43.36]],[\"comment/57\",[]],[\"name/58\",[22,48.468]],[\"comment/58\",[]],[\"name/59\",[23,48.468]],[\"comment/59\",[]],[\"name/60\",[24,48.468]],[\"comment/60\",[]],[\"name/61\",[25,48.468]],[\"comment/61\",[]],[\"name/62\",[26,48.468]],[\"comment/62\",[]],[\"name/63\",[27,48.468]],[\"comment/63\",[]],[\"name/64\",[28,48.468]],[\"comment/64\",[]],[\"name/65\",[29,48.468]],[\"comment/65\",[]],[\"name/66\",[30,48.468]],[\"comment/66\",[]],[\"name/67\",[3,19.024]],[\"comment/67\",[]],[\"name/68\",[31,39.995]],[\"comment/68\",[]],[\"name/69\",[32,43.36]],[\"comment/69\",[]],[\"name/70\",[33,48.468]],[\"comment/70\",[]],[\"name/71\",[34,48.468]],[\"comment/71\",[]],[\"name/72\",[35,48.468]],[\"comment/72\",[]],[\"name/73\",[36,43.36]],[\"comment/73\",[]],[\"name/74\",[37,48.468]],[\"comment/74\",[]],[\"name/75\",[3,19.024]],[\"comment/75\",[]],[\"name/76\",[36,43.36]],[\"comment/76\",[]],[\"name/77\",[38,43.36]],[\"comment/77\",[]],[\"name/78\",[39,48.468]],[\"comment/78\",[]],[\"name/79\",[40,48.468]],[\"comment/79\",[]],[\"name/80\",[41,48.468]],[\"comment/80\",[]],[\"name/81\",[42,48.468]],[\"comment/81\",[]],[\"name/82\",[3,19.024]],[\"comment/82\",[]],[\"name/83\",[43,48.468]],[\"comment/83\",[]],[\"name/84\",[44,43.36]],[\"comment/84\",[]],[\"name/85\",[45,48.468]],[\"comment/85\",[]],[\"name/86\",[3,19.024]],[\"comment/86\",[]],[\"name/87\",[46,43.36]],[\"comment/87\",[]],[\"name/88\",[3,19.024]],[\"comment/88\",[]],[\"name/89\",[31,39.995]],[\"comment/89\",[]],[\"name/90\",[47,48.468]],[\"comment/90\",[]],[\"name/91\",[48,48.468]],[\"comment/91\",[]],[\"name/92\",[49,48.468]],[\"comment/92\",[]],[\"name/93\",[50,48.468]],[\"comment/93\",[]],[\"name/94\",[51,48.468]],[\"comment/94\",[]],[\"name/95\",[52,43.36]],[\"comment/95\",[]],[\"name/96\",[31,39.995]],[\"comment/96\",[]],[\"name/97\",[46,43.36]],[\"comment/97\",[]],[\"name/98\",[53,48.468]],[\"comment/98\",[]],[\"name/99\",[3,19.024]],[\"comment/99\",[]],[\"name/100\",[54,48.468]],[\"comment/100\",[]],[\"name/101\",[3,19.024]],[\"comment/101\",[]],[\"name/102\",[55,48.468]],[\"comment/102\",[]],[\"name/103\",[3,19.024]],[\"comment/103\",[]],[\"name/104\",[56,48.468]],[\"comment/104\",[]],[\"name/105\",[52,43.36]],[\"comment/105\",[]],[\"name/106\",[57,48.468]],[\"comment/106\",[]],[\"name/107\",[58,43.36]],[\"comment/107\",[]],[\"name/108\",[3,19.024]],[\"comment/108\",[]],[\"name/109\",[59,48.468]],[\"comment/109\",[]],[\"name/110\",[60,48.468]],[\"comment/110\",[]],[\"name/111\",[61,48.468]],[\"comment/111\",[]],[\"name/112\",[3,19.024]],[\"comment/112\",[]],[\"name/113\",[62,48.468]],[\"comment/113\",[]],[\"name/114\",[3,19.024]],[\"comment/114\",[]],[\"name/115\",[58,43.36]],[\"comment/115\",[]],[\"name/116\",[63,48.468]],[\"comment/116\",[]],[\"name/117\",[3,19.024]],[\"comment/117\",[]],[\"name/118\",[64,48.468]],[\"comment/118\",[]],[\"name/119\",[65,48.468]],[\"comment/119\",[]],[\"name/120\",[66,48.468]],[\"comment/120\",[]],[\"name/121\",[67,48.468]],[\"comment/121\",[]],[\"name/122\",[68,48.468]],[\"comment/122\",[]],[\"name/123\",[69,48.468]],[\"comment/123\",[]],[\"name/124\",[70,48.468]],[\"comment/124\",[]],[\"name/125\",[3,19.024]],[\"comment/125\",[]],[\"name/126\",[71,43.36]],[\"comment/126\",[]],[\"name/127\",[72,48.468]],[\"comment/127\",[]],[\"name/128\",[73,48.468]],[\"comment/128\",[]],[\"name/129\",[74,48.468]],[\"comment/129\",[]],[\"name/130\",[75,48.468]],[\"comment/130\",[]],[\"name/131\",[76,48.468]],[\"comment/131\",[]],[\"name/132\",[77,48.468]],[\"comment/132\",[]],[\"name/133\",[3,19.024]],[\"comment/133\",[]],[\"name/134\",[78,43.36]],[\"comment/134\",[]],[\"name/135\",[44,43.36]],[\"comment/135\",[]],[\"name/136\",[20,43.36]],[\"comment/136\",[]],[\"name/137\",[79,43.36]],[\"comment/137\",[]],[\"name/138\",[80,48.468]],[\"comment/138\",[]],[\"name/139\",[81,48.468]],[\"comment/139\",[]],[\"name/140\",[82,48.468]],[\"comment/140\",[]],[\"name/141\",[3,19.024]],[\"comment/141\",[]],[\"name/142\",[83,48.468]],[\"comment/142\",[]],[\"name/143\",[3,19.024]],[\"comment/143\",[]],[\"name/144\",[84,48.468]],[\"comment/144\",[]],[\"name/145\",[85,48.468]],[\"comment/145\",[]],[\"name/146\",[86,48.468]],[\"comment/146\",[]],[\"name/147\",[79,43.36]],[\"comment/147\",[]],[\"name/148\",[87,48.468]],[\"comment/148\",[]],[\"name/149\",[3,19.024]],[\"comment/149\",[]],[\"name/150\",[21,43.36]],[\"comment/150\",[]],[\"name/151\",[71,43.36]],[\"comment/151\",[]],[\"name/152\",[88,48.468]],[\"comment/152\",[]],[\"name/153\",[89,48.468]],[\"comment/153\",[]],[\"name/154\",[90,48.468]],[\"comment/154\",[]],[\"name/155\",[91,48.468]],[\"comment/155\",[]],[\"name/156\",[92,48.468]],[\"comment/156\",[]],[\"name/157\",[93,48.468]],[\"comment/157\",[]],[\"name/158\",[94,48.468]],[\"comment/158\",[]],[\"name/159\",[95,48.468]],[\"comment/159\",[]],[\"name/160\",[96,48.468]],[\"comment/160\",[]],[\"name/161\",[97,48.468]],[\"comment/161\",[]],[\"name/162\",[98,48.468]],[\"comment/162\",[]],[\"name/163\",[99,48.468]],[\"comment/163\",[]],[\"name/164\",[100,48.468]],[\"comment/164\",[]],[\"name/165\",[3,19.024]],[\"comment/165\",[]],[\"name/166\",[101,48.468]],[\"comment/166\",[]],[\"name/167\",[102,48.468]],[\"comment/167\",[]],[\"name/168\",[103,48.468]],[\"comment/168\",[]],[\"name/169\",[104,48.468]],[\"comment/169\",[]],[\"name/170\",[105,48.468]],[\"comment/170\",[]],[\"name/171\",[106,48.468]],[\"comment/171\",[]],[\"name/172\",[3,19.024]],[\"comment/172\",[]],[\"name/173\",[78,43.36]],[\"comment/173\",[]],[\"name/174\",[107,48.468]],[\"comment/174\",[]],[\"name/175\",[108,48.468]],[\"comment/175\",[]],[\"name/176\",[109,48.468]],[\"comment/176\",[]],[\"name/177\",[110,48.468]],[\"comment/177\",[]],[\"name/178\",[111,48.468]],[\"comment/178\",[]],[\"name/179\",[112,48.468]],[\"comment/179\",[]],[\"name/180\",[113,48.468]],[\"comment/180\",[]],[\"name/181\",[18,43.36]],[\"comment/181\",[]],[\"name/182\",[114,48.468]],[\"comment/182\",[]],[\"name/183\",[17,43.36]],[\"comment/183\",[]],[\"name/184\",[38,43.36]],[\"comment/184\",[]],[\"name/185\",[115,48.468]],[\"comment/185\",[]],[\"name/186\",[32,43.36]],[\"comment/186\",[]],[\"name/187\",[116,48.468]],[\"comment/187\",[]],[\"name/188\",[117,48.468]],[\"comment/188\",[]],[\"name/189\",[118,48.468]],[\"comment/189\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":3,\"name\":{\"3\":{},\"9\":{},\"15\":{},\"21\":{},\"27\":{},\"29\":{},\"35\":{},\"41\":{},\"47\":{},\"67\":{},\"75\":{},\"82\":{},\"86\":{},\"88\":{},\"99\":{},\"101\":{},\"103\":{},\"108\":{},\"112\":{},\"114\":{},\"117\":{},\"125\":{},\"133\":{},\"141\":{},\"143\":{},\"149\":{},\"165\":{},\"172\":{}},\"comment\":{}}],[\"align\",{\"_index\":32,\"name\":{\"69\":{},\"186\":{}},\"comment\":{}}],[\"arraybuffer\",{\"_index\":38,\"name\":{\"77\":{},\"184\":{}},\"comment\":{}}],[\"arraybufferviews\",{\"_index\":37,\"name\":{\"74\":{}},\"comment\":{}}],[\"arraydefinition\",{\"_index\":49,\"name\":{\"92\":{}},\"comment\":{}}],[\"arrays\",{\"_index\":82,\"name\":{\"140\":{}},\"comment\":{}}],[\"arraysoptions\",{\"_index\":83,\"name\":{\"142\":{}},\"comment\":{}}],[\"arrayunion\",{\"_index\":81,\"name\":{\"139\":{}},\"comment\":{}}],[\"basearraylayer\",{\"_index\":105,\"name\":{\"170\":{}},\"comment\":{}}],[\"binding\",{\"_index\":51,\"name\":{\"94\":{}},\"comment\":{}}],[\"bufferlayouts\",{\"_index\":71,\"name\":{\"126\":{},\"151\":{}},\"comment\":{}}],[\"buffers\",{\"_index\":88,\"name\":{\"152\":{}},\"comment\":{}}],[\"buffersandattributes\",{\"_index\":87,\"name\":{\"148\":{}},\"comment\":{}}],[\"byteoffset\",{\"_index\":115,\"name\":{\"185\":{}},\"comment\":{}}],[\"colorspace\",{\"_index\":103,\"name\":{\"168\":{}},\"comment\":{}}],[\"compute\",{\"_index\":66,\"name\":{\"120\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":17,\"name\":{\"53\":{},\"183\":{}},\"comment\":{}}],[\"copysourcestotexture\",{\"_index\":92,\"name\":{\"156\":{}},\"comment\":{}}],[\"copysourcetotexture\",{\"_index\":93,\"name\":{\"157\":{}},\"comment\":{}}],[\"copytextureoptions\",{\"_index\":100,\"name\":{\"164\":{}},\"comment\":{}}],[\"create3dfvertices\",{\"_index\":11,\"name\":{\"26\":{}},\"comment\":{}}],[\"createbufferlayoutsfromarrays\",{\"_index\":70,\"name\":{\"124\":{}},\"comment\":{}}],[\"createbuffersandattributesfromarrays\",{\"_index\":74,\"name\":{\"129\":{}},\"comment\":{}}],[\"createcrescentvertices\",{\"_index\":12,\"name\":{\"28\":{}},\"comment\":{}}],[\"createcubevertices\",{\"_index\":9,\"name\":{\"14\":{}},\"comment\":{}}],[\"createcylindervertices\",{\"_index\":13,\"name\":{\"34\":{}},\"comment\":{}}],[\"creatediscvertices\",{\"_index\":15,\"name\":{\"46\":{}},\"comment\":{}}],[\"createplanevertices\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"createspherevertices\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"createtexturefrombitmapoptions\",{\"_index\":111,\"name\":{\"178\":{}},\"comment\":{}}],[\"createtexturefromimage\",{\"_index\":99,\"name\":{\"163\":{}},\"comment\":{}}],[\"createtexturefromimages\",{\"_index\":98,\"name\":{\"162\":{}},\"comment\":{}}],[\"createtexturefromsource\",{\"_index\":96,\"name\":{\"160\":{}},\"comment\":{}}],[\"createtexturefromsources\",{\"_index\":95,\"name\":{\"159\":{}},\"comment\":{}}],[\"createtextureoptions\",{\"_index\":110,\"name\":{\"177\":{}},\"comment\":{}}],[\"createtorusvertices\",{\"_index\":14,\"name\":{\"40\":{}},\"comment\":{}}],[\"createtruncatedconevertices\",{\"_index\":10,\"name\":{\"20\":{}},\"comment\":{}}],[\"createxyquadvertices\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"cursor\",{\"_index\":19,\"name\":{\"55\":{}},\"comment\":{}}],[\"data\",{\"_index\":78,\"name\":{\"134\":{},\"173\":{}},\"comment\":{}}],[\"dimension\",{\"_index\":104,\"name\":{\"169\":{}},\"comment\":{}}],[\"drawarrays\",{\"_index\":76,\"name\":{\"131\":{}},\"comment\":{}}],[\"entry\",{\"_index\":57,\"name\":{\"106\":{}},\"comment\":{}}],[\"entrypoint\",{\"_index\":58,\"name\":{\"107\":{},\"115\":{}},\"comment\":{}}],[\"entrypoints\",{\"_index\":61,\"name\":{\"111\":{}},\"comment\":{}}],[\"fielddefinition\",{\"_index\":42,\"name\":{\"81\":{}},\"comment\":{}}],[\"fielddefinitions\",{\"_index\":45,\"name\":{\"85\":{}},\"comment\":{}}],[\"flipy\",{\"_index\":101,\"name\":{\"166\":{}},\"comment\":{}}],[\"fragment\",{\"_index\":65,\"name\":{\"119\":{}},\"comment\":{}}],[\"fullarrayspec\",{\"_index\":77,\"name\":{\"132\":{}},\"comment\":{}}],[\"generatemipmap\",{\"_index\":69,\"name\":{\"123\":{}},\"comment\":{}}],[\"getsizeandalignmentofunsizedarrayelement\",{\"_index\":30,\"name\":{\"66\":{}},\"comment\":{}}],[\"getsizeformipfromtexture\",{\"_index\":91,\"name\":{\"155\":{}},\"comment\":{}}],[\"getsizefromsource\",{\"_index\":94,\"name\":{\"158\":{}},\"comment\":{}}],[\"getview\",{\"_index\":117,\"name\":{\"188\":{}},\"comment\":{}}],[\"group\",{\"_index\":52,\"name\":{\"95\":{},\"105\":{}},\"comment\":{}}],[\"indexbuffer\",{\"_index\":89,\"name\":{\"153\":{}},\"comment\":{}}],[\"indexformat\",{\"_index\":90,\"name\":{\"154\":{}},\"comment\":{}}],[\"indices\",{\"_index\":7,\"name\":{\"7\":{},\"13\":{},\"19\":{},\"25\":{},\"33\":{},\"39\":{},\"45\":{},\"51\":{}},\"comment\":{}}],[\"interleave\",{\"_index\":84,\"name\":{\"144\":{}},\"comment\":{}}],[\"interleavevertexdata\",{\"_index\":73,\"name\":{\"128\":{}},\"comment\":{}}],[\"intrinsicdefinition\",{\"_index\":48,\"name\":{\"91\":{}},\"comment\":{}}],[\"istypedarray\",{\"_index\":118,\"name\":{\"189\":{}},\"comment\":{}}],[\"ktype\",{\"_index\":33,\"name\":{\"70\":{}},\"comment\":{}}],[\"ktypes\",{\"_index\":34,\"name\":{\"71\":{}},\"comment\":{}}],[\"loadimagebitmap\",{\"_index\":97,\"name\":{\"161\":{}},\"comment\":{}}],[\"makebindgrouplayoutdescriptors\",{\"_index\":40,\"name\":{\"79\":{}},\"comment\":{}}],[\"makeshaderdatadefinitions\",{\"_index\":41,\"name\":{\"80\":{}},\"comment\":{}}],[\"makestructuredview\",{\"_index\":27,\"name\":{\"63\":{}},\"comment\":{}}],[\"maketypedarrayviews\",{\"_index\":25,\"name\":{\"61\":{}},\"comment\":{}}],[\"name\",{\"_index\":56,\"name\":{\"104\":{}},\"comment\":{}}],[\"normal\",{\"_index\":5,\"name\":{\"5\":{},\"11\":{},\"17\":{},\"23\":{},\"31\":{},\"37\":{},\"43\":{},\"49\":{}},\"comment\":{}}],[\"normalize\",{\"_index\":80,\"name\":{\"138\":{}},\"comment\":{}}],[\"normalizegpuextent3d\",{\"_index\":67,\"name\":{\"121\":{}},\"comment\":{}}],[\"numcomponents\",{\"_index\":20,\"name\":{\"56\":{},\"136\":{}},\"comment\":{}}],[\"numelements\",{\"_index\":21,\"name\":{\"57\":{},\"150\":{}},\"comment\":{}}],[\"nummiplevels\",{\"_index\":68,\"name\":{\"122\":{}},\"comment\":{}}],[\"offset\",{\"_index\":43,\"name\":{\"83\":{}},\"comment\":{}}],[\"pad\",{\"_index\":116,\"name\":{\"187\":{}},\"comment\":{}}],[\"pipelinedescriptor\",{\"_index\":63,\"name\":{\"116\":{}},\"comment\":{}}],[\"position\",{\"_index\":4,\"name\":{\"4\":{},\"10\":{},\"16\":{},\"22\":{},\"30\":{},\"36\":{},\"42\":{},\"48\":{}},\"comment\":{}}],[\"premultipliedalpha\",{\"_index\":102,\"name\":{\"167\":{}},\"comment\":{}}],[\"primitives\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"programmablestage\",{\"_index\":62,\"name\":{\"113\":{}},\"comment\":{}}],[\"push\",{\"_index\":22,\"name\":{\"58\":{}},\"comment\":{}}],[\"reset\",{\"_index\":23,\"name\":{\"59\":{}},\"comment\":{}}],[\"resource\",{\"_index\":55,\"name\":{\"102\":{}},\"comment\":{}}],[\"resources\",{\"_index\":60,\"name\":{\"110\":{}},\"comment\":{}}],[\"setintrinsicstoview\",{\"_index\":24,\"name\":{\"60\":{}},\"comment\":{}}],[\"setstructuredvalues\",{\"_index\":29,\"name\":{\"65\":{}},\"comment\":{}}],[\"setstructuredview\",{\"_index\":26,\"name\":{\"62\":{}},\"comment\":{}}],[\"settypedvalues\",{\"_index\":28,\"name\":{\"64\":{}},\"comment\":{}}],[\"setvertexandindexbuffers\",{\"_index\":75,\"name\":{\"130\":{}},\"comment\":{}}],[\"shaderlocation\",{\"_index\":79,\"name\":{\"137\":{},\"147\":{}},\"comment\":{}}],[\"size\",{\"_index\":31,\"name\":{\"68\":{},\"89\":{},\"96\":{}},\"comment\":{}}],[\"stage\",{\"_index\":59,\"name\":{\"109\":{}},\"comment\":{}}],[\"stepmode\",{\"_index\":85,\"name\":{\"145\":{}},\"comment\":{}}],[\"structdefinition\",{\"_index\":47,\"name\":{\"90\":{}},\"comment\":{}}],[\"structdefinitions\",{\"_index\":53,\"name\":{\"98\":{}},\"comment\":{}}],[\"structuredview\",{\"_index\":39,\"name\":{\"78\":{}},\"comment\":{}}],[\"subarray\",{\"_index\":112,\"name\":{\"179\":{}},\"comment\":{}}],[\"texcoord\",{\"_index\":6,\"name\":{\"6\":{},\"12\":{},\"18\":{},\"24\":{},\"32\":{},\"38\":{},\"44\":{},\"50\":{}},\"comment\":{}}],[\"texturecreationdata\",{\"_index\":107,\"name\":{\"174\":{}},\"comment\":{}}],[\"texturedata\",{\"_index\":106,\"name\":{\"171\":{}},\"comment\":{}}],[\"texturerawdatasource\",{\"_index\":108,\"name\":{\"175\":{}},\"comment\":{}}],[\"texturesource\",{\"_index\":109,\"name\":{\"176\":{}},\"comment\":{}}],[\"type\",{\"_index\":44,\"name\":{\"84\":{},\"135\":{}},\"comment\":{}}],[\"typedarray\",{\"_index\":18,\"name\":{\"54\":{},\"181\":{}},\"comment\":{}}],[\"typedarrayconstructor\",{\"_index\":113,\"name\":{\"180\":{}},\"comment\":{}}],[\"typedarrayorviews\",{\"_index\":35,\"name\":{\"72\":{}},\"comment\":{}}],[\"typedarrays\",{\"_index\":72,\"name\":{\"127\":{}},\"comment\":{}}],[\"typedarrayviewgenerator\",{\"_index\":114,\"name\":{\"182\":{}},\"comment\":{}}],[\"typedarraywrapper\",{\"_index\":16,\"name\":{\"52\":{}},\"comment\":{}}],[\"typedefinition\",{\"_index\":46,\"name\":{\"87\":{},\"97\":{}},\"comment\":{}}],[\"usage\",{\"_index\":86,\"name\":{\"146\":{}},\"comment\":{}}],[\"variabledefinition\",{\"_index\":50,\"name\":{\"93\":{}},\"comment\":{}}],[\"variabledefinitions\",{\"_index\":54,\"name\":{\"100\":{}},\"comment\":{}}],[\"vertex\",{\"_index\":64,\"name\":{\"118\":{}},\"comment\":{}}],[\"views\",{\"_index\":36,\"name\":{\"73\":{},\"76\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = JSON.parse("{\"rows\":[{\"kind\":4,\"name\":\"primitives\",\"url\":\"modules/primitives.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createXYQuadVertices\",\"url\":\"functions/primitives.createXYQuadVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":64,\"name\":\"createPlaneVertices\",\"url\":\"functions/primitives.createPlaneVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createPlaneVertices.html#createPlaneVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createPlaneVertices.createPlaneVertices.__type\"},{\"kind\":64,\"name\":\"createSphereVertices\",\"url\":\"functions/primitives.createSphereVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createSphereVertices.html#createSphereVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createSphereVertices.createSphereVertices.__type\"},{\"kind\":64,\"name\":\"createCubeVertices\",\"url\":\"functions/primitives.createCubeVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createCubeVertices.html#createCubeVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createCubeVertices.createCubeVertices.__type\"},{\"kind\":64,\"name\":\"createTruncatedConeVertices\",\"url\":\"functions/primitives.createTruncatedConeVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createTruncatedConeVertices.html#createTruncatedConeVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createTruncatedConeVertices.createTruncatedConeVertices.__type\"},{\"kind\":64,\"name\":\"create3DFVertices\",\"url\":\"functions/primitives.create3DFVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.create3DFVertices.html#create3DFVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.create3DFVertices.create3DFVertices\"},{\"kind\":64,\"name\":\"createCrescentVertices\",\"url\":\"functions/primitives.createCrescentVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createCrescentVertices.html#createCrescentVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createCrescentVertices.createCrescentVertices.__type\"},{\"kind\":64,\"name\":\"createCylinderVertices\",\"url\":\"functions/primitives.createCylinderVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createCylinderVertices.html#createCylinderVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createCylinderVertices.createCylinderVertices.__type\"},{\"kind\":64,\"name\":\"createTorusVertices\",\"url\":\"functions/primitives.createTorusVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createTorusVertices.html#createTorusVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createTorusVertices.createTorusVertices.__type\"},{\"kind\":64,\"name\":\"createDiscVertices\",\"url\":\"functions/primitives.createDiscVertices.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices\"},{\"kind\":1024,\"name\":\"position\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.position\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":1024,\"name\":\"normal\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.normal\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":1024,\"name\":\"texcoord\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.texcoord\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":1024,\"name\":\"indices\",\"url\":\"functions/primitives.createDiscVertices.html#createDiscVertices.__type.indices\",\"classes\":\"\",\"parent\":\"primitives.createDiscVertices.createDiscVertices.__type\"},{\"kind\":128,\"name\":\"TypedArrayWrapper\",\"url\":\"classes/primitives.TypedArrayWrapper.html\",\"classes\":\"\",\"parent\":\"primitives\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/primitives.TypedArrayWrapper.html#constructor\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":1024,\"name\":\"typedArray\",\"url\":\"classes/primitives.TypedArrayWrapper.html#typedArray\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":1024,\"name\":\"cursor\",\"url\":\"classes/primitives.TypedArrayWrapper.html#cursor\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":1024,\"name\":\"numComponents\",\"url\":\"classes/primitives.TypedArrayWrapper.html#numComponents\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":262144,\"name\":\"numElements\",\"url\":\"classes/primitives.TypedArrayWrapper.html#numElements\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":2048,\"name\":\"push\",\"url\":\"classes/primitives.TypedArrayWrapper.html#push\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":2048,\"name\":\"reset\",\"url\":\"classes/primitives.TypedArrayWrapper.html#reset\",\"classes\":\"\",\"parent\":\"primitives.TypedArrayWrapper\"},{\"kind\":64,\"name\":\"makeTypedArrayViews\",\"url\":\"functions/makeTypedArrayViews.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setStructuredView\",\"url\":\"functions/setStructuredView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"makeStructuredView\",\"url\":\"functions/makeStructuredView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setTypedValues\",\"url\":\"functions/setTypedValues.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"setStructuredValues\",\"url\":\"functions/setStructuredValues.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TypedArrayOrViews\",\"url\":\"types/TypedArrayOrViews.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"Views\",\"url\":\"interfaces/Views.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"ArrayBufferViews\",\"url\":\"types/ArrayBufferViews.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/ArrayBufferViews.html#__type\",\"classes\":\"\",\"parent\":\"ArrayBufferViews\"},{\"kind\":1024,\"name\":\"views\",\"url\":\"types/ArrayBufferViews.html#__type.views\",\"classes\":\"\",\"parent\":\"ArrayBufferViews.__type\"},{\"kind\":1024,\"name\":\"arrayBuffer\",\"url\":\"types/ArrayBufferViews.html#__type.arrayBuffer\",\"classes\":\"\",\"parent\":\"ArrayBufferViews.__type\"},{\"kind\":4194304,\"name\":\"StructuredView\",\"url\":\"types/StructuredView.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"makeShaderDataDefinitions\",\"url\":\"functions/makeShaderDataDefinitions.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"FieldDefinition\",\"url\":\"types/FieldDefinition.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/FieldDefinition.html#__type\",\"classes\":\"\",\"parent\":\"FieldDefinition\"},{\"kind\":1024,\"name\":\"offset\",\"url\":\"types/FieldDefinition.html#__type.offset\",\"classes\":\"\",\"parent\":\"FieldDefinition.__type\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"types/FieldDefinition.html#__type.type\",\"classes\":\"\",\"parent\":\"FieldDefinition.__type\"},{\"kind\":4194304,\"name\":\"FieldDefinitions\",\"url\":\"types/FieldDefinitions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/FieldDefinitions.html#__type\",\"classes\":\"\",\"parent\":\"FieldDefinitions\"},{\"kind\":4194304,\"name\":\"TypeDefinition\",\"url\":\"types/TypeDefinition.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/TypeDefinition.html#__type\",\"classes\":\"\",\"parent\":\"TypeDefinition\"},{\"kind\":1024,\"name\":\"size\",\"url\":\"types/TypeDefinition.html#__type.size\",\"classes\":\"\",\"parent\":\"TypeDefinition.__type\"},{\"kind\":4194304,\"name\":\"StructDefinition\",\"url\":\"types/StructDefinition.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"IntrinsicDefinition\",\"url\":\"types/IntrinsicDefinition.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"ArrayDefinition\",\"url\":\"types/ArrayDefinition.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"VariableDefinition\",\"url\":\"interfaces/VariableDefinition.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"binding\",\"url\":\"interfaces/VariableDefinition.html#binding\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":1024,\"name\":\"group\",\"url\":\"interfaces/VariableDefinition.html#group\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":1024,\"name\":\"size\",\"url\":\"interfaces/VariableDefinition.html#size\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":1024,\"name\":\"typeDefinition\",\"url\":\"interfaces/VariableDefinition.html#typeDefinition\",\"classes\":\"\",\"parent\":\"VariableDefinition\"},{\"kind\":4194304,\"name\":\"StructDefinitions\",\"url\":\"types/StructDefinitions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/StructDefinitions.html#__type\",\"classes\":\"\",\"parent\":\"StructDefinitions\"},{\"kind\":4194304,\"name\":\"VariableDefinitions\",\"url\":\"types/VariableDefinitions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/VariableDefinitions.html#__type\",\"classes\":\"\",\"parent\":\"VariableDefinitions\"},{\"kind\":64,\"name\":\"normalizeGPUExtent3D\",\"url\":\"functions/normalizeGPUExtent3D.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"numMipLevels\",\"url\":\"functions/numMipLevels.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"generateMipmap\",\"url\":\"functions/generateMipmap.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createBufferLayoutsFromArrays\",\"url\":\"functions/createBufferLayoutsFromArrays.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"functions/createBufferLayoutsFromArrays.html#createBufferLayoutsFromArrays.__type\",\"classes\":\"\",\"parent\":\"createBufferLayoutsFromArrays.createBufferLayoutsFromArrays\"},{\"kind\":1024,\"name\":\"bufferLayouts\",\"url\":\"functions/createBufferLayoutsFromArrays.html#createBufferLayoutsFromArrays.__type.bufferLayouts\",\"classes\":\"\",\"parent\":\"createBufferLayoutsFromArrays.createBufferLayoutsFromArrays.__type\"},{\"kind\":1024,\"name\":\"typedArrays\",\"url\":\"functions/createBufferLayoutsFromArrays.html#createBufferLayoutsFromArrays.__type.typedArrays\",\"classes\":\"\",\"parent\":\"createBufferLayoutsFromArrays.createBufferLayoutsFromArrays.__type\"},{\"kind\":64,\"name\":\"interleaveVertexData\",\"url\":\"functions/interleaveVertexData.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createBuffersAndAttributesFromArrays\",\"url\":\"functions/createBuffersAndAttributesFromArrays.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"FullArraySpec\",\"url\":\"types/FullArraySpec.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/FullArraySpec.html#__type\",\"classes\":\"\",\"parent\":\"FullArraySpec\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"types/FullArraySpec.html#__type.data\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"types/FullArraySpec.html#__type.type\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"numComponents\",\"url\":\"types/FullArraySpec.html#__type.numComponents\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"shaderLocation\",\"url\":\"types/FullArraySpec.html#__type.shaderLocation\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":1024,\"name\":\"normalize\",\"url\":\"types/FullArraySpec.html#__type.normalize\",\"classes\":\"\",\"parent\":\"FullArraySpec.__type\"},{\"kind\":4194304,\"name\":\"ArrayUnion\",\"url\":\"types/ArrayUnion.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"Arrays\",\"url\":\"types/Arrays.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/Arrays.html#__type\",\"classes\":\"\",\"parent\":\"Arrays\"},{\"kind\":4194304,\"name\":\"ArraysOptions\",\"url\":\"types/ArraysOptions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/ArraysOptions.html#__type\",\"classes\":\"\",\"parent\":\"ArraysOptions\"},{\"kind\":1024,\"name\":\"interleave\",\"url\":\"types/ArraysOptions.html#__type.interleave\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":1024,\"name\":\"stepMode\",\"url\":\"types/ArraysOptions.html#__type.stepMode\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":1024,\"name\":\"usage\",\"url\":\"types/ArraysOptions.html#__type.usage\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":1024,\"name\":\"shaderLocation\",\"url\":\"types/ArraysOptions.html#__type.shaderLocation\",\"classes\":\"\",\"parent\":\"ArraysOptions.__type\"},{\"kind\":4194304,\"name\":\"BuffersAndAttributes\",\"url\":\"types/BuffersAndAttributes.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/BuffersAndAttributes.html#__type\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes\"},{\"kind\":1024,\"name\":\"numElements\",\"url\":\"types/BuffersAndAttributes.html#__type.numElements\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"bufferLayouts\",\"url\":\"types/BuffersAndAttributes.html#__type.bufferLayouts\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"buffers\",\"url\":\"types/BuffersAndAttributes.html#__type.buffers\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"indexBuffer\",\"url\":\"types/BuffersAndAttributes.html#__type.indexBuffer\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":1024,\"name\":\"indexFormat\",\"url\":\"types/BuffersAndAttributes.html#__type.indexFormat\",\"classes\":\"\",\"parent\":\"BuffersAndAttributes.__type\"},{\"kind\":64,\"name\":\"getSizeForMipFromTexture\",\"url\":\"functions/getSizeForMipFromTexture.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"copySourcesToTexture\",\"url\":\"functions/copySourcesToTexture.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"copySourceToTexture\",\"url\":\"functions/copySourceToTexture.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"getSizeFromSource\",\"url\":\"functions/getSizeFromSource.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromSources\",\"url\":\"functions/createTextureFromSources.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromSource\",\"url\":\"functions/createTextureFromSource.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"loadImageBitmap\",\"url\":\"functions/loadImageBitmap.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromImages\",\"url\":\"functions/createTextureFromImages.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"createTextureFromImage\",\"url\":\"functions/createTextureFromImage.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"CopyTextureOptions\",\"url\":\"types/CopyTextureOptions.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/CopyTextureOptions.html#__type\",\"classes\":\"\",\"parent\":\"CopyTextureOptions\"},{\"kind\":1024,\"name\":\"flipY\",\"url\":\"types/CopyTextureOptions.html#__type.flipY\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"premultipliedAlpha\",\"url\":\"types/CopyTextureOptions.html#__type.premultipliedAlpha\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"colorSpace\",\"url\":\"types/CopyTextureOptions.html#__type.colorSpace\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"dimension\",\"url\":\"types/CopyTextureOptions.html#__type.dimension\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":1024,\"name\":\"baseArrayLayer\",\"url\":\"types/CopyTextureOptions.html#__type.baseArrayLayer\",\"classes\":\"\",\"parent\":\"CopyTextureOptions.__type\"},{\"kind\":4194304,\"name\":\"TextureData\",\"url\":\"types/TextureData.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/TextureData.html#__type\",\"classes\":\"\",\"parent\":\"TextureData\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"types/TextureData.html#__type.data\",\"classes\":\"\",\"parent\":\"TextureData.__type\"},{\"kind\":4194304,\"name\":\"TextureCreationData\",\"url\":\"types/TextureCreationData.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TextureRawDataSource\",\"url\":\"types/TextureRawDataSource.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TextureSource\",\"url\":\"types/TextureSource.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"CreateTextureOptions\",\"url\":\"types/CreateTextureOptions.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"CreateTextureFromBitmapOptions\",\"url\":\"types/CreateTextureFromBitmapOptions.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"subarray\",\"url\":\"functions/subarray.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TypedArrayConstructor\",\"url\":\"types/TypedArrayConstructor.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"TypedArray\",\"url\":\"types/TypedArray.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"TypedArrayViewGenerator\",\"url\":\"classes/TypedArrayViewGenerator.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/TypedArrayViewGenerator.html#constructor\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":1024,\"name\":\"arrayBuffer\",\"url\":\"classes/TypedArrayViewGenerator.html#arrayBuffer\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":1024,\"name\":\"byteOffset\",\"url\":\"classes/TypedArrayViewGenerator.html#byteOffset\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":2048,\"name\":\"align\",\"url\":\"classes/TypedArrayViewGenerator.html#align\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":2048,\"name\":\"pad\",\"url\":\"classes/TypedArrayViewGenerator.html#pad\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":2048,\"name\":\"getView\",\"url\":\"classes/TypedArrayViewGenerator.html#getView\",\"classes\":\"\",\"parent\":\"TypedArrayViewGenerator\"},{\"kind\":64,\"name\":\"isTypedArray\",\"url\":\"functions/isTypedArray.html\",\"classes\":\"\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,46.821]],[\"comment/0\",[]],[\"name/1\",[1,46.821]],[\"comment/1\",[]],[\"name/2\",[2,46.821]],[\"comment/2\",[]],[\"name/3\",[3,19.741]],[\"comment/3\",[]],[\"name/4\",[4,29.475]],[\"comment/4\",[]],[\"name/5\",[5,29.475]],[\"comment/5\",[]],[\"name/6\",[6,29.475]],[\"comment/6\",[]],[\"name/7\",[7,29.475]],[\"comment/7\",[]],[\"name/8\",[8,46.821]],[\"comment/8\",[]],[\"name/9\",[3,19.741]],[\"comment/9\",[]],[\"name/10\",[4,29.475]],[\"comment/10\",[]],[\"name/11\",[5,29.475]],[\"comment/11\",[]],[\"name/12\",[6,29.475]],[\"comment/12\",[]],[\"name/13\",[7,29.475]],[\"comment/13\",[]],[\"name/14\",[9,46.821]],[\"comment/14\",[]],[\"name/15\",[3,19.741]],[\"comment/15\",[]],[\"name/16\",[4,29.475]],[\"comment/16\",[]],[\"name/17\",[5,29.475]],[\"comment/17\",[]],[\"name/18\",[6,29.475]],[\"comment/18\",[]],[\"name/19\",[7,29.475]],[\"comment/19\",[]],[\"name/20\",[10,46.821]],[\"comment/20\",[]],[\"name/21\",[3,19.741]],[\"comment/21\",[]],[\"name/22\",[4,29.475]],[\"comment/22\",[]],[\"name/23\",[5,29.475]],[\"comment/23\",[]],[\"name/24\",[6,29.475]],[\"comment/24\",[]],[\"name/25\",[7,29.475]],[\"comment/25\",[]],[\"name/26\",[11,46.821]],[\"comment/26\",[]],[\"name/27\",[3,19.741]],[\"comment/27\",[]],[\"name/28\",[12,46.821]],[\"comment/28\",[]],[\"name/29\",[3,19.741]],[\"comment/29\",[]],[\"name/30\",[4,29.475]],[\"comment/30\",[]],[\"name/31\",[5,29.475]],[\"comment/31\",[]],[\"name/32\",[6,29.475]],[\"comment/32\",[]],[\"name/33\",[7,29.475]],[\"comment/33\",[]],[\"name/34\",[13,46.821]],[\"comment/34\",[]],[\"name/35\",[3,19.741]],[\"comment/35\",[]],[\"name/36\",[4,29.475]],[\"comment/36\",[]],[\"name/37\",[5,29.475]],[\"comment/37\",[]],[\"name/38\",[6,29.475]],[\"comment/38\",[]],[\"name/39\",[7,29.475]],[\"comment/39\",[]],[\"name/40\",[14,46.821]],[\"comment/40\",[]],[\"name/41\",[3,19.741]],[\"comment/41\",[]],[\"name/42\",[4,29.475]],[\"comment/42\",[]],[\"name/43\",[5,29.475]],[\"comment/43\",[]],[\"name/44\",[6,29.475]],[\"comment/44\",[]],[\"name/45\",[7,29.475]],[\"comment/45\",[]],[\"name/46\",[15,46.821]],[\"comment/46\",[]],[\"name/47\",[3,19.741]],[\"comment/47\",[]],[\"name/48\",[4,29.475]],[\"comment/48\",[]],[\"name/49\",[5,29.475]],[\"comment/49\",[]],[\"name/50\",[6,29.475]],[\"comment/50\",[]],[\"name/51\",[7,29.475]],[\"comment/51\",[]],[\"name/52\",[16,46.821]],[\"comment/52\",[]],[\"name/53\",[17,41.713]],[\"comment/53\",[]],[\"name/54\",[18,41.713]],[\"comment/54\",[]],[\"name/55\",[19,46.821]],[\"comment/55\",[]],[\"name/56\",[20,41.713]],[\"comment/56\",[]],[\"name/57\",[21,41.713]],[\"comment/57\",[]],[\"name/58\",[22,46.821]],[\"comment/58\",[]],[\"name/59\",[23,46.821]],[\"comment/59\",[]],[\"name/60\",[24,46.821]],[\"comment/60\",[]],[\"name/61\",[25,46.821]],[\"comment/61\",[]],[\"name/62\",[26,46.821]],[\"comment/62\",[]],[\"name/63\",[27,46.821]],[\"comment/63\",[]],[\"name/64\",[28,46.821]],[\"comment/64\",[]],[\"name/65\",[29,46.821]],[\"comment/65\",[]],[\"name/66\",[30,41.713]],[\"comment/66\",[]],[\"name/67\",[31,46.821]],[\"comment/67\",[]],[\"name/68\",[3,19.741]],[\"comment/68\",[]],[\"name/69\",[30,41.713]],[\"comment/69\",[]],[\"name/70\",[32,41.713]],[\"comment/70\",[]],[\"name/71\",[33,46.821]],[\"comment/71\",[]],[\"name/72\",[34,46.821]],[\"comment/72\",[]],[\"name/73\",[35,46.821]],[\"comment/73\",[]],[\"name/74\",[3,19.741]],[\"comment/74\",[]],[\"name/75\",[36,46.821]],[\"comment/75\",[]],[\"name/76\",[37,41.713]],[\"comment/76\",[]],[\"name/77\",[38,46.821]],[\"comment/77\",[]],[\"name/78\",[3,19.741]],[\"comment/78\",[]],[\"name/79\",[39,41.713]],[\"comment/79\",[]],[\"name/80\",[3,19.741]],[\"comment/80\",[]],[\"name/81\",[40,41.713]],[\"comment/81\",[]],[\"name/82\",[41,46.821]],[\"comment/82\",[]],[\"name/83\",[42,46.821]],[\"comment/83\",[]],[\"name/84\",[43,46.821]],[\"comment/84\",[]],[\"name/85\",[44,46.821]],[\"comment/85\",[]],[\"name/86\",[45,46.821]],[\"comment/86\",[]],[\"name/87\",[46,46.821]],[\"comment/87\",[]],[\"name/88\",[40,41.713]],[\"comment/88\",[]],[\"name/89\",[39,41.713]],[\"comment/89\",[]],[\"name/90\",[47,46.821]],[\"comment/90\",[]],[\"name/91\",[3,19.741]],[\"comment/91\",[]],[\"name/92\",[48,46.821]],[\"comment/92\",[]],[\"name/93\",[3,19.741]],[\"comment/93\",[]],[\"name/94\",[49,46.821]],[\"comment/94\",[]],[\"name/95\",[50,46.821]],[\"comment/95\",[]],[\"name/96\",[51,46.821]],[\"comment/96\",[]],[\"name/97\",[52,46.821]],[\"comment/97\",[]],[\"name/98\",[3,19.741]],[\"comment/98\",[]],[\"name/99\",[53,41.713]],[\"comment/99\",[]],[\"name/100\",[54,46.821]],[\"comment/100\",[]],[\"name/101\",[55,46.821]],[\"comment/101\",[]],[\"name/102\",[56,46.821]],[\"comment/102\",[]],[\"name/103\",[57,46.821]],[\"comment/103\",[]],[\"name/104\",[3,19.741]],[\"comment/104\",[]],[\"name/105\",[58,41.713]],[\"comment/105\",[]],[\"name/106\",[37,41.713]],[\"comment/106\",[]],[\"name/107\",[20,41.713]],[\"comment/107\",[]],[\"name/108\",[59,41.713]],[\"comment/108\",[]],[\"name/109\",[60,46.821]],[\"comment/109\",[]],[\"name/110\",[61,46.821]],[\"comment/110\",[]],[\"name/111\",[62,46.821]],[\"comment/111\",[]],[\"name/112\",[3,19.741]],[\"comment/112\",[]],[\"name/113\",[63,46.821]],[\"comment/113\",[]],[\"name/114\",[3,19.741]],[\"comment/114\",[]],[\"name/115\",[64,46.821]],[\"comment/115\",[]],[\"name/116\",[65,46.821]],[\"comment/116\",[]],[\"name/117\",[66,46.821]],[\"comment/117\",[]],[\"name/118\",[59,41.713]],[\"comment/118\",[]],[\"name/119\",[67,46.821]],[\"comment/119\",[]],[\"name/120\",[3,19.741]],[\"comment/120\",[]],[\"name/121\",[21,41.713]],[\"comment/121\",[]],[\"name/122\",[53,41.713]],[\"comment/122\",[]],[\"name/123\",[68,46.821]],[\"comment/123\",[]],[\"name/124\",[69,46.821]],[\"comment/124\",[]],[\"name/125\",[70,46.821]],[\"comment/125\",[]],[\"name/126\",[71,46.821]],[\"comment/126\",[]],[\"name/127\",[72,46.821]],[\"comment/127\",[]],[\"name/128\",[73,46.821]],[\"comment/128\",[]],[\"name/129\",[74,46.821]],[\"comment/129\",[]],[\"name/130\",[75,46.821]],[\"comment/130\",[]],[\"name/131\",[76,46.821]],[\"comment/131\",[]],[\"name/132\",[77,46.821]],[\"comment/132\",[]],[\"name/133\",[78,46.821]],[\"comment/133\",[]],[\"name/134\",[79,46.821]],[\"comment/134\",[]],[\"name/135\",[80,46.821]],[\"comment/135\",[]],[\"name/136\",[3,19.741]],[\"comment/136\",[]],[\"name/137\",[81,46.821]],[\"comment/137\",[]],[\"name/138\",[82,46.821]],[\"comment/138\",[]],[\"name/139\",[83,46.821]],[\"comment/139\",[]],[\"name/140\",[84,46.821]],[\"comment/140\",[]],[\"name/141\",[85,46.821]],[\"comment/141\",[]],[\"name/142\",[86,46.821]],[\"comment/142\",[]],[\"name/143\",[3,19.741]],[\"comment/143\",[]],[\"name/144\",[58,41.713]],[\"comment/144\",[]],[\"name/145\",[87,46.821]],[\"comment/145\",[]],[\"name/146\",[88,46.821]],[\"comment/146\",[]],[\"name/147\",[89,46.821]],[\"comment/147\",[]],[\"name/148\",[90,46.821]],[\"comment/148\",[]],[\"name/149\",[91,46.821]],[\"comment/149\",[]],[\"name/150\",[92,46.821]],[\"comment/150\",[]],[\"name/151\",[93,46.821]],[\"comment/151\",[]],[\"name/152\",[18,41.713]],[\"comment/152\",[]],[\"name/153\",[94,46.821]],[\"comment/153\",[]],[\"name/154\",[17,41.713]],[\"comment/154\",[]],[\"name/155\",[32,41.713]],[\"comment/155\",[]],[\"name/156\",[95,46.821]],[\"comment/156\",[]],[\"name/157\",[96,46.821]],[\"comment/157\",[]],[\"name/158\",[97,46.821]],[\"comment/158\",[]],[\"name/159\",[98,46.821]],[\"comment/159\",[]],[\"name/160\",[99,46.821]],[\"comment/160\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":3,\"name\":{\"3\":{},\"9\":{},\"15\":{},\"21\":{},\"27\":{},\"29\":{},\"35\":{},\"41\":{},\"47\":{},\"68\":{},\"74\":{},\"78\":{},\"80\":{},\"91\":{},\"93\":{},\"98\":{},\"104\":{},\"112\":{},\"114\":{},\"120\":{},\"136\":{},\"143\":{}},\"comment\":{}}],[\"align\",{\"_index\":96,\"name\":{\"157\":{}},\"comment\":{}}],[\"arraybuffer\",{\"_index\":32,\"name\":{\"70\":{},\"155\":{}},\"comment\":{}}],[\"arraybufferviews\",{\"_index\":31,\"name\":{\"67\":{}},\"comment\":{}}],[\"arraydefinition\",{\"_index\":43,\"name\":{\"84\":{}},\"comment\":{}}],[\"arrays\",{\"_index\":62,\"name\":{\"111\":{}},\"comment\":{}}],[\"arraysoptions\",{\"_index\":63,\"name\":{\"113\":{}},\"comment\":{}}],[\"arrayunion\",{\"_index\":61,\"name\":{\"110\":{}},\"comment\":{}}],[\"basearraylayer\",{\"_index\":85,\"name\":{\"141\":{}},\"comment\":{}}],[\"binding\",{\"_index\":45,\"name\":{\"86\":{}},\"comment\":{}}],[\"bufferlayouts\",{\"_index\":53,\"name\":{\"99\":{},\"122\":{}},\"comment\":{}}],[\"buffers\",{\"_index\":68,\"name\":{\"123\":{}},\"comment\":{}}],[\"buffersandattributes\",{\"_index\":67,\"name\":{\"119\":{}},\"comment\":{}}],[\"byteoffset\",{\"_index\":95,\"name\":{\"156\":{}},\"comment\":{}}],[\"colorspace\",{\"_index\":83,\"name\":{\"139\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":17,\"name\":{\"53\":{},\"154\":{}},\"comment\":{}}],[\"copysourcestotexture\",{\"_index\":72,\"name\":{\"127\":{}},\"comment\":{}}],[\"copysourcetotexture\",{\"_index\":73,\"name\":{\"128\":{}},\"comment\":{}}],[\"copytextureoptions\",{\"_index\":80,\"name\":{\"135\":{}},\"comment\":{}}],[\"create3dfvertices\",{\"_index\":11,\"name\":{\"26\":{}},\"comment\":{}}],[\"createbufferlayoutsfromarrays\",{\"_index\":52,\"name\":{\"97\":{}},\"comment\":{}}],[\"createbuffersandattributesfromarrays\",{\"_index\":56,\"name\":{\"102\":{}},\"comment\":{}}],[\"createcrescentvertices\",{\"_index\":12,\"name\":{\"28\":{}},\"comment\":{}}],[\"createcubevertices\",{\"_index\":9,\"name\":{\"14\":{}},\"comment\":{}}],[\"createcylindervertices\",{\"_index\":13,\"name\":{\"34\":{}},\"comment\":{}}],[\"creatediscvertices\",{\"_index\":15,\"name\":{\"46\":{}},\"comment\":{}}],[\"createplanevertices\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"createspherevertices\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"createtexturefrombitmapoptions\",{\"_index\":91,\"name\":{\"149\":{}},\"comment\":{}}],[\"createtexturefromimage\",{\"_index\":79,\"name\":{\"134\":{}},\"comment\":{}}],[\"createtexturefromimages\",{\"_index\":78,\"name\":{\"133\":{}},\"comment\":{}}],[\"createtexturefromsource\",{\"_index\":76,\"name\":{\"131\":{}},\"comment\":{}}],[\"createtexturefromsources\",{\"_index\":75,\"name\":{\"130\":{}},\"comment\":{}}],[\"createtextureoptions\",{\"_index\":90,\"name\":{\"148\":{}},\"comment\":{}}],[\"createtorusvertices\",{\"_index\":14,\"name\":{\"40\":{}},\"comment\":{}}],[\"createtruncatedconevertices\",{\"_index\":10,\"name\":{\"20\":{}},\"comment\":{}}],[\"createxyquadvertices\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"cursor\",{\"_index\":19,\"name\":{\"55\":{}},\"comment\":{}}],[\"data\",{\"_index\":58,\"name\":{\"105\":{},\"144\":{}},\"comment\":{}}],[\"dimension\",{\"_index\":84,\"name\":{\"140\":{}},\"comment\":{}}],[\"fielddefinition\",{\"_index\":35,\"name\":{\"73\":{}},\"comment\":{}}],[\"fielddefinitions\",{\"_index\":38,\"name\":{\"77\":{}},\"comment\":{}}],[\"flipy\",{\"_index\":81,\"name\":{\"137\":{}},\"comment\":{}}],[\"fullarrayspec\",{\"_index\":57,\"name\":{\"103\":{}},\"comment\":{}}],[\"generatemipmap\",{\"_index\":51,\"name\":{\"96\":{}},\"comment\":{}}],[\"getsizeformipfromtexture\",{\"_index\":71,\"name\":{\"126\":{}},\"comment\":{}}],[\"getsizefromsource\",{\"_index\":74,\"name\":{\"129\":{}},\"comment\":{}}],[\"getview\",{\"_index\":98,\"name\":{\"159\":{}},\"comment\":{}}],[\"group\",{\"_index\":46,\"name\":{\"87\":{}},\"comment\":{}}],[\"indexbuffer\",{\"_index\":69,\"name\":{\"124\":{}},\"comment\":{}}],[\"indexformat\",{\"_index\":70,\"name\":{\"125\":{}},\"comment\":{}}],[\"indices\",{\"_index\":7,\"name\":{\"7\":{},\"13\":{},\"19\":{},\"25\":{},\"33\":{},\"39\":{},\"45\":{},\"51\":{}},\"comment\":{}}],[\"interleave\",{\"_index\":64,\"name\":{\"115\":{}},\"comment\":{}}],[\"interleavevertexdata\",{\"_index\":55,\"name\":{\"101\":{}},\"comment\":{}}],[\"intrinsicdefinition\",{\"_index\":42,\"name\":{\"83\":{}},\"comment\":{}}],[\"istypedarray\",{\"_index\":99,\"name\":{\"160\":{}},\"comment\":{}}],[\"loadimagebitmap\",{\"_index\":77,\"name\":{\"132\":{}},\"comment\":{}}],[\"makeshaderdatadefinitions\",{\"_index\":34,\"name\":{\"72\":{}},\"comment\":{}}],[\"makestructuredview\",{\"_index\":26,\"name\":{\"62\":{}},\"comment\":{}}],[\"maketypedarrayviews\",{\"_index\":24,\"name\":{\"60\":{}},\"comment\":{}}],[\"normal\",{\"_index\":5,\"name\":{\"5\":{},\"11\":{},\"17\":{},\"23\":{},\"31\":{},\"37\":{},\"43\":{},\"49\":{}},\"comment\":{}}],[\"normalize\",{\"_index\":60,\"name\":{\"109\":{}},\"comment\":{}}],[\"normalizegpuextent3d\",{\"_index\":49,\"name\":{\"94\":{}},\"comment\":{}}],[\"numcomponents\",{\"_index\":20,\"name\":{\"56\":{},\"107\":{}},\"comment\":{}}],[\"numelements\",{\"_index\":21,\"name\":{\"57\":{},\"121\":{}},\"comment\":{}}],[\"nummiplevels\",{\"_index\":50,\"name\":{\"95\":{}},\"comment\":{}}],[\"offset\",{\"_index\":36,\"name\":{\"75\":{}},\"comment\":{}}],[\"pad\",{\"_index\":97,\"name\":{\"158\":{}},\"comment\":{}}],[\"position\",{\"_index\":4,\"name\":{\"4\":{},\"10\":{},\"16\":{},\"22\":{},\"30\":{},\"36\":{},\"42\":{},\"48\":{}},\"comment\":{}}],[\"premultipliedalpha\",{\"_index\":82,\"name\":{\"138\":{}},\"comment\":{}}],[\"primitives\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"push\",{\"_index\":22,\"name\":{\"58\":{}},\"comment\":{}}],[\"reset\",{\"_index\":23,\"name\":{\"59\":{}},\"comment\":{}}],[\"setstructuredvalues\",{\"_index\":28,\"name\":{\"64\":{}},\"comment\":{}}],[\"setstructuredview\",{\"_index\":25,\"name\":{\"61\":{}},\"comment\":{}}],[\"settypedvalues\",{\"_index\":27,\"name\":{\"63\":{}},\"comment\":{}}],[\"shaderlocation\",{\"_index\":59,\"name\":{\"108\":{},\"118\":{}},\"comment\":{}}],[\"size\",{\"_index\":40,\"name\":{\"81\":{},\"88\":{}},\"comment\":{}}],[\"stepmode\",{\"_index\":65,\"name\":{\"116\":{}},\"comment\":{}}],[\"structdefinition\",{\"_index\":41,\"name\":{\"82\":{}},\"comment\":{}}],[\"structdefinitions\",{\"_index\":47,\"name\":{\"90\":{}},\"comment\":{}}],[\"structuredview\",{\"_index\":33,\"name\":{\"71\":{}},\"comment\":{}}],[\"subarray\",{\"_index\":92,\"name\":{\"150\":{}},\"comment\":{}}],[\"texcoord\",{\"_index\":6,\"name\":{\"6\":{},\"12\":{},\"18\":{},\"24\":{},\"32\":{},\"38\":{},\"44\":{},\"50\":{}},\"comment\":{}}],[\"texturecreationdata\",{\"_index\":87,\"name\":{\"145\":{}},\"comment\":{}}],[\"texturedata\",{\"_index\":86,\"name\":{\"142\":{}},\"comment\":{}}],[\"texturerawdatasource\",{\"_index\":88,\"name\":{\"146\":{}},\"comment\":{}}],[\"texturesource\",{\"_index\":89,\"name\":{\"147\":{}},\"comment\":{}}],[\"type\",{\"_index\":37,\"name\":{\"76\":{},\"106\":{}},\"comment\":{}}],[\"typedarray\",{\"_index\":18,\"name\":{\"54\":{},\"152\":{}},\"comment\":{}}],[\"typedarrayconstructor\",{\"_index\":93,\"name\":{\"151\":{}},\"comment\":{}}],[\"typedarrayorviews\",{\"_index\":29,\"name\":{\"65\":{}},\"comment\":{}}],[\"typedarrays\",{\"_index\":54,\"name\":{\"100\":{}},\"comment\":{}}],[\"typedarrayviewgenerator\",{\"_index\":94,\"name\":{\"153\":{}},\"comment\":{}}],[\"typedarraywrapper\",{\"_index\":16,\"name\":{\"52\":{}},\"comment\":{}}],[\"typedefinition\",{\"_index\":39,\"name\":{\"79\":{},\"89\":{}},\"comment\":{}}],[\"usage\",{\"_index\":66,\"name\":{\"117\":{}},\"comment\":{}}],[\"variabledefinition\",{\"_index\":44,\"name\":{\"85\":{}},\"comment\":{}}],[\"variabledefinitions\",{\"_index\":48,\"name\":{\"92\":{}},\"comment\":{}}],[\"views\",{\"_index\":30,\"name\":{\"66\":{},\"69\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file diff --git a/docs/classes/TypedArrayViewGenerator.html b/docs/classes/TypedArrayViewGenerator.html index b051d6f..a244c88 100644 --- a/docs/classes/TypedArrayViewGenerator.html +++ b/docs/classes/TypedArrayViewGenerator.html @@ -143,15 +143,10 @@

CopyTextureOptions
  • CreateTextureFromBitmapOptions
  • CreateTextureOptions
  • -
  • EntryPoint
  • -
  • EntryPoints
  • FieldDefinition
  • FieldDefinitions
  • FullArraySpec
  • IntrinsicDefinition
  • -
  • PipelineDescriptor
  • -
  • ProgrammableStage
  • -
  • Resource
  • StructDefinition
  • StructDefinitions
  • StructuredView
  • @@ -164,8 +159,6 @@

    TypedArrayConstructor
  • TypedArrayOrViews
  • VariableDefinitions
  • -
  • kType
  • -
  • kTypes
  • copySourceToTexture
  • copySourcesToTexture
  • createBufferLayoutsFromArrays
  • @@ -174,25 +167,20 @@

    createTextureFromImages
  • createTextureFromSource
  • createTextureFromSources
  • -
  • drawArrays
  • generateMipmap
  • -
  • getSizeAndAlignmentOfUnsizedArrayElement
  • getSizeForMipFromTexture
  • getSizeFromSource
  • interleaveVertexData
  • isTypedArray
  • loadImageBitmap
  • -
  • makeBindGroupLayoutDescriptors
  • makeShaderDataDefinitions
  • makeStructuredView
  • makeTypedArrayViews
  • normalizeGPUExtent3D
  • numMipLevels
  • -
  • setIntrinsicsToView
  • setStructuredValues
  • setStructuredView
  • setTypedValues
  • -
  • setVertexAndIndexBuffers
  • subarray
  • Generated using TypeDoc

    diff --git a/docs/classes/primitives.TypedArrayWrapper.html b/docs/classes/primitives.TypedArrayWrapper.html index f30f582..9ac8c69 100644 --- a/docs/classes/primitives.TypedArrayWrapper.html +++ b/docs/classes/primitives.TypedArrayWrapper.html @@ -175,15 +175,10 @@

    CopyTextureOptions
  • CreateTextureFromBitmapOptions
  • CreateTextureOptions
  • -
  • EntryPoint
  • -
  • EntryPoints
  • FieldDefinition
  • FieldDefinitions
  • FullArraySpec
  • IntrinsicDefinition
  • -
  • PipelineDescriptor
  • -
  • ProgrammableStage
  • -
  • Resource
  • StructDefinition
  • StructDefinitions
  • StructuredView
  • @@ -196,8 +191,6 @@

    TypedArrayConstructor
  • TypedArrayOrViews
  • VariableDefinitions
  • -
  • kType
  • -
  • kTypes
  • copySourceToTexture
  • copySourcesToTexture
  • createBufferLayoutsFromArrays
  • @@ -206,25 +199,20 @@

    createTextureFromImages
  • createTextureFromSource
  • createTextureFromSources
  • -
  • drawArrays
  • generateMipmap
  • -
  • getSizeAndAlignmentOfUnsizedArrayElement
  • getSizeForMipFromTexture
  • getSizeFromSource
  • interleaveVertexData
  • isTypedArray
  • loadImageBitmap
  • -
  • makeBindGroupLayoutDescriptors
  • makeShaderDataDefinitions
  • makeStructuredView
  • makeTypedArrayViews
  • normalizeGPUExtent3D
  • numMipLevels
  • -
  • setIntrinsicsToView
  • setStructuredValues
  • setStructuredView
  • setTypedValues
  • -
  • setVertexAndIndexBuffers
  • subarray
  • Generated using TypeDoc

    diff --git a/docs/functions/copySourceToTexture.html b/docs/functions/copySourceToTexture.html index 525680f..a5faa49 100644 --- a/docs/functions/copySourceToTexture.html +++ b/docs/functions/copySourceToTexture.html @@ -66,15 +66,10 @@

    Theme