typegpu 0.8.0-alpha.2 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +33 -6
  2. package/chunk-2UXPGML5.js +7 -0
  3. package/chunk-2UXPGML5.js.map +1 -0
  4. package/chunk-3246CM7C.cjs +2 -0
  5. package/chunk-3246CM7C.cjs.map +1 -0
  6. package/{chunk-BDGVKGU4.js → chunk-4W5Z7BO4.js} +6 -6
  7. package/chunk-4W5Z7BO4.js.map +1 -0
  8. package/{chunk-ESIHND6W.cjs → chunk-5Y6GTBWR.cjs} +3 -3
  9. package/{chunk-ESIHND6W.cjs.map → chunk-5Y6GTBWR.cjs.map} +1 -1
  10. package/{chunk-DH4X56C7.js → chunk-7S3IK3D4.js} +2 -2
  11. package/{chunk-MJ6A4DOA.js → chunk-7XFSK632.js} +2 -2
  12. package/{chunk-WDMOZFKN.cjs → chunk-PRMFGUQT.cjs} +2 -2
  13. package/{chunk-WDMOZFKN.cjs.map → chunk-PRMFGUQT.cjs.map} +1 -1
  14. package/{chunk-44LAYHPR.cjs → chunk-TRE7NUKE.cjs} +6 -6
  15. package/chunk-TRE7NUKE.cjs.map +1 -0
  16. package/chunk-VOVQAOVG.js +2 -0
  17. package/chunk-VOVQAOVG.js.map +1 -0
  18. package/chunk-ZYGTVBDH.cjs +7 -0
  19. package/chunk-ZYGTVBDH.cjs.map +1 -0
  20. package/common/index.cjs +1 -1
  21. package/common/index.d.cts +1 -1
  22. package/common/index.d.ts +1 -1
  23. package/common/index.js +1 -1
  24. package/data/index.cjs +1 -1
  25. package/data/index.d.cts +3 -3
  26. package/data/index.d.ts +3 -3
  27. package/data/index.js +1 -1
  28. package/index.cjs +51 -51
  29. package/index.cjs.map +1 -1
  30. package/index.d.cts +2 -2
  31. package/index.d.ts +2 -2
  32. package/index.js +40 -40
  33. package/index.js.map +1 -1
  34. package/{matrix-UOB09LaW.d.cts → matrix-DHFT4O8f.d.cts} +1 -1
  35. package/{matrix-CjLuYXH1.d.ts → matrix-DLipCOZF.d.ts} +1 -1
  36. package/package.json +2 -2
  37. package/std/index.cjs +1 -1
  38. package/std/index.cjs.map +1 -1
  39. package/std/index.d.cts +2 -2
  40. package/std/index.d.ts +2 -2
  41. package/std/index.js +1 -1
  42. package/std/index.js.map +1 -1
  43. package/{tgpuConstant-sKeoSjPD.d.ts → tgpuConstant-BU72w5qs.d.cts} +15 -13
  44. package/{tgpuConstant-sKeoSjPD.d.cts → tgpuConstant-BU72w5qs.d.ts} +15 -13
  45. package/chunk-44LAYHPR.cjs.map +0 -1
  46. package/chunk-6OJFCDQF.js +0 -7
  47. package/chunk-6OJFCDQF.js.map +0 -1
  48. package/chunk-BDGVKGU4.js.map +0 -1
  49. package/chunk-CODEFPMD.cjs +0 -2
  50. package/chunk-CODEFPMD.cjs.map +0 -1
  51. package/chunk-HLB6TY7I.cjs +0 -7
  52. package/chunk-HLB6TY7I.cjs.map +0 -1
  53. package/chunk-ZYSFFI3M.js +0 -2
  54. package/chunk-ZYSFFI3M.js.map +0 -1
  55. /package/{chunk-DH4X56C7.js.map → chunk-7S3IK3D4.js.map} +0 -0
  56. /package/{chunk-MJ6A4DOA.js.map → chunk-7XFSK632.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/std/bitcast.ts","../src/std/packing.ts","../src/std/boolean.ts","../src/core/texture/textureFormats.ts","../src/wgslExtensions.ts"],"sourcesContent":["import { dualImpl } from '../core/function/dualImpl.ts';\nimport { stitch } from '../core/resolve/stitch.ts';\nimport { bitcastU32toF32Impl, bitcastU32toI32Impl } from '../data/numberOps.ts';\nimport { f32, i32, u32 } from '../data/numeric.ts';\nimport { isVec } from '../data/wgslTypes.ts';\nimport { vec2f, vec2i, vec3f, vec3i, vec4f, vec4i } from '../data/vector.ts';\nimport { VectorOps } from '../data/vectorOps.ts';\nimport type {\n v2f,\n v2i,\n v2u,\n v3f,\n v3i,\n v3u,\n v4f,\n v4i,\n v4u,\n} from '../data/wgslTypes.ts';\nimport { unify } from '../tgsl/conversion.ts';\n\nexport type BitcastU32toF32Overload =\n & ((value: number) => number)\n & ((value: v2u) => v2f)\n & ((value: v3u) => v3f)\n & ((value: v4u) => v4f);\n\nexport const bitcastU32toF32 = dualImpl({\n name: 'bitcastU32toF32',\n normalImpl: ((value) => {\n if (typeof value === 'number') {\n return bitcastU32toF32Impl(value);\n }\n return VectorOps.bitcastU32toF32[value.kind](value);\n }) as BitcastU32toF32Overload,\n codegenImpl: (n) => stitch`bitcast<f32>(${n})`,\n signature: (...arg) => {\n const uargs = unify(arg, [u32]) ?? arg;\n return {\n argTypes: uargs,\n returnType: isVec(uargs[0])\n ? uargs[0].type === 'vec2u'\n ? vec2f\n : uargs[0].type === 'vec3u'\n ? vec3f\n : vec4f\n : f32,\n };\n },\n});\n\nexport type BitcastU32toI32Overload =\n & ((value: number) => number)\n & ((value: v2u) => v2i)\n & ((value: v3u) => v3i)\n & ((value: v4u) => v4i);\n\nexport const bitcastU32toI32 = dualImpl({\n name: 'bitcastU32toI32',\n normalImpl: ((value) => {\n if (typeof value === 'number') {\n return bitcastU32toI32Impl(value);\n }\n return VectorOps.bitcastU32toI32[value.kind](value);\n }) as BitcastU32toI32Overload,\n codegenImpl: (n) => stitch`bitcast<i32>(${n})`,\n signature: (...arg) => {\n const uargs = unify(arg, [u32]) ?? arg;\n return {\n argTypes: uargs,\n returnType: isVec(uargs[0])\n ? uargs[0].type === 'vec2u'\n ? vec2i\n : uargs[0].type === 'vec3u'\n ? vec3i\n : vec4i\n : i32,\n };\n },\n});\n","import * as TB from 'typed-binary';\nimport { u32 } from '../data/numeric.ts';\nimport { vec2f, vec4f } from '../data/vector.ts';\nimport type { v2f, v4f } from '../data/wgslTypes.ts';\nimport { createDualImpl } from '../core/function/dualImpl.ts';\nimport { stitch } from '../core/resolve/stitch.ts';\nimport { snip } from '../data/snippet.ts';\n\n/**\n * @privateRemarks\n * https://gpuweb.github.io/gpuweb/wgsl/#unpack2x16float-builtin\n */\nexport const unpack2x16float = createDualImpl(\n // CPU implementation\n (e: number): v2f => {\n const buffer = new ArrayBuffer(4);\n const writer = new TB.BufferWriter(buffer);\n writer.writeUint32(e);\n const reader = new TB.BufferReader(buffer);\n return vec2f(reader.readFloat16(), reader.readFloat16());\n },\n // GPU implementation\n (e) => snip(stitch`unpack2x16float(${e})`, vec2f),\n 'unpack2x16float',\n);\n\n/**\n * @privateRemarks\n * https://gpuweb.github.io/gpuweb/wgsl/#pack2x16float-builtin\n */\nexport const pack2x16float = createDualImpl(\n // CPU implementation\n (e: v2f): number => {\n const buffer = new ArrayBuffer(4);\n const writer = new TB.BufferWriter(buffer);\n writer.writeFloat16(e.x);\n writer.writeFloat16(e.y);\n const reader = new TB.BufferReader(buffer);\n return u32(reader.readUint32());\n },\n // GPU implementation\n (e) => snip(stitch`pack2x16float(${e})`, u32),\n 'pack2x16float',\n);\n\n/**\n * @privateRemarks\n * https://gpuweb.github.io/gpuweb/wgsl/#unpack4x8unorm-builtin\n */\nexport const unpack4x8unorm = createDualImpl(\n // CPU implementation\n (e: number): v4f => {\n const buffer = new ArrayBuffer(4);\n const writer = new TB.BufferWriter(buffer);\n writer.writeUint32(e);\n const reader = new TB.BufferReader(buffer);\n return vec4f(\n reader.readUint8() / 255,\n reader.readUint8() / 255,\n reader.readUint8() / 255,\n reader.readUint8() / 255,\n );\n },\n // GPU implementation\n (e) => snip(stitch`unpack4x8unorm(${e})`, vec4f),\n 'unpack4x8unorm',\n);\n\n/**\n * @privateRemarks\n * https://gpuweb.github.io/gpuweb/wgsl/#pack4x8unorm-builtin\n */\nexport const pack4x8unorm = createDualImpl(\n // CPU implementation\n (e: v4f): number => {\n const buffer = new ArrayBuffer(4);\n const writer = new TB.BufferWriter(buffer);\n writer.writeUint8(e.x * 255);\n writer.writeUint8(e.y * 255);\n writer.writeUint8(e.z * 255);\n writer.writeUint8(e.w * 255);\n const reader = new TB.BufferReader(buffer);\n return u32(reader.readUint32());\n },\n // GPU implementation\n (e) => snip(stitch`pack4x8unorm(${e})`, u32),\n 'pack4x8unorm',\n);\n","import { dualImpl } from '../core/function/dualImpl.ts';\nimport { stitch } from '../core/resolve/stitch.ts';\nimport type { AnyData } from '../data/dataTypes.ts';\nimport { bool, f32 } from '../data/numeric.ts';\nimport { isSnippetNumeric, snip } from '../data/snippet.ts';\nimport { vec2b, vec3b, vec4b } from '../data/vector.ts';\nimport { VectorOps } from '../data/vectorOps.ts';\nimport {\n type AnyBooleanVecInstance,\n type AnyFloatVecInstance,\n type AnyNumericVecInstance,\n type AnyVec2Instance,\n type AnyVec3Instance,\n type AnyVecInstance,\n type AnyWgslData,\n isVecInstance,\n type v2b,\n type v3b,\n type v4b,\n} from '../data/wgslTypes.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport { unify } from '../tgsl/conversion.ts';\nimport { sub } from './operators.ts';\n\nfunction correspondingBooleanVectorSchema(dataType: AnyData) {\n if (dataType.type.includes('2')) {\n return vec2b;\n }\n if (dataType.type.includes('3')) {\n return vec3b;\n }\n return vec4b;\n}\n\n// comparison\n\n/**\n * Checks whether `lhs == rhs` on all components.\n * Equivalent to `all(eq(lhs, rhs))`.\n * @example\n * allEq(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns false\n * allEq(vec3u(0, 1, 2), vec3u(0, 1, 2)) // returns true\n */\nexport const allEq = dualImpl({\n name: 'allEq',\n signature: (...argTypes) => ({ argTypes, returnType: bool }),\n normalImpl: <T extends AnyVecInstance>(lhs: T, rhs: T) =>\n cpuAll(cpuEq(lhs, rhs)),\n codegenImpl: (lhs, rhs) => stitch`all(${lhs} == ${rhs})`,\n});\n\nconst cpuEq = <T extends AnyVecInstance>(lhs: T, rhs: T) =>\n VectorOps.eq[lhs.kind](lhs, rhs);\n\n/**\n * Checks **component-wise** whether `lhs == rhs`.\n * This function does **not** return `bool`, for that use-case, wrap the result in `all`, or use `allEq`.\n * @example\n * eq(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns vec2b(true, false)\n * eq(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, true, false)\n * all(eq(vec4i(4, 3, 2, 1), vec4i(4, 3, 2, 1))) // returns true\n * allEq(vec4i(4, 3, 2, 1), vec4i(4, 3, 2, 1)) // returns true\n */\nexport const eq = dualImpl({\n name: 'eq',\n signature: (...argTypes) => ({\n argTypes,\n returnType: correspondingBooleanVectorSchema(argTypes[0]),\n }),\n normalImpl: cpuEq,\n codegenImpl: (lhs, rhs) => stitch`(${lhs} == ${rhs})`,\n});\n\n/**\n * Checks **component-wise** whether `lhs != rhs`.\n * This function does **not** return `bool`, for that use-case, wrap the result in `any`.\n * @example\n * ne(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns vec2b(false, true)\n * ne(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, false, true)\n * any(ne(vec4i(4, 3, 2, 1), vec4i(4, 2, 2, 1))) // returns true\n */\nexport const ne = dualImpl({\n name: 'ne',\n signature: (...argTypes) => ({\n argTypes,\n returnType: correspondingBooleanVectorSchema(argTypes[0]),\n }),\n normalImpl: <T extends AnyVecInstance>(lhs: T, rhs: T) =>\n cpuNot(cpuEq(lhs, rhs)),\n codegenImpl: (lhs, rhs) => stitch`(${lhs} != ${rhs})`,\n});\n\nconst cpuLt = <T extends AnyNumericVecInstance>(lhs: T, rhs: T) =>\n VectorOps.lt[lhs.kind](lhs, rhs);\n\n/**\n * Checks **component-wise** whether `lhs < rhs`.\n * This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n * @example\n * lt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, true)\n * lt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, false, false)\n * all(lt(vec4i(1, 2, 3, 4), vec4i(2, 3, 4, 5))) // returns true\n */\nexport const lt = dualImpl({\n name: 'lt',\n signature: (...argTypes) => ({\n argTypes,\n returnType: correspondingBooleanVectorSchema(argTypes[0]),\n }),\n normalImpl: cpuLt,\n codegenImpl: (lhs, rhs) => stitch`(${lhs} < ${rhs})`,\n});\n\n/**\n * Checks **component-wise** whether `lhs <= rhs`.\n * This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n * @example\n * le(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(true, true)\n * le(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, true, false)\n * all(le(vec4i(1, 2, 3, 4), vec4i(2, 3, 3, 5))) // returns true\n */\nexport const le = dualImpl({\n name: 'le',\n signature: (...argTypes) => ({\n argTypes,\n returnType: correspondingBooleanVectorSchema(argTypes[0]),\n }),\n normalImpl: <T extends AnyNumericVecInstance>(lhs: T, rhs: T) =>\n cpuOr(cpuLt(lhs, rhs), cpuEq(lhs, rhs)),\n codegenImpl: (lhs, rhs) => stitch`(${lhs} <= ${rhs})`,\n});\n\n/**\n * Checks **component-wise** whether `lhs > rhs`.\n * This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n * @example\n * gt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, false)\n * gt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, false, true)\n * all(gt(vec4i(2, 3, 4, 5), vec4i(1, 2, 3, 4))) // returns true\n */\nexport const gt = dualImpl({\n name: 'gt',\n signature: (...argTypes) => ({\n argTypes,\n returnType: correspondingBooleanVectorSchema(argTypes[0]),\n }),\n normalImpl: <T extends AnyNumericVecInstance>(lhs: T, rhs: T) =>\n cpuAnd(cpuNot(cpuLt(lhs, rhs)), cpuNot(cpuEq(lhs, rhs))),\n codegenImpl: (lhs, rhs) => stitch`(${lhs} > ${rhs})`,\n});\n\n/**\n * Checks **component-wise** whether `lhs >= rhs`.\n * This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n * @example\n * ge(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(true, false)\n * ge(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, true, true)\n * all(ge(vec4i(2, 2, 4, 5), vec4i(1, 2, 3, 4))) // returns true\n */\nexport const ge = dualImpl({\n name: 'ge',\n signature: (...argTypes) => ({\n argTypes: argTypes,\n returnType: correspondingBooleanVectorSchema(argTypes[0]),\n }),\n normalImpl: <T extends AnyNumericVecInstance>(lhs: T, rhs: T) =>\n cpuNot(cpuLt(lhs, rhs)),\n codegenImpl: (lhs, rhs) => stitch`(${lhs} >= ${rhs})`,\n});\n\n// logical ops\n\nconst cpuNot = <T extends AnyBooleanVecInstance>(value: T): T =>\n VectorOps.neg[value.kind](value);\n\n/**\n * Returns **component-wise** `!value`.\n * @example\n * not(vec2b(false, true)) // returns vec2b(true, false)\n * not(vec3b(true, true, false)) // returns vec3b(false, false, true)\n */\nexport const not = dualImpl({\n name: 'not',\n signature: (...argTypes) => ({ argTypes, returnType: argTypes[0] }),\n normalImpl: cpuNot,\n codegenImpl: (arg) => stitch`!(${arg})`,\n});\n\nconst cpuOr = <T extends AnyBooleanVecInstance>(lhs: T, rhs: T) =>\n VectorOps.or[lhs.kind](lhs, rhs);\n\n/**\n * Returns **component-wise** logical `or` result.\n * @example\n * or(vec2b(false, true), vec2b(false, false)) // returns vec2b(false, true)\n * or(vec3b(true, true, false), vec3b(false, true, false)) // returns vec3b(true, true, false)\n */\nexport const or = dualImpl({\n name: 'or',\n signature: (...argTypes) => ({ argTypes, returnType: argTypes[0] }),\n normalImpl: cpuOr,\n codegenImpl: (lhs, rhs) => stitch`(${lhs} | ${rhs})`,\n});\n\nconst cpuAnd = <T extends AnyBooleanVecInstance>(lhs: T, rhs: T) =>\n cpuNot(cpuOr(cpuNot(lhs), cpuNot(rhs)));\n\n/**\n * Returns **component-wise** logical `and` result.\n * @example\n * and(vec2b(false, true), vec2b(true, true)) // returns vec2b(false, true)\n * and(vec3b(true, true, false), vec3b(false, true, false)) // returns vec3b(false, true, false)\n */\nexport const and = dualImpl({\n name: 'and',\n signature: (...argTypes) => ({ argTypes, returnType: argTypes[0] }),\n normalImpl: cpuAnd,\n codegenImpl: (lhs, rhs) => stitch`(${lhs} & ${rhs})`,\n});\n\n// logical aggregation\n\nconst cpuAll = (value: AnyBooleanVecInstance) =>\n VectorOps.all[value.kind](value);\n\n/**\n * Returns `true` if each component of `value` is true.\n * @example\n * all(vec2b(false, true)) // returns false\n * all(vec3b(true, true, true)) // returns true\n */\nexport const all = dualImpl({\n name: 'all',\n signature: (...argTypes) => ({ argTypes, returnType: bool }),\n normalImpl: cpuAll,\n codegenImpl: (value) => stitch`all(${value})`,\n});\n\n/**\n * Returns `true` if any component of `value` is true.\n * @example\n * any(vec2b(false, true)) // returns true\n * any(vec3b(false, false, false)) // returns false\n */\nexport const any = dualImpl({\n name: 'any',\n signature: (...argTypes) => ({ argTypes, returnType: bool }),\n normalImpl: (value: AnyBooleanVecInstance) => !cpuAll(cpuNot(value)),\n codegenImpl: (arg) => stitch`any(${arg})`,\n});\n\n// other\n\n/**\n * Checks whether the given elements differ by at most the `precision` value.\n * Checks all elements of `lhs` and `rhs` if arguments are vectors.\n * @example\n * isCloseTo(0, 0.1) // returns false\n * isCloseTo(vec3f(0, 0, 0), vec3f(0.002, -0.009, 0)) // returns true\n *\n * @param {number} precision argument that specifies the maximum allowed difference, 0.01 by default.\n */\nexport const isCloseTo = dualImpl({\n name: 'isCloseTo',\n signature: (...args) => ({\n argTypes: args as AnyWgslData[],\n returnType: bool,\n }),\n // CPU implementation\n normalImpl: <T extends AnyFloatVecInstance | number>(\n lhs: T,\n rhs: T,\n precision = 0.01,\n ): boolean => {\n if (typeof lhs === 'number' && typeof rhs === 'number') {\n return Math.abs(lhs - rhs) < precision;\n }\n if (isVecInstance(lhs) && isVecInstance(rhs)) {\n return VectorOps.isCloseToZero[lhs.kind](\n sub[$internal].jsImpl(lhs, rhs),\n precision,\n );\n }\n return false;\n },\n // GPU implementation\n codegenImpl: (lhs, rhs, precision = snip(0.01, f32)) => {\n if (isSnippetNumeric(lhs) && isSnippetNumeric(rhs)) {\n return stitch`(abs(f32(${lhs}) - f32(${rhs})) <= ${precision})`;\n }\n if (!isSnippetNumeric(lhs) && !isSnippetNumeric(rhs)) {\n // https://www.w3.org/TR/WGSL/#vector-multi-component:~:text=Binary%20arithmetic%20expressions%20with%20mixed%20scalar%20and%20vector%20operands\n // (a-a)+prec creates a vector of a.length elements, all equal to prec\n return stitch`all(abs(${lhs} - ${rhs}) <= (${lhs} - ${lhs}) + ${precision})`;\n }\n return 'false';\n },\n});\n\nfunction cpuSelect(f: boolean, t: boolean, cond: boolean): boolean;\nfunction cpuSelect(f: number, t: number, cond: boolean): number;\nfunction cpuSelect<T extends AnyVecInstance>(\n f: T,\n t: T,\n cond:\n | boolean\n | (T extends AnyVec2Instance ? v2b\n : T extends AnyVec3Instance ? v3b\n : v4b),\n): T;\nfunction cpuSelect<T extends number | boolean | AnyVecInstance>(\n f: T,\n t: T,\n cond: AnyBooleanVecInstance | boolean,\n) {\n if (typeof cond === 'boolean') {\n return cond ? t : f;\n }\n return VectorOps.select[(f as AnyVecInstance).kind](\n f as AnyVecInstance,\n t as AnyVecInstance,\n cond,\n );\n}\n\n/**\n * Returns `t` if `cond` is `true`, and `f` otherwise.\n * Component-wise if `cond` is a vector.\n * @example\n * select(1, 2, false) // returns 1\n * select(1, 2, true) // returns 2\n * select(vec2i(1, 2), vec2i(3, 4), true) // returns vec2i(3, 4)\n * select(vec2i(1, 2), vec2i(3, 4), vec2b(false, true)) // returns vec2i(1, 4)\n */\nexport const select = dualImpl({\n name: 'select',\n signature: (f, t, cond) => {\n const [uf, ut] = unify([f, t]) ?? [f, t] as const;\n return ({ argTypes: [uf, ut, cond], returnType: uf });\n },\n normalImpl: cpuSelect,\n codegenImpl: (f, t, cond) => stitch`select(${f}, ${t}, ${cond})`,\n});\n","import { f32, i32, u32 } from '../../data/numeric.ts';\nimport { vec4f, vec4i, vec4u } from '../../data/vector.ts';\nimport type { F32, I32, U32 } from '../../data/wgslTypes.ts';\n\nexport type ViewDimensionToDimension = {\n '1d': '1d';\n '2d': '2d';\n '2d-array': '2d';\n '3d': '3d';\n cube: '2d';\n 'cube-array': '2d';\n};\n\n/**\n * https://www.w3.org/TR/WGSL/#storage-texel-formats\n */\nexport type StorageTextureFormats =\n | 'rgba8unorm'\n | 'rgba8snorm'\n | 'rgba8uint'\n | 'rgba8sint'\n | 'rgba16unorm'\n | 'rgba16snorm'\n | 'rgba16uint'\n | 'rgba16sint'\n | 'rgba16float'\n | 'rg8unorm'\n | 'rg8snorm'\n | 'rg8uint'\n | 'rg8sint'\n | 'rg16unorm'\n | 'rg16snorm'\n | 'rg16uint'\n | 'rg16sint'\n | 'rg16float'\n | 'r32uint'\n | 'r32sint'\n | 'r32float'\n | 'rg32uint'\n | 'rg32sint'\n | 'rg32float'\n | 'rgba32uint'\n | 'rgba32sint'\n | 'rgba32float'\n | 'bgra8unorm'\n | 'r8unorm'\n | 'r8snorm'\n | 'r8uint'\n | 'r8sint'\n | 'r16unorm'\n | 'r16snorm'\n | 'r16uint'\n | 'r16sint'\n | 'r16float'\n | 'rgb10a2unorm'\n | 'rgb10a2uint'\n | 'rg11b10ufloat';\n\n// TODO: use this for texture view validation\n// deno-fmt-ignore - this is not really meant to be read\nexport const textureFormats = {\n // 8-bit formats\n 'r8unorm': { channelType: f32, vectorType: vec4f, texelSize: 1, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'r8snorm': { channelType: f32, vectorType: vec4f, texelSize: 1, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'r8uint': { channelType: u32, vectorType: vec4u, texelSize: 1, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'r8sint': { channelType: i32, vectorType: vec4i, texelSize: 1, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n 'rg8unorm': { channelType: f32, vectorType: vec4f, texelSize: 2, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only'] },\n 'rg8snorm': { channelType: f32, vectorType: vec4f, texelSize: 2, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg8uint': { channelType: u32, vectorType: vec4u, texelSize: 2, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg8sint': { channelType: i32, vectorType: vec4i, texelSize: 2, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n\n 'rgba8unorm': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'rgba8unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: null },\n 'rgba8snorm': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rgba8uint': { channelType: u32, vectorType: vec4u, texelSize: 4, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'rgba8sint': { channelType: i32, vectorType: vec4i, texelSize: 4, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n 'bgra8unorm': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only'] },\n 'bgra8unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: null },\n\n // 16-bit formats\n 'r16unorm': { channelType: f32, vectorType: vec4f, texelSize: 2, sampleTypes: ['unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'r16snorm': { channelType: f32, vectorType: vec4f, texelSize: 2, sampleTypes: ['unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'r16uint': { channelType: u32, vectorType: vec4u, texelSize: 2, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'r16sint': { channelType: i32, vectorType: vec4i, texelSize: 2, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'r16float': { channelType: f32, vectorType: vec4f, texelSize: 2, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n 'rg16unorm': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg16snorm': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg16uint': { channelType: u32, vectorType: vec4u, texelSize: 4, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg16sint': { channelType: i32, vectorType: vec4i, texelSize: 4, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg16float': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only'] },\n\n 'rgba16unorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rgba16snorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rgba16uint': { channelType: u32, vectorType: vec4u, texelSize: 8, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'rgba16sint': { channelType: i32, vectorType: vec4i, texelSize: 8, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'rgba16float': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n // 32-bit formats\n 'r32uint': { channelType: u32, vectorType: vec4u, texelSize: 4, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'r32sint': { channelType: i32, vectorType: vec4i, texelSize: 4, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'r32float': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n 'rg32uint': { channelType: u32, vectorType: vec4u, texelSize: 8, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg32sint': { channelType: i32, vectorType: vec4i, texelSize: 8, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rg32float': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n 'rgba32uint': { channelType: u32, vectorType: vec4u, texelSize: 16, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'rgba32sint': { channelType: i32, vectorType: vec4i, texelSize: 16, sampleTypes: ['sint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n 'rgba32float': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: false, canResolve: false, storageBindings: ['write-only', 'read-only', 'read-write'] },\n\n // Mixed component formats\n 'rgb10a2uint': { channelType: u32, vectorType: vec4u, texelSize: 4, sampleTypes: ['uint'], aspects: ['color'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: ['write-only', 'read-only'] },\n 'rgb10a2unorm': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only'] },\n 'rg11b10ufloat': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: true, canBlend: true, canMultisample: true, canResolve: true, storageBindings: ['write-only', 'read-only'] },\n\n // Special formats\n 'rgb9e5ufloat': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n\n // Depth/Stencil formats\n 'stencil8': { channelType: u32, vectorType: vec4u, texelSize: 1, sampleTypes: ['uint'], aspects: ['stencil'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: null },\n 'depth16unorm': { channelType: f32, vectorType: vec4f, texelSize: 2, sampleTypes: ['depth', 'unfilterable-float'], aspects: ['depth'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: null },\n 'depth24plus': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['depth', 'unfilterable-float'], aspects: ['depth'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: null },\n 'depth24plus-stencil8': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['depth', 'unfilterable-float'], aspects: ['depth', 'stencil'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: null },\n 'depth32float': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['depth', 'unfilterable-float'], aspects: ['depth'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: null },\n 'depth32float-stencil8': { channelType: f32, vectorType: vec4f, texelSize: 4, sampleTypes: ['depth', 'unfilterable-float'], aspects: ['depth', 'stencil'], canRenderAttachment: true, canBlend: false, canMultisample: true, canResolve: false, storageBindings: null },\n\n // BC compressed formats\n 'bc1-rgba-unorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc1-rgba-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc2-rgba-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc2-rgba-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc3-rgba-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc3-rgba-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc4-r-unorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc4-r-snorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc5-rg-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc5-rg-snorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc6h-rgb-ufloat': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc6h-rgb-float': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc7-rgba-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'bc7-rgba-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n\n // ETC2/EAC compressed formats\n 'etc2-rgb8unorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'etc2-rgb8unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'etc2-rgb8a1unorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'etc2-rgb8a1unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'etc2-rgba8unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'etc2-rgba8unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'eac-r11unorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'eac-r11snorm': { channelType: f32, vectorType: vec4f, texelSize: 8, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'eac-rg11unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'eac-rg11snorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n\n // ASTC compressed formats\n 'astc-4x4-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-4x4-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-5x4-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-5x4-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-5x5-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-5x5-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-6x5-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-6x5-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-6x6-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-6x6-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-8x5-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-8x5-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-8x6-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-8x6-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-8x8-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-8x8-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x5-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x5-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x6-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x6-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x8-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x8-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x10-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-10x10-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-12x10-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-12x10-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-12x12-unorm': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n 'astc-12x12-unorm-srgb': { channelType: f32, vectorType: vec4f, texelSize: 16, sampleTypes: ['float', 'unfilterable-float'], aspects: ['color'], canRenderAttachment: false, canBlend: false, canMultisample: false, canResolve: false, storageBindings: null },\n} as const satisfies Record<GPUTextureFormat, TextureFormatInfo>;\n\nexport type TextureFormatInfo = {\n readonly channelType: F32 | I32 | U32;\n readonly vectorType: typeof vec4f | typeof vec4i | typeof vec4u;\n readonly texelSize: number;\n readonly sampleTypes: readonly string[];\n readonly aspects: readonly string[];\n readonly canRenderAttachment: boolean;\n readonly canBlend: boolean;\n readonly canMultisample: boolean;\n readonly canResolve: boolean;\n readonly storageBindings: readonly string[] | null;\n};\n\nexport type TextureFormats = typeof textureFormats;\n\nexport function getDeviceTextureFormatInfo<T extends GPUTextureFormat>(\n format: T,\n device: GPUDevice,\n): typeof textureFormats[T] {\n const baseInfo = textureFormats[format];\n\n if (!baseInfo) {\n throw new Error(`Unknown texture format: ${format}`);\n }\n\n let filteredInfo = { ...baseInfo } as TextureFormatInfo;\n switch (format) {\n case 'r32float':\n case 'rg32float':\n case 'rgba32float':\n if (!device.features.has('float32-filterable')) {\n filteredInfo = {\n ...filteredInfo,\n sampleTypes: baseInfo.sampleTypes.filter((type) => type !== 'float'),\n } as TextureFormatInfo;\n }\n if (!device.features.has('float32-blendable')) {\n filteredInfo = {\n ...filteredInfo,\n canBlend: false,\n };\n }\n break;\n\n case 'bgra8unorm':\n if (!device.features.has('bgra8unorm-storage')) {\n filteredInfo = {\n ...filteredInfo,\n storageBindings: null,\n };\n }\n break;\n\n case 'rg11b10ufloat':\n if (!device.features.has('rg11b10ufloat-renderable')) {\n filteredInfo = {\n ...filteredInfo,\n canRenderAttachment: false,\n canBlend: false,\n canMultisample: false,\n canResolve: false,\n };\n }\n break;\n }\n\n if (filteredInfo.storageBindings) {\n const hasTexture1 = device.features.has('texture-formats-tier1');\n const hasTexture2 = device.features.has('texture-formats-tier2');\n\n let availableBindings = [...filteredInfo.storageBindings];\n\n // deno-fmt-ignore\n const tier2RequiredFormats = [\n 'r8unorm', 'r8uint', 'r8sint',\n 'r16uint', 'r16sint', 'r16float',\n 'rgba8unorm', 'rgba8uint', 'rgba8sint',\n 'rgba16uint', 'rgba16sint', 'rgba16float',\n 'r32uint', 'r32sint', 'r32float',\n 'rgba32uint', 'rgba32sint', 'rgba32float',\n ];\n\n // deno-fmt-ignore\n const tier1RequiredFormats = [\n 'r8snorm',\n 'rg8unorm', 'rg8snorm', 'rg8uint', 'rg8sint',\n 'rgba8snorm',\n 'r16unorm', 'r16snorm',\n 'rg16unorm', 'rg16snorm', 'rg16uint', 'rg16sint', 'rg16float',\n 'rgba16unorm', 'rgba16snorm',\n 'rgb10a2uint', 'rgb10a2unorm', 'rg11b10ufloat',\n ];\n\n if (tier2RequiredFormats.includes(format) && !hasTexture2) {\n availableBindings = availableBindings.filter((binding) =>\n binding !== 'read-write'\n );\n }\n\n if (tier1RequiredFormats.includes(format) && !hasTexture1) {\n availableBindings = availableBindings.filter(\n (binding) => binding !== 'write-only' && binding !== 'read-only',\n );\n }\n\n filteredInfo = {\n ...filteredInfo,\n storageBindings: availableBindings.length > 0 ? availableBindings : null,\n };\n }\n\n return filteredInfo as typeof textureFormats[T];\n}\n","export const wgslExtensions = [\n 'f16',\n 'clip_distances',\n 'dual_source_blending',\n 'subgroups',\n 'primitive_index',\n] as const;\nexport type WgslExtension = (typeof wgslExtensions)[number];\n\nexport const wgslExtensionToFeatureName: Record<WgslExtension, GPUFeatureName> =\n {\n f16: 'shader-f16',\n clip_distances: 'clip-distances',\n dual_source_blending: 'dual-source-blending',\n subgroups: 'subgroups',\n primitive_index: 'primitive-index' as GPUFeatureName,\n };\n"],"mappings":"kRA0BO,IAAMA,GAAkBC,EAAS,CACtC,KAAM,kBACN,YAAcC,GACR,OAAOA,GAA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AAS,IAAI,mBAAmB,IAC1CE,EAAe,CACb,GAAGA,EACH,SAAU,EACZ,GAEF,MAEF,IAAK,aACEF,EAAO,SAAS,IAAI,oBAAoB,IAC3CE,EAAe,CACb,GAAGA,EACH,gBAAiB,IACnB,GAEF,MAEF,IAAK,gBACEF,EAAO,SAAS,IAAI,0BAA0B,IACjDE,EAAe,CACb,GAAGA,EACH,oBAAqB,GACrB,SAAU,GACV,eAAgB,GAChB,WAAY,EACd,GAEF,KACJ,CAEA,GAAIA,EAAa,gBAAiB,CAChC,IAAME,EAAcJ,EAAO,SAAS,IAAI,uBAAuB,EACzDK,EAAcL,EAAO,SAAS,IAAI,uBAAuB,EAE3DM,EAAoB,CAAC,GAAGJ,EAAa,eAAe,EAGlDK,EAAuB,CAC3B,UAAW,SAAU,SACrB,UAAW,UAAW,WACtB,aAAc,YAAa,YAC3B,aAAc,aAAc,cAC5B,UAAW,UAAW,WACtB,aAAc,aAAc,aAC9B,EAGMC,EAAuB,CAC3B,UACA,WAAY,WAAY,UAAW,UACnC,aACA,WAAY,WACZ,YAAa,YAAa,WAAY,WAAY,YAClD,cAAe,cACf,cAAe,eAAgB,eACjC,EAEID,EAAqB,SAASR,CAAM,GAAK,CAACM,IAC5CC,EAAoBA,EAAkB,OAAQG,GAC5CA,IAAY,YACd,GAGED,EAAqB,SAAST,CAAM,GAAK,CAACK,IAC5CE,EAAoBA,EAAkB,OACnCG,GAAYA,IAAY,cAAgBA,IAAY,WACvD,GAGFP,EAAe,CACb,GAAGA,EACH,gBAAiBI,EAAkB,OAAS,EAAIA,EAAoB,IACtE,CACF,CAEA,OAAOJ,CACT,CC5SO,IAAMQ,GAAiB,CAC5B,MACA,iBACA,uBACA,YACA,iBACF,EAGaC,GACX,CACE,IAAK,aACL,eAAgB,iBAChB,qBAAsB,uBACtB,UAAW,YACX,gBAAiB,iBACnB","names":["bitcastU32toF32","dualImpl","value","bitcastU32toF32Impl","VectorOps","n","stitch","arg","uargs","unify","u32","isVec","vec2f","vec3f","vec4f","f32","bitcastU32toI32","bitcastU32toI32Impl","vec2i","vec3i","vec4i","i32","TB","unpack2x16float","createDualImpl","buffer","reader","vec2f","snip","stitch","pack2x16float","writer","u32","unpack4x8unorm","vec4f","pack4x8unorm","correspondingBooleanVectorSchema","dataType","vec2b","vec3b","vec4b","allEq","dualImpl","argTypes","bool","lhs","rhs","cpuAll","cpuEq","stitch","VectorOps","eq","ne","cpuNot","cpuLt","lt","le","cpuOr","gt","cpuAnd","ge","value","not","arg","or","and","all","any","isCloseTo","args","precision","isVecInstance","sub","$internal","snip","f32","isSnippetNumeric","cpuSelect","f","cond","select","uf","ut","unify","textureFormats","f32","vec4f","u32","vec4u","i32","vec4i","getDeviceTextureFormatInfo","format","device","baseInfo","filteredInfo","type","hasTexture1","hasTexture2","availableBindings","tier2RequiredFormats","tier1RequiredFormats","binding","wgslExtensions","wgslExtensionToFeatureName"]}
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;var _chunkTRE7NUKEcjs = require('./chunk-TRE7NUKE.cjs');var Qe=class{};function Wt(e){let t=_chunkTRE7NUKEcjs.La.call(void 0, (...r)=>{let a=[];for(let s of r)if(typeof s=="number")a.push(s);else for(let i=0;i<s.length;++i)a.push(s[i]);if(a.length!==0&&a.length!==e.columns*e.rows)throw new Error(`'${e.type}' constructor called with invalid number of arguments.`);for(let s=a.length;s<e.columns*e.rows;++s)a.push(0);return new e.MatImpl(...a)},(...r)=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`${e.type}(${r})`,n),e.type),n=Object.assign(t,{type:e.type,identity:fn[e.columns],translation:e.columns===4?gn:void 0,scaling:e.columns===4?hn:void 0,rotationX:e.columns===4?vn:void 0,rotationY:e.columns===4?bn:void 0,rotationZ:e.columns===4?wn:void 0});return n}var zt= (_class =class extends Qe{__init() {this[_chunkTRE7NUKEcjs.a]=!0}__init2() {this.length=4}constructor(...t){super();_class.prototype.__init.call(this);_class.prototype.__init2.call(this);,this.columns=[this.makeColumn(t[0],t[1]),this.makeColumn(t[2],t[3])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[1].x}get 3(){return this.columns[1].y}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[1].x=t}set 3(t){this.columns[1].y=t}*[Symbol.iterator](){yield this[0],yield this[1],yield this[2],yield this[3]}[_chunkTRE7NUKEcjs.f](){return _chunkTRE7NUKEcjs.aa.call(void 0, `${this.kind}(${Array.from({length:this.length}).map((t,n)=>this[n]).join(", ")})`,ie)}toString(){return this[_chunkTRE7NUKEcjs.f]().value}}, _class),Vt= (_class2 =class extends zt{constructor(...args) { super(...args); _class2.prototype.__init3.call(this); }__init3() {this.kind="mat2x2f"}makeColumn(t,n){return _chunkTRE7NUKEcjs.Xa.call(void 0, t,n)}}, _class2),Ft= (_class3 =class extends Qe{__init4() {this[_chunkTRE7NUKEcjs.a]=!0}__init5() {this.length=12}constructor(...t){super();_class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this);,this.columns=[this.makeColumn(t[0],t[1],t[2]),this.makeColumn(t[3],t[4],t[5]),this.makeColumn(t[6],t[7],t[8])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return 0}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return 0}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return 0}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){}*[Symbol.iterator](){for(let t=0;t<12;t++)yield this[t]}[_chunkTRE7NUKEcjs.f](){return _chunkTRE7NUKEcjs.aa.call(void 0, `${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`,le)}toString(){return this[_chunkTRE7NUKEcjs.f]().value}}, _class3),Ct= (_class4 =class extends Ft{constructor(...args2) { super(...args2); _class4.prototype.__init6.call(this); }__init6() {this.kind="mat3x3f"}makeColumn(t,n,r){return _chunkTRE7NUKEcjs.ab.call(void 0, t,n,r)}}, _class4),Pt= (_class5 =class extends Qe{__init7() {this[_chunkTRE7NUKEcjs.a]=!0}constructor(...t){super();_class5.prototype.__init7.call(this);_class5.prototype.__init8.call(this);,this.columns=[this.makeColumn(t[0],t[1],t[2],t[3]),this.makeColumn(t[4],t[5],t[6],t[7]),this.makeColumn(t[8],t[9],t[10],t[11]),this.makeColumn(t[12],t[13],t[14],t[15])]}__init8() {this.length=16}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return this.columns[0].w}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return this.columns[1].w}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return this.columns[2].w}get 12(){return this.columns[3].x}get 13(){return this.columns[3].y}get 14(){return this.columns[3].z}get 15(){return this.columns[3].w}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){this.columns[0].w=t}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){this.columns[1].w=t}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){this.columns[2].w=t}set 12(t){this.columns[3].x=t}set 13(t){this.columns[3].y=t}set 14(t){this.columns[3].z=t}set 15(t){this.columns[3].w=t}*[Symbol.iterator](){for(let t=0;t<16;t++)yield this[t]}[_chunkTRE7NUKEcjs.f](){return _chunkTRE7NUKEcjs.aa.call(void 0, `${this.kind}(${Array.from({length:this.length}).map((t,n)=>this[n]).join(", ")})`,A)}toString(){return this[_chunkTRE7NUKEcjs.f]().value}}, _class5),kt= (_class6 =class extends Pt{constructor(...args3) { super(...args3); _class6.prototype.__init9.call(this); }__init9() {this.kind="mat4x4f"}makeColumn(t,n,r,a){return _chunkTRE7NUKEcjs.fb.call(void 0, t,n,r,a)}}, _class6),Tn= exports.b =_chunkTRE7NUKEcjs.La.call(void 0, ()=>ie(1,0,0,1),()=>_chunkTRE7NUKEcjs.aa.call(void 0, "mat2x2f(1, 0, 0, 1)",ie),"identity2"),xn= exports.c =_chunkTRE7NUKEcjs.La.call(void 0, ()=>le(1,0,0,0,1,0,0,0,1),()=>_chunkTRE7NUKEcjs.aa.call(void 0, "mat3x3f(1, 0, 0, 0, 1, 0, 0, 0, 1)",le),"identity3"),dn= exports.d =_chunkTRE7NUKEcjs.La.call(void 0, ()=>A(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),()=>_chunkTRE7NUKEcjs.aa.call(void 0, "mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)",A),"identity4"),fn={2:Tn,3:xn,4:dn},gn= exports.e =_chunkTRE7NUKEcjs.La.call(void 0, e=>A(1,0,0,0,0,1,0,0,0,0,1,0,e.x,e.y,e.z,1),e=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ${e}.x, ${e}.y, ${e}.z, 1)`,A),"translation4"),hn= exports.f =_chunkTRE7NUKEcjs.La.call(void 0, e=>A(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1),e=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`mat4x4f(${e}.x, 0, 0, 0, 0, ${e}.y, 0, 0, 0, 0, ${e}.z, 0, 0, 0, 0, 1)`,A),"scaling4"),vn= exports.g =_chunkTRE7NUKEcjs.La.call(void 0, e=>A(1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1),e=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`mat4x4f(1, 0, 0, 0, 0, cos(${e}), sin(${e}), 0, 0, -sin(${e}), cos(${e}), 0, 0, 0, 0, 1)`,A),"rotationX4"),bn= exports.h =_chunkTRE7NUKEcjs.La.call(void 0, e=>A(Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1),e=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`mat4x4f(cos(${e}), 0, -sin(${e}), 0, 0, 1, 0, 0, sin(${e}), 0, cos(${e}), 0, 0, 0, 0, 1)`,A),"rotationY4"),wn= exports.i =_chunkTRE7NUKEcjs.La.call(void 0, e=>A(Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1),e=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`mat4x4f(cos(${e}), sin(${e}), 0, 0, -sin(${e}), cos(${e}), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)`,A),"rotationZ4"),ie= exports.j =Wt({type:"mat2x2f",rows:2,columns:2,MatImpl:Vt}),le= exports.k =Wt({type:"mat3x3f",rows:3,columns:3,MatImpl:Ct}),A= exports.l =Wt({type:"mat4x4f",rows:4,columns:4,MatImpl:kt});function Hr(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,n)=>e[n])}function en(e){return _optionalChain([e, 'optionalAccess', _2 => _2[_chunkTRE7NUKEcjs.b]])}var Sn={f:{1:_chunkTRE7NUKEcjs.Ua,2:_chunkTRE7NUKEcjs.Xa,3:_chunkTRE7NUKEcjs.ab,4:_chunkTRE7NUKEcjs.fb},h:{1:_chunkTRE7NUKEcjs.Va,2:_chunkTRE7NUKEcjs.Ya,3:_chunkTRE7NUKEcjs.bb,4:_chunkTRE7NUKEcjs.gb},i:{1:_chunkTRE7NUKEcjs.Ta,2:_chunkTRE7NUKEcjs.Za,3:_chunkTRE7NUKEcjs.cb,4:_chunkTRE7NUKEcjs.hb},u:{1:_chunkTRE7NUKEcjs.Ra,2:_chunkTRE7NUKEcjs._a,3:_chunkTRE7NUKEcjs.db,4:_chunkTRE7NUKEcjs.ib},b:{1:_chunkTRE7NUKEcjs.Qa,2:_chunkTRE7NUKEcjs.$a,3:_chunkTRE7NUKEcjs.eb,4:_chunkTRE7NUKEcjs.jb}},Mn={vec2f:_chunkTRE7NUKEcjs.Xa,vec2h:_chunkTRE7NUKEcjs.Ya,vec2i:_chunkTRE7NUKEcjs.Za,vec2u:_chunkTRE7NUKEcjs._a,"vec2<bool>":_chunkTRE7NUKEcjs.$a,vec3f:_chunkTRE7NUKEcjs.ab,vec3h:_chunkTRE7NUKEcjs.bb,vec3i:_chunkTRE7NUKEcjs.cb,vec3u:_chunkTRE7NUKEcjs.db,"vec3<bool>":_chunkTRE7NUKEcjs.eb,vec4f:_chunkTRE7NUKEcjs.fb,vec4h:_chunkTRE7NUKEcjs.gb,vec4i:_chunkTRE7NUKEcjs.hb,vec4u:_chunkTRE7NUKEcjs.ib,"vec4<bool>":_chunkTRE7NUKEcjs.jb,mat2x2f:ie,mat3x3f:le,mat4x4f:A};function Xe(e,t){if(_chunkTRE7NUKEcjs.D.call(void 0, e)||_chunkTRE7NUKEcjs.S.call(void 0, e))return _nullishCoalesce(e.propTypes[t], () => (_chunkTRE7NUKEcjs.W));if(e===_chunkTRE7NUKEcjs.Qa||_chunkTRE7NUKEcjs.N.call(void 0, e))return _chunkTRE7NUKEcjs.W;let n=t.length;if(_chunkTRE7NUKEcjs.v.call(void 0, e)&&n>=1&&n<=4){let r=e.type.includes("bool")?"b":e.type[4],a=Sn[r][n];if(a)return a}return _chunkTRE7NUKEcjs.W}var tn={mat2x2f:_chunkTRE7NUKEcjs.Xa,mat3x3f:_chunkTRE7NUKEcjs.ab,mat4x4f:_chunkTRE7NUKEcjs.fb};function mt(e){return _chunkTRE7NUKEcjs.C.call(void 0, e)||_chunkTRE7NUKEcjs.R.call(void 0, e)?e.elementType:_chunkTRE7NUKEcjs.v.call(void 0, e)?e.primitive:e.type in tn?tn[e.type]:_chunkTRE7NUKEcjs.W}function pt(e){return e>=2**63||e<-(2**63)?_chunkTRE7NUKEcjs.aa.call(void 0, e,_chunkTRE7NUKEcjs.Pa):Number.isInteger(e)?(Number.isSafeInteger(e)||console.warn(`The integer ${e} exceeds the safe integer range and may have lost precision.`),_chunkTRE7NUKEcjs.aa.call(void 0, e,_chunkTRE7NUKEcjs.Oa)):_chunkTRE7NUKEcjs.aa.call(void 0, e,_chunkTRE7NUKEcjs.Pa)}function yt(e){return e.type==="abstractFloat"?_chunkTRE7NUKEcjs.Ua:e.type==="abstractInt"?_chunkTRE7NUKEcjs.Ta:e}function os(e){return e.map(t=>_chunkTRE7NUKEcjs.aa.call(void 0, t.value,yt(t.dataType)))}function Tt(e){if(_chunkTRE7NUKEcjs._.call(void 0, e))return e;let t=_chunkTRE7NUKEcjs.ua.call(void 0, e);return t||(_chunkTRE7NUKEcjs.r.call(void 0, e)||_chunkTRE7NUKEcjs.w.call(void 0, e)?_chunkTRE7NUKEcjs.aa.call(void 0, e,Mn[e.kind]):typeof e=="string"||typeof e=="function"||typeof e=="object"||typeof e=="symbol"||typeof e>"u"||e===null?_chunkTRE7NUKEcjs.aa.call(void 0, e,_chunkTRE7NUKEcjs.W):typeof e=="number"?pt(e):typeof e=="boolean"?_chunkTRE7NUKEcjs.aa.call(void 0, e,_chunkTRE7NUKEcjs.Qa):_chunkTRE7NUKEcjs.aa.call(void 0, e,_chunkTRE7NUKEcjs.W))}var _t={get(e,t){if(t in e)return Reflect.get(e,t);if(t==="toString"||t===Symbol.toStringTag||t===Symbol.toPrimitive)return()=>e.toString();if(typeof t=="symbol")return;let r=_chunkTRE7NUKEcjs.ua.call(void 0, e).dataType,a=Xe(r,String(t));if(a.type!=="unknown")return new Proxy({[_chunkTRE7NUKEcjs.a]:!0,[_chunkTRE7NUKEcjs.f]:s=>_chunkTRE7NUKEcjs.aa.call(void 0, `${s.resolve(e).value}.${String(t)}`,a),get[_chunkTRE7NUKEcjs.e](){return _chunkTRE7NUKEcjs.aa.call(void 0, this,a)},toString:()=>`${String(e)}.${t}`},_t)}};function ys(e){let t=e;for(;;){let n=en(t);if(!n)break;t=n}return t}function nn(e,t){return new Ut(e,t)}var Ut= (_class7 =class{constructor(t,n){;_class7.prototype.__init10.call(this);this.dataType=t;this.#e=n}__init10() {this[_chunkTRE7NUKEcjs.a]={}}#e;$name(t){return _chunkTRE7NUKEcjs.k.call(void 0, this,t),this}[_chunkTRE7NUKEcjs.f](t){let n=t.getUniqueName(this),r=t.resolve(this.dataType).value,a=t.resolve(this.#e,this.dataType).value;return t.addDeclaration(`const ${n}: ${r} = ${a};`),_chunkTRE7NUKEcjs.aa.call(void 0, n,this.dataType)}toString(){return`const:${_nullishCoalesce(_chunkTRE7NUKEcjs.j.call(void 0, this), () => ("<unnamed>"))}`}get[_chunkTRE7NUKEcjs.b](){let t=this.dataType;return new Proxy({[_chunkTRE7NUKEcjs.a]:!0,get[_chunkTRE7NUKEcjs.e](){return _chunkTRE7NUKEcjs.aa.call(void 0, this,t)},[_chunkTRE7NUKEcjs.f]:n=>n.resolve(this),toString:()=>`const:${_nullishCoalesce(_chunkTRE7NUKEcjs.j.call(void 0, this), () => ("<unnamed>"))}.$`},_t)}get value(){return _chunkTRE7NUKEcjs.Da.call(void 0, )?this[_chunkTRE7NUKEcjs.b]:this.#e}get $(){return this.value}}, _class7);function ws(){return{[_chunkTRE7NUKEcjs.a]:!0,type:"sampler",[_chunkTRE7NUKEcjs.g]:void 0}}function Ss(){return{[_chunkTRE7NUKEcjs.a]:!0,type:"sampler_comparison",[_chunkTRE7NUKEcjs.g]:void 0}}function Ms(e){return!!e[_chunkTRE7NUKEcjs.a]&&e.type==="sampler"}function Is(e){return!!e[_chunkTRE7NUKEcjs.a]&&e.type==="sampler_comparison"}function Vs(e){if("multisampled"in e){if(e.multisampled){if(e.dimension==="2d")return $n(e.sampleType);throw new Error(`Multisampled textures only support '2d' dimension, got '${e.dimension}'`)}switch(e.dimension){case"1d":return In(e.sampleType);case"2d":return An(e.sampleType);case"2d-array":return zn(e.sampleType);case"3d":return Cn(e.sampleType);case"cube":return Vn(e.sampleType);case"cube-array":return Fn(e.sampleType);default:throw new Error(`Unsupported texture dimension: '${e.dimension}'`)}}if(!("access"in e))throw new Error("Descriptor is neither a sampled nor a storage texture");switch(e.dimension){case"1d":return Pn(e.format,e.access);case"2d":return kn(e.format,e.access);case"2d-array":return Wn(e.format,e.access);case"3d":return _n(e.format,e.access);default:throw new Error(`Unsupported storage texture dimension: '${e.dimension}'`)}}function L(e,t){let r=e.startsWith("texture_depth")?["depth","float","unfilterable-float"]:t.sampleType.type==="i32"?["sint"]:t.sampleType.type==="u32"?["uint"]:["float","unfilterable-float"];return{[_chunkTRE7NUKEcjs.a]:!0,[_chunkTRE7NUKEcjs.g]:void 0,type:e,bindingSampleType:r,...t}}function xt(e,t){return{[_chunkTRE7NUKEcjs.a]:!0,[_chunkTRE7NUKEcjs.g]:void 0,type:e,...t}}var rn=new Map,dt= exports.z ={"write-only":"write","read-only":"read","read-write":"read_write"};function $(e,t){let n=rn.get(e);return n||(n=t(),rn.set(e,n)),n}function In(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_1d<${t.type}>`;return $(n,()=>L("texture_1d",{dimension:"1d",sampleType:t,multisampled:!1}))}function An(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_2d<${t.type}>`;return $(n,()=>L("texture_2d",{dimension:"2d",sampleType:t,multisampled:!1}))}function $n(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_multisampled_2d<${t.type}>`;return $(n,()=>L("texture_multisampled_2d",{dimension:"2d",sampleType:t,multisampled:!0}))}function zn(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_2d_array<${t.type}>`;return $(n,()=>L("texture_2d_array",{dimension:"2d-array",sampleType:t,multisampled:!1}))}function Vn(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_cube<${t.type}>`;return $(n,()=>L("texture_cube",{dimension:"cube",sampleType:t,multisampled:!1}))}function Fn(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_cube_array<${t.type}>`;return $(n,()=>L("texture_cube_array",{dimension:"cube-array",sampleType:t,multisampled:!1}))}function Cn(e){let t=e||_chunkTRE7NUKEcjs.Ua,n=`texture_3d<${t.type}>`;return $(n,()=>L("texture_3d",{dimension:"3d",sampleType:t,multisampled:!1}))}function Pn(e,t){let n=t||"write-only",r=`texture_storage_1d<${e}, ${dt[n]}>`;return $(r,()=>xt("texture_storage_1d",{dimension:"1d",format:e,access:n}))}function kn(e,t){let n=t||"write-only",r=`texture_storage_2d<${e}, ${dt[n]}>`;return $(r,()=>xt("texture_storage_2d",{dimension:"2d",format:e,access:n}))}function Wn(e,t){let n=t||"write-only",r=`texture_storage_2d_array<${e}, ${dt[n]}>`;return $(r,()=>xt("texture_storage_2d_array",{dimension:"2d-array",format:e,access:n}))}function _n(e,t){let n=t||"write-only",r=`texture_storage_3d<${e}, ${dt[n]}>`;return $(r,()=>xt("texture_storage_3d",{dimension:"3d",format:e,access:n}))}function Fs(){return $("texture_depth_2d",()=>L("texture_depth_2d",{dimension:"2d",sampleType:_chunkTRE7NUKEcjs.Ua,multisampled:!1}))}function Cs(){return $("texture_depth_multisampled_2d",()=>L("texture_depth_multisampled_2d",{dimension:"2d",sampleType:_chunkTRE7NUKEcjs.Ua,multisampled:!0}))}function Ps(){return $("texture_depth_2d_array",()=>L("texture_depth_2d_array",{dimension:"2d-array",sampleType:_chunkTRE7NUKEcjs.Ua,multisampled:!1}))}function ks(){return $("texture_depth_cube",()=>L("texture_depth_cube",{dimension:"cube",sampleType:_chunkTRE7NUKEcjs.Ua,multisampled:!1}))}function Ws(){return $("texture_depth_cube_array",()=>L("texture_depth_cube_array",{dimension:"cube-array",sampleType:_chunkTRE7NUKEcjs.Ua,multisampled:!1}))}function _s(){return $("texture_external",()=>({[_chunkTRE7NUKEcjs.a]:!0,[_chunkTRE7NUKEcjs.g]:void 0,type:"texture_external",dimension:"2d"}))}function Us(e){return!!e[_chunkTRE7NUKEcjs.a]&&typeof e.multisampled=="boolean"}function Ds(e){return!!e[_chunkTRE7NUKEcjs.a]&&typeof e.format=="string"&&typeof e.access=="string"}function Gs(e){return new Dt(e)}var Dt= (_class8 =class{constructor(t){;_class8.prototype.__init11.call(this);_class8.prototype.__init12.call(this);this.inner=t}__init11() {this[_chunkTRE7NUKEcjs.a]=!0}__init12() {this.type="atomic"}}, _class8);var me=(e,t,n)=>{if(e===t)return 0;let r=y((n-e)/(t-e),0,1);return r*r*(3-2*r)},y=(e,t,n)=>Math.min(Math.max(t,e),n),he=(e,t)=>t===0?e:Math.trunc(e/t);function Y(e){let t=new DataView(new ArrayBuffer(4));return t.setUint32(0,e,!0),t.getFloat32(0,!0)}function J(e){let t=new DataView(new ArrayBuffer(4));return t.setUint32(0,e,!0),t.getInt32(0,!0)}var N=_chunkTRE7NUKEcjs.$a[_chunkTRE7NUKEcjs.a].jsImpl,q=_chunkTRE7NUKEcjs.Xa[_chunkTRE7NUKEcjs.a].jsImpl,ye=_chunkTRE7NUKEcjs.Ya[_chunkTRE7NUKEcjs.a].jsImpl,Ue=_chunkTRE7NUKEcjs.Za[_chunkTRE7NUKEcjs.a].jsImpl,tt=_chunkTRE7NUKEcjs._a[_chunkTRE7NUKEcjs.a].jsImpl,O=_chunkTRE7NUKEcjs.eb[_chunkTRE7NUKEcjs.a].jsImpl,_=_chunkTRE7NUKEcjs.ab[_chunkTRE7NUKEcjs.a].jsImpl,ee=_chunkTRE7NUKEcjs.bb[_chunkTRE7NUKEcjs.a].jsImpl,De=_chunkTRE7NUKEcjs.cb[_chunkTRE7NUKEcjs.a].jsImpl,nt=_chunkTRE7NUKEcjs.db[_chunkTRE7NUKEcjs.a].jsImpl,K=_chunkTRE7NUKEcjs.jb[_chunkTRE7NUKEcjs.a].jsImpl,j=_chunkTRE7NUKEcjs.fb[_chunkTRE7NUKEcjs.a].jsImpl,Te=_chunkTRE7NUKEcjs.gb[_chunkTRE7NUKEcjs.a].jsImpl,Be=_chunkTRE7NUKEcjs.hb[_chunkTRE7NUKEcjs.a].jsImpl,rt=_chunkTRE7NUKEcjs.ib[_chunkTRE7NUKEcjs.a].jsImpl,Me=e=>Math.sqrt(e.x**2+e.y**2),Ie=e=>Math.sqrt(e.x**2+e.y**2+e.z**2),Ae=e=>Math.sqrt(e.x**2+e.y**2+e.z**2+e.w**2),ft=(e,t)=>e.x*t.x+e.y*t.y,gt=(e,t)=>e.x*t.x+e.y*t.y+e.z*t.z,ht=(e,t)=>e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,h=e=>t=>q(e(t.x),e(t.y)),b=e=>t=>ye(e(t.x),e(t.y)),$e=e=>t=>Ue(e(t.x),e(t.y)),Ye=e=>t=>tt(e(t.x),e(t.y)),f=e=>t=>_(e(t.x),e(t.y),e(t.z)),w=e=>t=>ee(e(t.x),e(t.y),e(t.z)),ze=e=>t=>De(e(t.x),e(t.y),e(t.z)),Je=e=>t=>nt(e(t.x),e(t.y),e(t.z)),x=e=>t=>j(e(t.x),e(t.y),e(t.z),e(t.w)),S=e=>t=>Te(e(t.x),e(t.y),e(t.z),e(t.w)),Ve=e=>t=>Be(e(t.x),e(t.y),e(t.z),e(t.w)),et=e=>t=>rt(e(t.x),e(t.y),e(t.z),e(t.w)),sn=e=>t=>{let n=t.columns;return ie(h(e)(n[0]),h(e)(n[1]))},an=e=>t=>{let n=t.columns;return le(f(e)(n[0]),f(e)(n[1]),f(e)(n[2]))},on=e=>t=>{let n=t.columns;return A(x(e)(n[0]),x(e)(n[1]),x(e)(n[2]),x(e)(n[3]))},pe=e=>(t,n)=>q(e(t.x,n.x),e(t.y,n.y)),ve=e=>(t,n)=>ye(e(t.x,n.x),e(t.y,n.y)),Fe=e=>(t,n)=>Ue(e(t.x,n.x),e(t.y,n.y)),Ce=e=>(t,n)=>tt(e(t.x,n.x),e(t.y,n.y)),te=e=>(t,n)=>_(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z)),be=e=>(t,n)=>ee(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z)),Pe=e=>(t,n)=>De(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z)),ke=e=>(t,n)=>nt(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z)),X=e=>(t,n)=>j(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z),e(t.w,n.w)),we=e=>(t,n)=>Te(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z),e(t.w,n.w)),We=e=>(t,n)=>Be(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z),e(t.w,n.w)),_e=e=>(t,n)=>rt(e(t.x,n.x),e(t.y,n.y),e(t.z,n.z),e(t.w,n.w)),Un=e=>(t,n)=>{let r=t.columns,a=n.columns;return ie(pe(e)(r[0],a[0]),pe(e)(r[1],a[1]))},Dn=e=>(t,n)=>{let r=t.columns,a=n.columns;return le(te(e)(r[0],a[0]),te(e)(r[1],a[1]),te(e)(r[2],a[2]))},Bn=e=>(t,n)=>{let r=t.columns,a=n.columns;return A(X(e)(r[0],a[0]),X(e)(r[1],a[1]),X(e)(r[2],a[2]),X(e)(r[3],a[3]))},Rn=e=>(t,n,r)=>q(e(t.x,n.x,r.x),e(t.y,n.y,r.y)),Gn=e=>(t,n,r)=>ye(e(t.x,n.x,r.x),e(t.y,n.y,r.y)),En=e=>(t,n,r)=>_(e(t.x,n.x,r.x),e(t.y,n.y,r.y),e(t.z,n.z,r.z)),Ln=e=>(t,n,r)=>ee(e(t.x,n.x,r.x),e(t.y,n.y,r.y),e(t.z,n.z,r.z)),Nn=e=>(t,n,r)=>j(e(t.x,n.x,r.x),e(t.y,n.y,r.y),e(t.z,n.z,r.z),e(t.w,n.w,r.w)),On=e=>(t,n,r)=>Te(e(t.x,n.x,r.x),e(t.y,n.y,r.y),e(t.z,n.z,r.z),e(t.w,n.w,r.w)),m= exports.W ={eq:{vec2f:(e,t)=>N(e.x===t.x,e.y===t.y),vec2h:(e,t)=>N(e.x===t.x,e.y===t.y),vec2i:(e,t)=>N(e.x===t.x,e.y===t.y),vec2u:(e,t)=>N(e.x===t.x,e.y===t.y),"vec2<bool>":(e,t)=>N(e.x===t.x,e.y===t.y),vec3f:(e,t)=>O(e.x===t.x,e.y===t.y,e.z===t.z),vec3h:(e,t)=>O(e.x===t.x,e.y===t.y,e.z===t.z),vec3i:(e,t)=>O(e.x===t.x,e.y===t.y,e.z===t.z),vec3u:(e,t)=>O(e.x===t.x,e.y===t.y,e.z===t.z),"vec3<bool>":(e,t)=>O(e.x===t.x,e.y===t.y,e.z===t.z),vec4f:(e,t)=>K(e.x===t.x,e.y===t.y,e.z===t.z,e.w===t.w),vec4h:(e,t)=>K(e.x===t.x,e.y===t.y,e.z===t.z,e.w===t.w),vec4i:(e,t)=>K(e.x===t.x,e.y===t.y,e.z===t.z,e.w===t.w),vec4u:(e,t)=>K(e.x===t.x,e.y===t.y,e.z===t.z,e.w===t.w),"vec4<bool>":(e,t)=>K(e.x===t.x,e.y===t.y,e.z===t.z,e.w===t.w)},lt:{vec2f:(e,t)=>N(e.x<t.x,e.y<t.y),vec2h:(e,t)=>N(e.x<t.x,e.y<t.y),vec2i:(e,t)=>N(e.x<t.x,e.y<t.y),vec2u:(e,t)=>N(e.x<t.x,e.y<t.y),vec3f:(e,t)=>O(e.x<t.x,e.y<t.y,e.z<t.z),vec3h:(e,t)=>O(e.x<t.x,e.y<t.y,e.z<t.z),vec3i:(e,t)=>O(e.x<t.x,e.y<t.y,e.z<t.z),vec3u:(e,t)=>O(e.x<t.x,e.y<t.y,e.z<t.z),vec4f:(e,t)=>K(e.x<t.x,e.y<t.y,e.z<t.z,e.w<t.w),vec4h:(e,t)=>K(e.x<t.x,e.y<t.y,e.z<t.z,e.w<t.w),vec4i:(e,t)=>K(e.x<t.x,e.y<t.y,e.z<t.z,e.w<t.w),vec4u:(e,t)=>K(e.x<t.x,e.y<t.y,e.z<t.z,e.w<t.w)},or:{"vec2<bool>":(e,t)=>N(e.x||t.x,e.y||t.y),"vec3<bool>":(e,t)=>O(e.x||t.x,e.y||t.y,e.z||t.z),"vec4<bool>":(e,t)=>K(e.x||t.x,e.y||t.y,e.z||t.z,e.w||t.w)},all:{"vec2<bool>":e=>e.x&&e.y,"vec3<bool>":e=>e.x&&e.y&&e.z,"vec4<bool>":e=>e.x&&e.y&&e.z&&e.w},abs:{vec2f:h(Math.abs),vec2h:b(Math.abs),vec2i:$e(Math.abs),vec2u:Ye(Math.abs),vec3f:f(Math.abs),vec3h:w(Math.abs),vec3i:ze(Math.abs),vec3u:Je(Math.abs),vec4f:x(Math.abs),vec4h:S(Math.abs),vec4i:Ve(Math.abs),vec4u:et(Math.abs)},atan2:{vec2f:pe(Math.atan2),vec2h:ve(Math.atan2),vec3f:te(Math.atan2),vec3h:be(Math.atan2),vec4f:X(Math.atan2),vec4h:we(Math.atan2)},acos:{vec2f:h(Math.acos),vec2h:b(Math.acos),vec2i:$e(Math.acos),vec2u:Ye(Math.acos),vec3f:f(Math.acos),vec3h:w(Math.acos),vec3i:ze(Math.acos),vec3u:Je(Math.acos),vec4f:x(Math.acos),vec4h:S(Math.acos),vec4i:Ve(Math.acos),vec4u:et(Math.acos)},acosh:{vec2f:h(Math.acosh),vec2h:b(Math.acosh),vec3f:f(Math.acosh),vec3h:w(Math.acosh),vec4f:x(Math.acosh),vec4h:S(Math.acosh)},asin:{vec2f:h(Math.asin),vec2h:b(Math.asin),vec3f:f(Math.asin),vec3h:w(Math.asin),vec4f:x(Math.asin),vec4h:S(Math.asin)},asinh:{vec2f:h(Math.asinh),vec2h:b(Math.asinh),vec3f:f(Math.asinh),vec3h:w(Math.asinh),vec4f:x(Math.asinh),vec4h:S(Math.asinh)},atan:{vec2f:h(Math.atan),vec2h:b(Math.atan),vec3f:f(Math.atan),vec3h:w(Math.atan),vec4f:x(Math.atan),vec4h:S(Math.atan)},atanh:{vec2f:h(Math.atanh),vec2h:b(Math.atanh),vec3f:f(Math.atanh),vec3h:w(Math.atanh),vec4f:x(Math.atanh),vec4h:S(Math.atanh)},ceil:{vec2f:h(Math.ceil),vec2h:b(Math.ceil),vec3f:f(Math.ceil),vec3h:w(Math.ceil),vec4f:x(Math.ceil),vec4h:S(Math.ceil)},clamp:{vec2f:(e,t,n)=>q(y(e.x,t.x,n.x),y(e.y,t.y,n.y)),vec2h:(e,t,n)=>ye(y(e.x,t.x,n.x),y(e.y,t.y,n.y)),vec2i:(e,t,n)=>Ue(y(e.x,t.x,n.x),y(e.y,t.y,n.y)),vec2u:(e,t,n)=>tt(y(e.x,t.x,n.x),y(e.y,t.y,n.y)),vec3f:(e,t,n)=>_(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z)),vec3h:(e,t,n)=>ee(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z)),vec3i:(e,t,n)=>De(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z)),vec3u:(e,t,n)=>nt(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z)),vec4f:(e,t,n)=>j(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z),y(e.w,t.w,n.w)),vec4h:(e,t,n)=>Te(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z),y(e.w,t.w,n.w)),vec4i:(e,t,n)=>Be(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z),y(e.w,t.w,n.w)),vec4u:(e,t,n)=>rt(y(e.x,t.x,n.x),y(e.y,t.y,n.y),y(e.z,t.z,n.z),y(e.w,t.w,n.w))},length:{vec2f:Me,vec2h:Me,vec3f:Ie,vec3h:Ie,vec4f:Ae,vec4h:Ae},add:{vec2f:pe((e,t)=>e+t),vec2h:ve((e,t)=>e+t),vec2i:Fe((e,t)=>e+t),vec2u:Ce((e,t)=>e+t),vec3f:te((e,t)=>e+t),vec3h:be((e,t)=>e+t),vec3i:Pe((e,t)=>e+t),vec3u:ke((e,t)=>e+t),vec4f:X((e,t)=>e+t),vec4h:we((e,t)=>e+t),vec4i:We((e,t)=>e+t),vec4u:_e((e,t)=>e+t),mat2x2f:Un((e,t)=>e+t),mat3x3f:Dn((e,t)=>e+t),mat4x4f:Bn((e,t)=>e+t)},smoothstep:{vec2f:Rn(me),vec2h:Gn(me),vec3f:En(me),vec3h:Ln(me),vec4f:Nn(me),vec4h:On(me)},addMixed:{vec2f:(e,t)=>h(n=>n+t)(e),vec2h:(e,t)=>b(n=>n+t)(e),vec2i:(e,t)=>$e(n=>n+t)(e),vec2u:(e,t)=>Ye(n=>n+t)(e),vec3f:(e,t)=>f(n=>n+t)(e),vec3h:(e,t)=>w(n=>n+t)(e),vec3i:(e,t)=>ze(n=>n+t)(e),vec3u:(e,t)=>Je(n=>n+t)(e),vec4f:(e,t)=>x(n=>n+t)(e),vec4h:(e,t)=>S(n=>n+t)(e),vec4i:(e,t)=>Ve(n=>n+t)(e),vec4u:(e,t)=>et(n=>n+t)(e),mat2x2f:(e,t)=>sn(n=>n+t)(e),mat3x3f:(e,t)=>an(n=>n+t)(e),mat4x4f:(e,t)=>on(n=>n+t)(e)},mulSxV:{vec2f:(e,t)=>h(n=>e*n)(t),vec2h:(e,t)=>b(n=>e*n)(t),vec2i:(e,t)=>$e(n=>e*n)(t),vec2u:(e,t)=>Ye(n=>e*n)(t),vec3f:(e,t)=>f(n=>e*n)(t),vec3h:(e,t)=>w(n=>e*n)(t),vec3i:(e,t)=>ze(n=>e*n)(t),vec3u:(e,t)=>Je(n=>e*n)(t),vec4f:(e,t)=>x(n=>e*n)(t),vec4h:(e,t)=>S(n=>e*n)(t),vec4i:(e,t)=>Ve(n=>e*n)(t),vec4u:(e,t)=>et(n=>e*n)(t),mat2x2f:(e,t)=>sn(n=>e*n)(t),mat3x3f:(e,t)=>an(n=>e*n)(t),mat4x4f:(e,t)=>on(n=>e*n)(t)},mulVxV:{vec2f:pe((e,t)=>e*t),vec2h:ve((e,t)=>e*t),vec2i:Fe((e,t)=>e*t),vec2u:Ce((e,t)=>e*t),vec3f:te((e,t)=>e*t),vec3h:be((e,t)=>e*t),vec3i:Pe((e,t)=>e*t),vec3u:ke((e,t)=>e*t),vec4f:X((e,t)=>e*t),vec4h:we((e,t)=>e*t),vec4i:We((e,t)=>e*t),vec4u:_e((e,t)=>e*t),mat2x2f:(e,t)=>{let n=e.columns,r=t.columns;return ie(n[0].x*r[0].x+n[1].x*r[0].y,n[0].y*r[0].x+n[1].y*r[0].y,n[0].x*r[1].x+n[1].x*r[1].y,n[0].y*r[1].x+n[1].y*r[1].y)},mat3x3f:(e,t)=>{let n=e.columns,r=t.columns;return le(n[0].x*r[0].x+n[1].x*r[0].y+n[2].x*r[0].z,n[0].y*r[0].x+n[1].y*r[0].y+n[2].y*r[0].z,n[0].z*r[0].x+n[1].z*r[0].y+n[2].z*r[0].z,n[0].x*r[1].x+n[1].x*r[1].y+n[2].x*r[1].z,n[0].y*r[1].x+n[1].y*r[1].y+n[2].y*r[1].z,n[0].z*r[1].x+n[1].z*r[1].y+n[2].z*r[1].z,n[0].x*r[2].x+n[1].x*r[2].y+n[2].x*r[2].z,n[0].y*r[2].x+n[1].y*r[2].y+n[2].y*r[2].z,n[0].z*r[2].x+n[1].z*r[2].y+n[2].z*r[2].z)},mat4x4f:(e,t)=>{let n=e.columns,r=t.columns;return A(n[0].x*r[0].x+n[1].x*r[0].y+n[2].x*r[0].z+n[3].x*r[0].w,n[0].y*r[0].x+n[1].y*r[0].y+n[2].y*r[0].z+n[3].y*r[0].w,n[0].z*r[0].x+n[1].z*r[0].y+n[2].z*r[0].z+n[3].z*r[0].w,n[0].w*r[0].x+n[1].w*r[0].y+n[2].w*r[0].z+n[3].w*r[0].w,n[0].x*r[1].x+n[1].x*r[1].y+n[2].x*r[1].z+n[3].x*r[1].w,n[0].y*r[1].x+n[1].y*r[1].y+n[2].y*r[1].z+n[3].y*r[1].w,n[0].z*r[1].x+n[1].z*r[1].y+n[2].z*r[1].z+n[3].z*r[1].w,n[0].w*r[1].x+n[1].w*r[1].y+n[2].w*r[1].z+n[3].w*r[1].w,n[0].x*r[2].x+n[1].x*r[2].y+n[2].x*r[2].z+n[3].x*r[2].w,n[0].y*r[2].x+n[1].y*r[2].y+n[2].y*r[2].z+n[3].y*r[2].w,n[0].z*r[2].x+n[1].z*r[2].y+n[2].z*r[2].z+n[3].z*r[2].w,n[0].w*r[2].x+n[1].w*r[2].y+n[2].w*r[2].z+n[3].w*r[2].w,n[0].x*r[3].x+n[1].x*r[3].y+n[2].x*r[3].z+n[3].x*r[3].w,n[0].y*r[3].x+n[1].y*r[3].y+n[2].y*r[3].z+n[3].y*r[3].w,n[0].z*r[3].x+n[1].z*r[3].y+n[2].z*r[3].z+n[3].z*r[3].w,n[0].w*r[3].x+n[1].w*r[3].y+n[2].w*r[3].z+n[3].w*r[3].w)}},mulMxV:{mat2x2f:(e,t)=>{let n=e.columns;return q(n[0].x*t.x+n[1].x*t.y,n[0].y*t.x+n[1].y*t.y)},mat3x3f:(e,t)=>{let n=e.columns;return _(n[0].x*t.x+n[1].x*t.y+n[2].x*t.z,n[0].y*t.x+n[1].y*t.y+n[2].y*t.z,n[0].z*t.x+n[1].z*t.y+n[2].z*t.z)},mat4x4f:(e,t)=>{let n=e.columns;return j(n[0].x*t.x+n[1].x*t.y+n[2].x*t.z+n[3].x*t.w,n[0].y*t.x+n[1].y*t.y+n[2].y*t.z+n[3].y*t.w,n[0].z*t.x+n[1].z*t.y+n[2].z*t.z+n[3].z*t.w,n[0].w*t.x+n[1].w*t.y+n[2].w*t.z+n[3].w*t.w)}},mulVxM:{mat2x2f:(e,t)=>{let n=t.columns;return q(e.x*n[0].x+e.y*n[0].y,e.x*n[1].x+e.y*n[1].y)},mat3x3f:(e,t)=>{let n=t.columns;return _(e.x*n[0].x+e.y*n[0].y+e.z*n[0].z,e.x*n[1].x+e.y*n[1].y+e.z*n[1].z,e.x*n[2].x+e.y*n[2].y+e.z*n[2].z)},mat4x4f:(e,t)=>{let n=t.columns;return j(e.x*n[0].x+e.y*n[0].y+e.z*n[0].z+e.w*n[0].w,e.x*n[1].x+e.y*n[1].y+e.z*n[1].z+e.w*n[1].w,e.x*n[2].x+e.y*n[2].y+e.z*n[2].z+e.w*n[2].w,e.x*n[3].x+e.y*n[3].y+e.z*n[3].z+e.w*n[3].w)}},div:{vec2f:pe((e,t)=>e/t),vec2h:ve((e,t)=>e/t),vec2i:Fe(he),vec2u:Ce(he),vec3f:te((e,t)=>e/t),vec3h:be((e,t)=>e/t),vec3i:Pe(he),vec3u:ke(he),vec4f:X((e,t)=>e/t),vec4h:we((e,t)=>e/t),vec4i:We(he),vec4u:_e(he)},dot:{vec2f:ft,vec2h:ft,vec2i:ft,vec2u:ft,vec3f:gt,vec3h:gt,vec3i:gt,vec3u:gt,vec4f:ht,vec4h:ht,vec4i:ht,vec4u:ht},normalize:{vec2f:e=>{let t=Me(e);return q(e.x/t,e.y/t)},vec2h:e=>{let t=Me(e);return ye(e.x/t,e.y/t)},vec2i:e=>{let t=Me(e);return Ue(e.x/t,e.y/t)},vec2u:e=>{let t=Me(e);return tt(e.x/t,e.y/t)},vec3f:e=>{let t=Ie(e);return _(e.x/t,e.y/t,e.z/t)},vec3h:e=>{let t=Ie(e);return ee(e.x/t,e.y/t,e.z/t)},vec3i:e=>{let t=Ie(e);return De(e.x/t,e.y/t,e.z/t)},vec3u:e=>{let t=Ie(e);return nt(e.x/t,e.y/t,e.z/t)},vec4f:e=>{let t=Ae(e);return j(e.x/t,e.y/t,e.z/t,e.w/t)},vec4h:e=>{let t=Ae(e);return Te(e.x/t,e.y/t,e.z/t,e.w/t)},vec4i:e=>{let t=Ae(e);return Be(e.x/t,e.y/t,e.z/t,e.w/t)},vec4u:e=>{let t=Ae(e);return rt(e.x/t,e.y/t,e.z/t,e.w/t)}},cross:{vec3f:(e,t)=>_(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3h:(e,t)=>ee(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x)},mod:{vec2f:pe((e,t)=>e%t),vec2h:ve((e,t)=>e%t),vec2i:Fe((e,t)=>e%t),vec2u:Ce((e,t)=>e%t),vec3f:te((e,t)=>e%t),vec3h:be((e,t)=>e%t),vec3i:Pe((e,t)=>e%t),vec3u:ke((e,t)=>e%t),vec4f:X((e,t)=>e%t),vec4h:we((e,t)=>e%t),vec4i:We((e,t)=>e%t),vec4u:_e((e,t)=>e%t)},floor:{vec2f:h(Math.floor),vec2h:b(Math.floor),vec3f:f(Math.floor),vec3h:w(Math.floor),vec4f:x(Math.floor),vec4h:S(Math.floor)},max:{vec2f:pe(Math.max),vec2h:ve(Math.max),vec2i:Fe(Math.max),vec2u:Ce(Math.max),vec3f:te(Math.max),vec3h:be(Math.max),vec3i:Pe(Math.max),vec3u:ke(Math.max),vec4f:X(Math.max),vec4h:we(Math.max),vec4i:We(Math.max),vec4u:_e(Math.max)},min:{vec2f:pe(Math.min),vec2h:ve(Math.min),vec2i:Fe(Math.min),vec2u:Ce(Math.min),vec3f:te(Math.min),vec3h:be(Math.min),vec3i:Pe(Math.min),vec3u:ke(Math.min),vec4f:X(Math.min),vec4h:we(Math.min),vec4i:We(Math.min),vec4u:_e(Math.min)},pow:{vec2f:(e,t)=>q(e.x**t.x,e.y**t.y),vec2h:(e,t)=>ye(e.x**t.x,e.y**t.y),vec3f:(e,t)=>_(e.x**t.x,e.y**t.y,e.z**t.z),vec3h:(e,t)=>ee(e.x**t.x,e.y**t.y,e.z**t.z),vec4f:(e,t)=>j(e.x**t.x,e.y**t.y,e.z**t.z,e.w**t.w),vec4h:(e,t)=>Te(e.x**t.x,e.y**t.y,e.z**t.z,e.w**t.w)},sign:{vec2f:h(Math.sign),vec2h:b(Math.sign),vec2i:$e(Math.sign),vec3f:f(Math.sign),vec3h:w(Math.sign),vec3i:ze(Math.sign),vec4f:x(Math.sign),vec4h:S(Math.sign),vec4i:Ve(Math.sign)},sqrt:{vec2f:h(Math.sqrt),vec2h:b(Math.sqrt),vec3f:f(Math.sqrt),vec3h:w(Math.sqrt),vec4f:x(Math.sqrt),vec4h:S(Math.sqrt)},mix:{vec2f:(e,t,n)=>typeof n=="number"?q(e.x*(1-n)+t.x*n,e.y*(1-n)+t.y*n):q(e.x*(1-n.x)+t.x*n.x,e.y*(1-n.y)+t.y*n.y),vec2h:(e,t,n)=>typeof n=="number"?ye(e.x*(1-n)+t.x*n,e.y*(1-n)+t.y*n):ye(e.x*(1-n.x)+t.x*n.x,e.y*(1-n.y)+t.y*n.y),vec3f:(e,t,n)=>typeof n=="number"?_(e.x*(1-n)+t.x*n,e.y*(1-n)+t.y*n,e.z*(1-n)+t.z*n):_(e.x*(1-n.x)+t.x*n.x,e.y*(1-n.y)+t.y*n.y,e.z*(1-n.z)+t.z*n.z),vec3h:(e,t,n)=>typeof n=="number"?ee(e.x*(1-n)+t.x*n,e.y*(1-n)+t.y*n,e.z*(1-n)+t.z*n):ee(e.x*(1-n.x)+t.x*n.x,e.y*(1-n.y)+t.y*n.y,e.z*(1-n.z)+t.z*n.z),vec4f:(e,t,n)=>typeof n=="number"?j(e.x*(1-n)+t.x*n,e.y*(1-n)+t.y*n,e.z*(1-n)+t.z*n,e.w*(1-n)+t.w*n):j(e.x*(1-n.x)+t.x*n.x,e.y*(1-n.y)+t.y*n.y,e.z*(1-n.z)+t.z*n.z,e.w*(1-n.w)+t.w*n.w),vec4h:(e,t,n)=>typeof n=="number"?Te(e.x*(1-n)+t.x*n,e.y*(1-n)+t.y*n,e.z*(1-n)+t.z*n,e.w*(1-n)+t.w*n):Te(e.x*(1-n.x)+t.x*n.x,e.y*(1-n.y)+t.y*n.y,e.z*(1-n.z)+t.z*n.z,e.w*(1-n.w)+t.w*n.w)},sin:{vec2f:h(Math.sin),vec2h:b(Math.sin),vec3f:f(Math.sin),vec3h:w(Math.sin),vec4f:x(Math.sin),vec4h:S(Math.sin)},cos:{vec2f:h(Math.cos),vec2h:b(Math.cos),vec3f:f(Math.cos),vec3h:w(Math.cos),vec4f:x(Math.cos),vec4h:S(Math.cos)},cosh:{vec2f:h(Math.cosh),vec2h:b(Math.cosh),vec3f:f(Math.cosh),vec3h:w(Math.cosh),vec4f:x(Math.cosh),vec4h:S(Math.cosh)},exp:{vec2f:h(Math.exp),vec2h:b(Math.exp),vec3f:f(Math.exp),vec3h:w(Math.exp),vec4f:x(Math.exp),vec4h:S(Math.exp)},exp2:{vec2f:h(e=>2**e),vec2h:b(e=>2**e),vec3f:f(e=>2**e),vec3h:w(e=>2**e),vec4f:x(e=>2**e),vec4h:S(e=>2**e)},log:{vec2f:h(Math.log),vec2h:b(Math.log),vec3f:f(Math.log),vec3h:w(Math.log),vec4f:x(Math.log),vec4h:S(Math.log)},log2:{vec2f:h(Math.log2),vec2h:b(Math.log2),vec3f:f(Math.log2),vec3h:w(Math.log2),vec4f:x(Math.log2),vec4h:S(Math.log2)},fract:{vec2f:h(e=>e-Math.floor(e)),vec2h:b(e=>e-Math.floor(e)),vec3f:f(e=>e-Math.floor(e)),vec3h:w(e=>e-Math.floor(e)),vec4f:x(e=>e-Math.floor(e)),vec4h:S(e=>e-Math.floor(e))},isCloseToZero:{vec2f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t,vec2h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t,vec3f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t,vec3h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t,vec4f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t&&Math.abs(e.w)<=t,vec4h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t&&Math.abs(e.w)<=t},neg:{vec2f:h(e=>-e),vec2h:b(e=>-e),vec2i:$e(e=>-e),vec2u:Ye(e=>-e),"vec2<bool>":e=>N(!e.x,!e.y),vec3f:f(e=>-e),vec3h:w(e=>-e),vec3i:ze(e=>-e),vec3u:Je(e=>-e),"vec3<bool>":e=>O(!e.x,!e.y,!e.z),vec4f:x(e=>-e),vec4h:S(e=>-e),vec4i:Ve(e=>-e),vec4u:et(e=>-e),"vec4<bool>":e=>K(!e.x,!e.y,!e.z,!e.w)},select:{vec2f:(e,t,n)=>q(n.x?t.x:e.x,n.y?t.y:e.y),vec2h:(e,t,n)=>ye(n.x?t.x:e.x,n.y?t.y:e.y),vec2i:(e,t,n)=>Ue(n.x?t.x:e.x,n.y?t.y:e.y),vec2u:(e,t,n)=>tt(n.x?t.x:e.x,n.y?t.y:e.y),"vec2<bool>":(e,t,n)=>N(n.x?t.x:e.x,n.y?t.y:e.y),vec3f:(e,t,n)=>_(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z),vec3h:(e,t,n)=>ee(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z),vec3i:(e,t,n)=>De(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z),vec3u:(e,t,n)=>nt(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z),"vec3<bool>":(e,t,n)=>O(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z),vec4f:(e,t,n)=>j(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z,n.w?t.w:e.w),vec4h:(e,t,n)=>Te(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z,n.w?t.w:e.w),vec4i:(e,t,n)=>Be(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z,n.w?t.w:e.w),vec4u:(e,t,n)=>rt(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z,n.w?t.w:e.w),"vec4<bool>":(e,t,n)=>K(n.x?t.x:e.x,n.y?t.y:e.y,n.z?t.z:e.z,n.w?t.w:e.w)},tanh:{vec2f:h(Math.tanh),vec2h:b(Math.tanh),vec3f:f(Math.tanh),vec3h:w(Math.tanh),vec4f:x(Math.tanh),vec4h:S(Math.tanh)},bitcastU32toF32:{vec2u:e=>q(Y(e.x),Y(e.y)),vec3u:e=>_(Y(e.x),Y(e.y),Y(e.z)),vec4u:e=>j(Y(e.x),Y(e.y),Y(e.z),Y(e.w))},bitcastU32toI32:{vec2u:e=>Ue(J(e.x),J(e.y)),vec3u:e=>De(J(e.x),J(e.y),J(e.z)),vec4u:e=>Be(J(e.x),J(e.y),J(e.z),J(e.w))}};function un(e,t){if(typeof e=="number"&&typeof t=="number")return e+t;if(typeof e=="number"&&_chunkTRE7NUKEcjs.r.call(void 0, t))return m.addMixed[t.kind](t,e);if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&typeof t=="number")return m.addMixed[e.kind](e,t);if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&_chunkTRE7NUKEcjs.r.call(void 0, t)||_chunkTRE7NUKEcjs.w.call(void 0, e)&&_chunkTRE7NUKEcjs.w.call(void 0, t))return m.add[e.kind](e,t);throw new Error("Add/Sub called with invalid arguments.")}var Bt=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"add",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e));return{argTypes:t,returnType:_chunkTRE7NUKEcjs.N.call(void 0, t[0])?t[1]:t[0]}},normalImpl:un,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`(${e} + ${t})`});function Kn(e,t){return un(e,cn(-1,t))}var Re=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"sub",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e));return{argTypes:t,returnType:_chunkTRE7NUKEcjs.N.call(void 0, t[0])?t[1]:t[0]}},normalImpl:Kn,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`(${e} - ${t})`});function cn(e,t){if(typeof e=="number"&&typeof t=="number")return e*t;if(typeof e=="number"&&(_chunkTRE7NUKEcjs.r.call(void 0, t)||_chunkTRE7NUKEcjs.w.call(void 0, t)))return m.mulSxV[t.kind](e,t);if((_chunkTRE7NUKEcjs.r.call(void 0, e)||_chunkTRE7NUKEcjs.w.call(void 0, e))&&typeof t=="number")return m.mulSxV[e.kind](t,e);if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&_chunkTRE7NUKEcjs.r.call(void 0, t))return m.mulVxV[e.kind](e,t);if(_chunkTRE7NUKEcjs.A.call(void 0, e)&&_chunkTRE7NUKEcjs.w.call(void 0, t))return m.mulVxM[t.kind](e,t);if(_chunkTRE7NUKEcjs.w.call(void 0, e)&&_chunkTRE7NUKEcjs.A.call(void 0, t))return m.mulMxV[e.kind](e,t);if(_chunkTRE7NUKEcjs.w.call(void 0, e)&&_chunkTRE7NUKEcjs.w.call(void 0, t))return m.mulVxV[e.kind](e,t);throw new Error("Mul called with invalid arguments.")}var st=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"mul",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e)),n=_chunkTRE7NUKEcjs.N.call(void 0, t[0])?t[1]:_chunkTRE7NUKEcjs.N.call(void 0, t[1])||t[0].type.startsWith("vec")?t[0]:t[1].type.startsWith("vec")?t[1]:t[0];return{argTypes:t,returnType:n}},normalImpl:cn,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`(${e} * ${t})`});function qn(e,t){if(typeof e=="number"&&typeof t=="number")return e/t;if(typeof e=="number"&&_chunkTRE7NUKEcjs.r.call(void 0, t)){let n=_chunkTRE7NUKEcjs.kb[t.kind][_chunkTRE7NUKEcjs.a].jsImpl;return m.div[t.kind](n(e),t)}if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&typeof t=="number"){let n=_chunkTRE7NUKEcjs.kb[e.kind][_chunkTRE7NUKEcjs.a].jsImpl;return m.div[e.kind](e,n(t))}if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&_chunkTRE7NUKEcjs.r.call(void 0, t))return m.div[e.kind](e,t);throw new Error("Div called with invalid arguments.")}var Rt=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"div",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e,[_chunkTRE7NUKEcjs.Ua,_chunkTRE7NUKEcjs.Va,_chunkTRE7NUKEcjs.Pa]), () => (e));return{argTypes:t,returnType:_chunkTRE7NUKEcjs.N.call(void 0, t[0])?t[1]:t[0]}},normalImpl:qn,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`(${e} / ${t})`,ignoreImplicitCastWarning:!0}),na= exports.$ =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"mod",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e));return{argTypes:t,returnType:_chunkTRE7NUKEcjs.N.call(void 0, t[0])?t[1]:t[0]}},normalImpl(e,t){if(typeof e=="number"&&typeof t=="number")return e%t;if(typeof e=="number"&&_chunkTRE7NUKEcjs.r.call(void 0, t)){let n=_chunkTRE7NUKEcjs.kb[t.kind];return m.mod[t.kind](n(e),t)}if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&typeof t=="number"){let n=_chunkTRE7NUKEcjs.kb[e.kind];return m.mod[e.kind](e,n(t))}if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&_chunkTRE7NUKEcjs.r.call(void 0, t))return m.mod[e.kind](e,t);throw new Error("Mod called with invalid arguments, expected types: number or vector.")},codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`(${e} % ${t})`});function jn(e){return typeof e=="number"?-e:m.neg[e.kind](e)}var ra=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"neg",signature:e=>({argTypes:[e],returnType:e}),normalImpl:jn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`-(${e})`});function Zn(e){return typeof e=="number"?Math.abs(e):m.abs[e.kind](e)}var da=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"abs",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Zn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`abs(${e})`});function Hn(e){return typeof e=="number"?Math.acos(e):m.acos[e.kind](e)}var fa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"acos",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Hn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`acos(${e})`});function Qn(e){return typeof e=="number"?Math.acosh(e):m.acosh[e.kind](e)}var ga=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"acosh",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Qn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`acosh(${e})`});function Xn(e){return typeof e=="number"?Math.asin(e):m.asin[e.kind](e)}var ha=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"asin",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Xn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`asin(${e})`});function Yn(e){return typeof e=="number"?Math.asinh(e):m.asinh[e.kind](e)}var va=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"asinh",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Yn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`asinh(${e})`});function Jn(e){return typeof e=="number"?Math.atan(e):m.atan[e.kind](e)}var ba=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"atan",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Jn,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`atan(${e})`});function er(e){return typeof e=="number"?Math.atanh(e):m.atanh[e.kind](e)}var wa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"atanh",signature:e=>({argTypes:[e],returnType:e}),normalImpl:er,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`atanh(${e})`});function tr(e,t){return typeof e=="number"&&typeof t=="number"?Math.atan2(e,t):m.atan2[e.kind](e,t)}var Sa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"atan2",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e,[_chunkTRE7NUKEcjs.Ua,_chunkTRE7NUKEcjs.Va,_chunkTRE7NUKEcjs.Pa]), () => (e));return{argTypes:t,returnType:t[0]}},normalImpl:tr,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`atan2(${e}, ${t})`});function nr(e){return typeof e=="number"?Math.ceil(e):m.ceil[e.kind](e)}var Ma=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"ceil",signature:e=>({argTypes:[e],returnType:e}),normalImpl:nr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`ceil(${e})`});function rr(e,t,n){return typeof e=="number"?Math.min(Math.max(t,e),n):m.clamp[e.kind](e,t,n)}var Ia=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"clamp",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e));return{argTypes:t,returnType:t[0]}},normalImpl:rr,codegenImpl:(e,t,n)=>_chunkTRE7NUKEcjs.Ea`clamp(${e}, ${t}, ${n})`});function sr(e){return typeof e=="number"?Math.cos(e):m.cos[e.kind](e)}var Aa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"cos",signature:e=>({argTypes:[e],returnType:e}),normalImpl:sr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`cos(${e})`});function ar(e){return typeof e=="number"?Math.cosh(e):m.cosh[e.kind](e)}var $a=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"cosh",signature:e=>({argTypes:[e],returnType:e}),normalImpl:ar,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`cosh(${e})`});var za=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"countLeadingZeros",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for countLeadingZeros not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`countLeadingZeros(${e})`});var Va=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"countOneBits",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for countOneBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`countOneBits(${e})`});var Fa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"countTrailingZeros",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for countTrailingZeros not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`countTrailingZeros(${e})`}),Ca= exports.qa =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"cross",signature:(e,t)=>({argTypes:[e,t],returnType:e}),normalImpl:(e,t)=>m.cross[e.kind](e,t),codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`cross(${e}, ${t})`});function or(e){if(typeof e=="number")return e*180/Math.PI;throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for degrees on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var Pa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"degrees",signature:e=>({argTypes:[e],returnType:e}),normalImpl:or,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`degrees(${e})`}),ka= exports.sa =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"determinant",signature:e=>({argTypes:[e],returnType:_chunkTRE7NUKEcjs.Ua}),normalImpl:"CPU implementation for determinant not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`determinant(${e})`});function ur(e,t){return typeof e=="number"&&typeof t=="number"?Math.abs(e-t):fr(Re(e,t))}var Wa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"distance",signature:(e,t)=>({argTypes:[e,t],returnType:_chunkTRE7NUKEcjs.O.call(void 0, e)?_chunkTRE7NUKEcjs.Va:_chunkTRE7NUKEcjs.Ua}),normalImpl:ur,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`distance(${e}, ${t})`}),cr= exports.ua =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"dot",signature:(e,t)=>({argTypes:[e,t],returnType:e.primitive}),normalImpl:(e,t)=>m.dot[e.kind](e,t),codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`dot(${e}, ${t})`}),_a= exports.va =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"dot4U8Packed",signature:(e,t)=>({argTypes:[_chunkTRE7NUKEcjs.Ra,_chunkTRE7NUKEcjs.Ra],returnType:_chunkTRE7NUKEcjs.Ra}),normalImpl:"CPU implementation for dot4U8Packed not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`dot4U8Packed(${e}, ${t})`}),Ua= exports.wa =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"dot4I8Packed",signature:(e,t)=>({argTypes:[_chunkTRE7NUKEcjs.Ra,_chunkTRE7NUKEcjs.Ra],returnType:_chunkTRE7NUKEcjs.Ta}),normalImpl:"CPU implementation for dot4I8Packed not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`dot4I8Packed(${e}, ${t})`});function ir(e){return typeof e=="number"?Math.exp(e):m.exp[e.kind](e)}var Da=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"exp",signature:e=>({argTypes:[e],returnType:e}),normalImpl:ir,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`exp(${e})`});function lr(e){return typeof e=="number"?2**e:m.exp2[e.kind](e)}var Ba=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"exp2",signature:e=>({argTypes:[e],returnType:e}),normalImpl:lr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`exp2(${e})`});var Ra=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"extractBits",signature:(e,t,n)=>({argTypes:[e,_chunkTRE7NUKEcjs.Ra,_chunkTRE7NUKEcjs.Ra],returnType:e}),normalImpl:"CPU implementation for extractBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:(e,t,n)=>_chunkTRE7NUKEcjs.Ea`extractBits(${e}, ${t}, ${n})`}),Ga= exports.Aa =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"faceForward",signature:(e,t,n)=>({argTypes:[e,t,n],returnType:e}),normalImpl:"CPU implementation for faceForward not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:(e,t,n)=>_chunkTRE7NUKEcjs.Ea`faceForward(${e}, ${t}, ${n})`});var Ea=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"firstLeadingBit",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for firstLeadingBit not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`firstLeadingBit(${e})`});var La=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"firstTrailingBit",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for firstTrailingBit not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`firstTrailingBit(${e})`});function mr(e){return typeof e=="number"?Math.floor(e):m.floor[e.kind](e)}var Na=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"floor",signature:(...e)=>({argTypes:e,returnType:e[0]}),normalImpl:mr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`floor(${e})`});function pr(e,t,n){if(typeof e=="number")return e*t+n;throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for fma on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var Oa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"fma",signature:(e,t,n)=>({argTypes:[e,t,n],returnType:e}),normalImpl:pr,codegenImpl:(e,t,n)=>_chunkTRE7NUKEcjs.Ea`fma(${e}, ${t}, ${n})`});function yr(e){return typeof e=="number"?e-Math.floor(e):m.fract[e.kind](e)}var Ka=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"fract",signature:(...e)=>({argTypes:e,returnType:e[0]}),normalImpl:yr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`fract(${e})`}),Tr={f32:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Ua,exp:_chunkTRE7NUKEcjs.Ta}),f16:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Va,exp:_chunkTRE7NUKEcjs.Ta}),abstractFloat:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Pa,exp:_chunkTRE7NUKEcjs.Oa}),vec2f:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Xa,exp:_chunkTRE7NUKEcjs.Za}),vec3f:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.ab,exp:_chunkTRE7NUKEcjs.cb}),vec4f:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.fb,exp:_chunkTRE7NUKEcjs.hb}),vec2h:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Ya,exp:_chunkTRE7NUKEcjs.Za}),vec3h:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.bb,exp:_chunkTRE7NUKEcjs.cb}),vec4h:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.gb,exp:_chunkTRE7NUKEcjs.hb})},qa= exports.Ga =_chunkTRE7NUKEcjs.La.call(void 0, e=>{throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for frexp not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")},e=>{let t=Tr[e.dataType.type];if(!t)throw new Error(`Unsupported data type for frexp: ${e.dataType.type}. Supported types are f32, f16, abstractFloat, vec2f, vec3f, vec4f, vec2h, vec3h, vec4h.`);return _chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`frexp(${e})`,t)},"frexp");var ja=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"insertBits",signature:(e,t,n,r)=>({argTypes:[e,t,_chunkTRE7NUKEcjs.Ra,_chunkTRE7NUKEcjs.Ra],returnType:e}),normalImpl:"CPU implementation for insertBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:(e,t,n,r)=>_chunkTRE7NUKEcjs.Ea`insertBits(${e}, ${t}, ${n}, ${r})`});function xr(e){if(typeof e=="number")return 1/Math.sqrt(e);throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for inverseSqrt on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var Za=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"inverseSqrt",signature:e=>({argTypes:[e],returnType:e}),normalImpl:xr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`inverseSqrt(${e})`});var Ha=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"ldexp",signature:(e,t)=>{switch(e.type){case"abstractFloat":return{argTypes:[_chunkTRE7NUKEcjs.Pa,_chunkTRE7NUKEcjs.Oa],returnType:e};case"f32":case"f16":return{argTypes:[e,_chunkTRE7NUKEcjs.Ta],returnType:e};case"vec2f":case"vec2h":return{argTypes:[e,_chunkTRE7NUKEcjs.Za],returnType:e};case"vec3f":case"vec3h":return{argTypes:[e,_chunkTRE7NUKEcjs.cb],returnType:e};case"vec4f":case"vec4h":return{argTypes:[e,_chunkTRE7NUKEcjs.hb],returnType:e};default:throw new Error(`Unsupported data type for ldexp: ${e.type}. Supported types are abstractFloat, f32, f16, vec2f, vec2h, vec3f, vec3h, vec4f, vec4h.`)}},normalImpl:"CPU implementation for ldexp not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`ldexp(${e}, ${t})`});function dr(e){return typeof e=="number"?Math.abs(e):m.length[e.kind](e)}var fr=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"length",signature:e=>({argTypes:[e],returnType:_chunkTRE7NUKEcjs.O.call(void 0, e)?_chunkTRE7NUKEcjs.Va:_chunkTRE7NUKEcjs.Ua}),normalImpl:dr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`length(${e})`});function gr(e){return typeof e=="number"?Math.log(e):m.log[e.kind](e)}var Qa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"log",signature:e=>({argTypes:[e],returnType:e}),normalImpl:gr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`log(${e})`});function hr(e){return typeof e=="number"?Math.log2(e):m.log2[e.kind](e)}var Xa=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"log2",signature:e=>({argTypes:[e],returnType:e}),normalImpl:hr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`log2(${e})`});function vr(e,t){return typeof e=="number"?Math.max(e,t):m.max[e.kind](e,t)}var Ya=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"max",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e));return{argTypes:t,returnType:t[0]}},normalImpl:vr,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`max(${e}, ${t})`});function br(e,t){return typeof e=="number"?Math.min(e,t):m.min[e.kind](e,t)}var Ja=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"min",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e), () => (e));return{argTypes:t,returnType:t[0]}},normalImpl:br,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`min(${e}, ${t})`});function wr(e,t,n){if(typeof e=="number"){if(typeof n!="number"||typeof t!="number")throw new Error("When e1 and e2 are numbers, the blend factor must be a number.");return e*(1-n)+t*n}if(typeof e=="number"||typeof t=="number")throw new Error("e1 and e2 need to both be vectors of the same kind.");return m.mix[e.kind](e,t,n)}var eo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"mix",signature:(e,t,n)=>({argTypes:[e,t,n],returnType:e}),normalImpl:wr,codegenImpl:(e,t,n)=>_chunkTRE7NUKEcjs.Ea`mix(${e}, ${t}, ${n})`}),Sr={f32:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Ua,whole:_chunkTRE7NUKEcjs.Ua}),f16:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Va,whole:_chunkTRE7NUKEcjs.Va}),abstractFloat:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Pa,whole:_chunkTRE7NUKEcjs.Pa}),vec2f:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Xa,whole:_chunkTRE7NUKEcjs.Xa}),vec3f:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.ab,whole:_chunkTRE7NUKEcjs.ab}),vec4f:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.fb,whole:_chunkTRE7NUKEcjs.fb}),vec2h:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.Ya,whole:_chunkTRE7NUKEcjs.Ya}),vec3h:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.bb,whole:_chunkTRE7NUKEcjs.bb}),vec4h:_chunkTRE7NUKEcjs.sc.call(void 0, {fract:_chunkTRE7NUKEcjs.gb,whole:_chunkTRE7NUKEcjs.gb})};var to=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"modf",signature:e=>{let t=Sr[e.type];if(!t)throw new Error(`Unsupported data type for modf: ${e.type}. Supported types are f32, f16, abstractFloat, vec2f, vec3f, vec4f, vec2h, vec3h, vec4h.`);return{argTypes:[e],returnType:t}},normalImpl:"CPU implementation for modf not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`modf(${e})`}),no= exports.Ra =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"normalize",signature:e=>({argTypes:[e],returnType:e}),normalImpl:e=>m.normalize[e.kind](e),codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`normalize(${e})`});function Mr(e,t){if(typeof e=="number"&&typeof t=="number")return e**t;if(_chunkTRE7NUKEcjs.r.call(void 0, e)&&_chunkTRE7NUKEcjs.r.call(void 0, t))return m.pow[e.kind](e,t);throw new Error("Invalid arguments to pow()")}var ln=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"pow",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e,[_chunkTRE7NUKEcjs.Ua,_chunkTRE7NUKEcjs.Va,_chunkTRE7NUKEcjs.Pa]), () => (e));return{argTypes:t,returnType:_chunkTRE7NUKEcjs.N.call(void 0, t[0])?t[1]:t[0]}},normalImpl:Mr,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`pow(${e}, ${t})`});var ro=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"quantizeToF16",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for quantizeToF16 not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`quantizeToF16(${e})`});function Ir(e){if(typeof e=="number")return e*Math.PI/180;throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for radians on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var so=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"radians",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e,[_chunkTRE7NUKEcjs.Ua,_chunkTRE7NUKEcjs.Va,_chunkTRE7NUKEcjs.Pa]), () => (e));return{argTypes:t,returnType:t[0]}},normalImpl:Ir,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`radians(${e})`}),ao= exports.Va =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"reflect",signature:(e,t)=>({argTypes:[e,t],returnType:e}),normalImpl:(e,t)=>Re(e,st(2*cr(t,e),t)),codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`reflect(${e}, ${t})`}),oo= exports.Wa =_chunkTRE7NUKEcjs.La.call(void 0, (e,t,n)=>{throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for refract not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")},(e,t,n)=>_chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`refract(${e}, ${t}, ${n})`,e.dataType),"refract",(e,t,n)=>[e.dataType,t.dataType,_chunkTRE7NUKEcjs.O.call(void 0, e)?_chunkTRE7NUKEcjs.Va:_chunkTRE7NUKEcjs.Ua]);var uo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"reverseBits",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for reverseBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`reverseBits(${e})`});function Ar(e){if(typeof e=="number")return Math.round(e);throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for round on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var co=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"round",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Ar,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`round(${e})`});function $r(e){if(typeof e=="number")return Math.max(0,Math.min(1,e));throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for saturate on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var io=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"saturate",signature:e=>({argTypes:[e],returnType:e}),normalImpl:$r,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`saturate(${e})`});function zr(e){return typeof e=="number"?Math.sign(e):m.sign[e.kind](e)}var lo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"sign",signature:e=>({argTypes:[e],returnType:e}),normalImpl:zr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`sign(${e})`});function Vr(e){return typeof e=="number"?Math.sin(e):m.sin[e.kind](e)}var mo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"sin",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Vr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`sin(${e})`});function Fr(e){if(typeof e=="number")return Math.sinh(e);throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for sinh on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var po=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"sinh",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Fr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`sinh(${e})`});function Cr(e,t,n){return typeof n=="number"?me(e,t,n):m.smoothstep[n.kind](e,t,n)}var yo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"smoothstep",signature:(e,t,n)=>({argTypes:[e,t,n],returnType:n}),normalImpl:Cr,codegenImpl:(e,t,n)=>_chunkTRE7NUKEcjs.Ea`smoothstep(${e}, ${t}, ${n})`});function Pr(e){return typeof e=="number"?Math.sqrt(e):m.sqrt[e.kind](e)}var To=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"sqrt",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Pr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`sqrt(${e})`});function kr(e,t){if(typeof e=="number")return e<=t?1:0;throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for step on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var xo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"step",signature:(...e)=>{let t=_nullishCoalesce(_chunkTRE7NUKEcjs.Ha.call(void 0, e,[_chunkTRE7NUKEcjs.Ua,_chunkTRE7NUKEcjs.Va,_chunkTRE7NUKEcjs.Pa]), () => (e));return{argTypes:t,returnType:t[0]}},normalImpl:kr,codegenImpl:(e,t)=>_chunkTRE7NUKEcjs.Ea`step(${e}, ${t})`});function Wr(e){if(typeof e=="number")return Math.tan(e);throw new (0, _chunkTRE7NUKEcjs.Ma)("CPU implementation for tan on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues")}var fo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"tan",signature:e=>({argTypes:[e],returnType:e}),normalImpl:Wr,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`tan(${e})`});function _r(e){return typeof e=="number"?Math.tanh(e):m.tanh[e.kind](e)}var go=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"tanh",signature:e=>({argTypes:[e],returnType:e}),normalImpl:_r,codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`tanh(${e})`}),ho= exports.gb =_chunkTRE7NUKEcjs.Na.call(void 0, {name:"transpose",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for transpose not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`transpose(${e})`});var vo=_chunkTRE7NUKEcjs.Na.call(void 0, {name:"trunc",signature:e=>({argTypes:[e],returnType:e}),normalImpl:"CPU implementation for trunc not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues",codegenImpl:e=>_chunkTRE7NUKEcjs.Ea`trunc(${e})`});var _tinyest = require('tinyest'); var Ur = _interopRequireWildcard(_tinyest);var{NodeTypeCatalog:g}=Ur,Dr=["==","!=","<","<=",">",">=","<<",">>","+","-","*","/","%","|","^","&","&&","||"],Br=["&&","||","==","!=","<","<=",">",">="],Rr=["vec2f","vec3f","vec4f","vec2h","vec3h","vec4h","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","mat2x2f","mat3x3f","mat4x4f"],mn= exports.ib ={add:Bt,sub:Re,mul:st,div:Rt};function pn(e,t,n){return n?Br.includes(t)?_chunkTRE7NUKEcjs.Qa:t==="="?n:e:t==="!"||t==="~"?_chunkTRE7NUKEcjs.Qa:e}var Gr={"+":Bt[_chunkTRE7NUKEcjs.a].gpuImpl,"-":Re[_chunkTRE7NUKEcjs.a].gpuImpl,"*":st[_chunkTRE7NUKEcjs.a].gpuImpl,"/":Rt[_chunkTRE7NUKEcjs.a].gpuImpl,"**":ln[_chunkTRE7NUKEcjs.a].gpuImpl},Gt=class{#e=void 0;initGenerator(t){this.#e=t}get ctx(){if(!this.#e)throw new Error("WGSL Generator has not yet been initialized. Please call initialize(ctx) before using the generator.");return this.#e}block([t,n]){this.ctx.pushBlockScope();try{this.ctx.indent();let r=n.map(a=>this.statement(a)).join(`
2
+ `);return this.ctx.dedent(),`{
3
+ ${r}
4
+ ${this.ctx.pre}}`}finally{this.ctx.popBlockScope()}}blockVariable(t,n){let r=_chunkTRE7NUKEcjs.aa.call(void 0, this.ctx.makeNameValid(t),n);return this.ctx.defineVariable(t,r),r}identifier(t){if(!t)throw new Error("Cannot resolve an empty identifier");let n=this.ctx.getById(t);if(!n)throw new Error(`Identifier ${t} not found`);return n}typedExpression(t,n){let r=this.ctx.expectedType;this.ctx.expectedType=n;try{let a=this.expression(t);return _chunkTRE7NUKEcjs.Ja.call(void 0, a,n)}finally{this.ctx.expectedType=r}}expression(t){if(typeof t=="string")return this.identifier(t);if(typeof t=="boolean")return _chunkTRE7NUKEcjs.aa.call(void 0, t,_chunkTRE7NUKEcjs.Qa);if(t[0]===g.logicalExpr||t[0]===g.binaryExpr||t[0]===g.assignmentExpr){let[n,r,a,s]=t,i=this.expression(r),p=this.expression(s),d=Gr[a];if(d)return d(i,p);let M=t[0]===g.assignmentExpr?i.dataType.type==="ptr"?[i.dataType.inner]:[i.dataType]:void 0,[z,U]=_nullishCoalesce(_chunkTRE7NUKEcjs.Ia.call(void 0, [i,p],M), () => ([i,p])),at=this.ctx.resolve(z.value,z.dataType).value,Et=this.ctx.resolve(U.value,U.dataType).value,yn=pn(z.dataType,a,U.dataType);return _chunkTRE7NUKEcjs.aa.call(void 0, Dr.includes(a)?`(${at} ${a} ${Et})`:`${at} ${a} ${Et}`,yn)}if(t[0]===g.postUpdate){let[n,r,a]=t,s=this.expression(a),i=this.ctx.resolve(s.value,s.dataType).value;return _chunkTRE7NUKEcjs.aa.call(void 0, `${i}${r}`,s.dataType)}if(t[0]===g.unaryExpr){let[n,r,a]=t,s=this.expression(a),i=this.ctx.resolve(s.value,s.dataType).value,p=pn(s.dataType,r);return _chunkTRE7NUKEcjs.aa.call(void 0, `${r}${i}`,p)}if(t[0]===g.memberAccess){let[n,r,a]=t,s=this.expression(r);if(s.value===console)return _chunkTRE7NUKEcjs.aa.call(void 0, new (0, _chunkTRE7NUKEcjs.Z)(a),_chunkTRE7NUKEcjs.W);if(Rr.includes(s.dataType.type)&&a in mn)return{value:new (0, _chunkTRE7NUKEcjs.X)(a,s,mn[a][_chunkTRE7NUKEcjs.a].gpuImpl),dataType:_chunkTRE7NUKEcjs.W};if(s.dataType.type==="unknown"){let i=s.value[a];return Tt(i)}return _chunkTRE7NUKEcjs.E.call(void 0, s.dataType)?_chunkTRE7NUKEcjs.aa.call(void 0, `(*${this.ctx.resolve(s.value).value}).${a}`,Xe(s.dataType.inner,a)):_chunkTRE7NUKEcjs.C.call(void 0, s.dataType)&&a==="length"?s.dataType.elementCount===0?_chunkTRE7NUKEcjs.aa.call(void 0, `arrayLength(&${this.ctx.resolve(s.value).value})`,_chunkTRE7NUKEcjs.Ra):_chunkTRE7NUKEcjs.aa.call(void 0, String(s.dataType.elementCount),_chunkTRE7NUKEcjs.Oa):_chunkTRE7NUKEcjs.z.call(void 0, s.dataType)&&a==="columns"?_chunkTRE7NUKEcjs.aa.call(void 0, new (0, _chunkTRE7NUKEcjs.Y)(s),_chunkTRE7NUKEcjs.W):_chunkTRE7NUKEcjs.v.call(void 0, s.dataType)&&_chunkTRE7NUKEcjs.r.call(void 0, s.value)?Tt(s.value[a]):_chunkTRE7NUKEcjs.aa.call(void 0, `${this.ctx.resolve(s.value).value}.${a}`,Xe(s.dataType,a))}if(t[0]===g.indexAccess){let[n,r,a]=t,s=this.expression(r),i=this.expression(a),p=this.ctx.resolve(i.value,i.dataType).value;if(s.value instanceof _chunkTRE7NUKEcjs.Y)return _chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`${s.value.matrix}[${p}]`,mt(s.value.matrix.dataType));let d=this.ctx.resolve(s.value,s.dataType).value;if(s.dataType.type==="unknown"){if(Array.isArray(a)&&a[0]===g.numericLiteral)return Tt(s.value[a[1]]);throw new Error(`Unable to index a value of unknown type with index ${p}. If the value is an array, to address this, consider one of the following approaches: (1) declare the array using 'tgpu.const', (2) store the array in a buffer, or (3) define the array within the GPU function scope.`)}if(_chunkTRE7NUKEcjs.z.call(void 0, s.dataType))throw new Error("The only way of accessing matrix elements in TGSL is through the 'columns' property.");return _chunkTRE7NUKEcjs.E.call(void 0, s.dataType)?_chunkTRE7NUKEcjs.aa.call(void 0, `(*${d})[${p}]`,mt(s.dataType.inner)):_chunkTRE7NUKEcjs.aa.call(void 0, `${d}[${p}]`,_chunkTRE7NUKEcjs.V.call(void 0, s.dataType)?mt(s.dataType):_chunkTRE7NUKEcjs.W)}if(t[0]===g.numericLiteral){let n=typeof t[1]=="string"?pt(Lr(t[1])):pt(t[1]);if(!n)throw new Error(`Invalid numeric literal ${t[1]}`);return n}if(t[0]===g.call){let[n,r,a]=t,s=this.expression(r);if(_chunkTRE7NUKEcjs.D.call(void 0, s.value)||_chunkTRE7NUKEcjs.C.call(void 0, s.value)){if(a.length>1)throw new (0, _chunkTRE7NUKEcjs.la)("Array and struct schemas should always be called with at most 1 argument");if(!a[0])return _chunkTRE7NUKEcjs.aa.call(void 0, `${this.ctx.resolve(s.value).value}()`,s.value);let p=this.typedExpression(a[0],s.value);return _chunkTRE7NUKEcjs.aa.call(void 0, this.ctx.resolve(p.value,s.value).value,s.value)}if(s.value===nn)throw new Error("Constants cannot be defined within TypeGPU function scope. To address this, move the constant definition outside the function scope.");if(s.value instanceof _chunkTRE7NUKEcjs.X){if(!a[0])throw new (0, _chunkTRE7NUKEcjs.la)(`An infix operator '${s.value.name}' was called without any arguments`);let p=this.expression(a[0]);return s.value.operator(s.value.lhs,p)}if(!_chunkTRE7NUKEcjs.h.call(void 0, s.value)){let p=a.map(M=>this.expression(M)),d=this.ctx.shelllessRepo.get(s.value,p);if(d)return this.ctx.withResetIndentLevel(()=>{let M=this.ctx.resolve(d);return _chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`${M.value}(${p})`,M.dataType)});throw new Error(`Function '${_nullishCoalesce(_chunkTRE7NUKEcjs.j.call(void 0, s.value), () => (String(s.value)))}' is not marked with the 'use gpu' directive and cannot be used in a shader`)}let i=_nullishCoalesce(_optionalChain([s, 'access', _3 => _3.value, 'access', _4 => _4[_chunkTRE7NUKEcjs.a], 'optionalAccess', _5 => _5.argConversionHint]), () => ("keep"));try{let p;if(Array.isArray(i))p=a.map((M,z)=>{let U=i[z];if(!U)throw new (0, _chunkTRE7NUKEcjs.la)(`Function '${_chunkTRE7NUKEcjs.j.call(void 0, s.value)}' was called with too many arguments`);return this.typedExpression(M,U)});else{let M=a.map(z=>this.expression(z));i==="keep"?p=M:i==="unify"?p=_nullishCoalesce(_chunkTRE7NUKEcjs.Ia.call(void 0, M), () => (M)):p=i(...M).map((z,U)=>[z,M[U]]).map(([z,U])=>_chunkTRE7NUKEcjs.Ja.call(void 0, U,z))}if(s.value instanceof _chunkTRE7NUKEcjs.Z)return this.ctx.generateLog(s.value.op,p);let d=s.value(...p);if(!_chunkTRE7NUKEcjs._.call(void 0, d))throw new Error("Functions running in codegen mode must return snippets");return d}catch(p){throw new (0, _chunkTRE7NUKEcjs.ca)(p,[{toString:()=>_chunkTRE7NUKEcjs.j.call(void 0, s.value)}])}}if(t[0]===g.objectExpr){let n=t[1],r=this.ctx.expectedType;if(!r||!_chunkTRE7NUKEcjs.D.call(void 0, r))throw new (0, _chunkTRE7NUKEcjs.la)(`No target type could be inferred for object with keys [${Object.keys(n).join(", ")}], please wrap the object in the corresponding schema.`);let a=Object.fromEntries(Object.entries(r.propTypes).map(([i,p])=>{let d=n[i];if(d===void 0)throw new (0, _chunkTRE7NUKEcjs.la)(`Missing property ${i} in object literal for struct ${r}`);let M=this.typedExpression(d,p);return[i,M]})),s=_chunkTRE7NUKEcjs.Ka.call(void 0, r,a);return _chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`${this.ctx.resolve(r).value}(${s})`,r)}if(t[0]===g.arrayExpr){let[n,r]=t,a=this.ctx.expectedType,s,i;if(_chunkTRE7NUKEcjs.C.call(void 0, a)){if(s=a.elementType,i=r.map(d=>this.typedExpression(d,s)),i.length!==a.elementCount)throw new (0, _chunkTRE7NUKEcjs.la)(`Cannot create value of type '${a}' from an array of length: ${i.length}`)}else{let d=r.map(z=>this.expression(z));if(d.length===0)throw new (0, _chunkTRE7NUKEcjs.la)("Cannot infer the type of an empty array literal.");let M=_chunkTRE7NUKEcjs.Ia.call(void 0, d);if(!M)throw new (0, _chunkTRE7NUKEcjs.la)("The given values cannot be automatically converted to a common type. Consider wrapping the array in an appropriate schema");i=M,s=yt(_optionalChain([i, 'access', _6 => _6[0], 'optionalAccess', _7 => _7.dataType]))}let p=`array<${this.ctx.resolve(s).value}, ${i.length}>`;return _chunkTRE7NUKEcjs.aa.call(void 0, _chunkTRE7NUKEcjs.Ea`${p}(${i})`,_chunkTRE7NUKEcjs.tc[_chunkTRE7NUKEcjs.a].jsImpl(s,i.length))}if(t[0]===g.stringLiteral)return _chunkTRE7NUKEcjs.aa.call(void 0, t[1],_chunkTRE7NUKEcjs.W);if(t[0]===g.preUpdate)throw new Error("Cannot use pre-updates in TGSL.");Er(t)}functionDefinition(t){return this.block(t)}statement(t){if(typeof t=="string")return`${this.ctx.pre}${this.ctx.resolve(this.identifier(t).value).value};`;if(typeof t=="boolean")return`${this.ctx.pre}${t?"true":"false"};`;if(t[0]===g.return){let n=t[1];if(n!==void 0){let r=this.ctx.topFunctionReturnType,a=r?this.typedExpression(n,r):this.expression(n);return _chunkTRE7NUKEcjs.ba.call(void 0, a.dataType.type!=="unknown","Return type should be known"),this.ctx.reportReturnType(a.dataType),_chunkTRE7NUKEcjs.Ea`${this.ctx.pre}return ${a};`}return`${this.ctx.pre}return;`}if(t[0]===g.if){let[n,r,a,s]=t,i=this.typedExpression(r,_chunkTRE7NUKEcjs.Qa),p=i.value===!1?void 0:this.block(vt(a)),d=i.value===!0||!s?void 0:this.block(vt(s));return i.value===!0?`${this.ctx.pre}${p}`:i.value===!1?d?`${this.ctx.pre}${d}`:"":d?_chunkTRE7NUKEcjs.Ea`\
5
+ ${this.ctx.pre}if (${i}) ${p}
6
+ ${this.ctx.pre}else ${d}`:_chunkTRE7NUKEcjs.Ea`${this.ctx.pre}if (${i}) ${p}`}if(t[0]===g.let||t[0]===g.const){let[n,r,a]=t,s=a!==void 0?this.expression(a):void 0;if(!s)throw new Error(`Cannot create variable '${r}' without an initial value.`);if(_chunkTRE7NUKEcjs.Q.call(void 0, s.dataType))throw new Error(`Cannot create variable '${r}' with loose data type.`);let i=this.blockVariable(r,yt(s.dataType));return _chunkTRE7NUKEcjs.Ea`${this.ctx.pre}var ${i.value} = ${s};`}if(t[0]===g.block)return this.block(t);if(t[0]===g.for){let[n,r,a,s,i]=t,[p,d,M]=this.ctx.withResetIndentLevel(()=>[r?this.statement(r):void 0,a?this.typedExpression(a,_chunkTRE7NUKEcjs.Qa):void 0,s?this.statement(s):void 0]),z=p?p.slice(0,-1):"",U=M?M.slice(0,-1):"",at=this.block(vt(i));return _chunkTRE7NUKEcjs.Ea`${this.ctx.pre}for (${z}; ${d}; ${U}) ${at}`}if(t[0]===g.while){let[n,r,a]=t,s=this.typedExpression(r,_chunkTRE7NUKEcjs.Qa),i=this.ctx.resolve(s.value).value,p=this.block(vt(a));return`${this.ctx.pre}while (${i}) ${p}`}return t[0]===g.continue?`${this.ctx.pre}continue;`:t[0]===g.break?`${this.ctx.pre}break;`:`${this.ctx.pre}${this.ctx.resolve(this.expression(t).value).value};`}};function Er(e){throw new Error(`'${_chunkTRE7NUKEcjs.lb.call(void 0, e)}' was not handled by the WGSL generator.`)}function Lr(e){return/^0x[0-9a-f]+$/i.test(e)?Number.parseInt(e):/^0b[01]+$/i.test(e)?Number.parseInt(e.slice(2),2):Number.parseFloat(e)}function vt(e){return typeof e!="object"||e[0]!==g.block?[g.block,[e]]:e}var Nr=new Gt,Bo= exports.jb =Nr;exports.a = Qe; exports.b = Tn; exports.c = xn; exports.d = dn; exports.e = gn; exports.f = hn; exports.g = vn; exports.h = bn; exports.i = wn; exports.j = ie; exports.k = le; exports.l = A; exports.m = Hr; exports.n = pt; exports.o = yt; exports.p = os; exports.q = Tt; exports.r = _t; exports.s = ys; exports.t = nn; exports.u = ws; exports.v = Ss; exports.w = Ms; exports.x = Is; exports.y = Vs; exports.z = dt; exports.A = In; exports.B = An; exports.C = $n; exports.D = zn; exports.E = Vn; exports.F = Fn; exports.G = Cn; exports.H = Pn; exports.I = kn; exports.J = Wn; exports.K = _n; exports.L = Fs; exports.M = Cs; exports.N = Ps; exports.O = ks; exports.P = Ws; exports.Q = _s; exports.R = Us; exports.S = Ds; exports.T = Gs; exports.U = Y; exports.V = J; exports.W = m; exports.X = Bt; exports.Y = Re; exports.Z = st; exports._ = Rt; exports.$ = na; exports.aa = ra; exports.ba = da; exports.ca = fa; exports.da = ga; exports.ea = ha; exports.fa = va; exports.ga = ba; exports.ha = wa; exports.ia = Sa; exports.ja = Ma; exports.ka = Ia; exports.la = Aa; exports.ma = $a; exports.na = za; exports.oa = Va; exports.pa = Fa; exports.qa = Ca; exports.ra = Pa; exports.sa = ka; exports.ta = Wa; exports.ua = cr; exports.va = _a; exports.wa = Ua; exports.xa = Da; exports.ya = Ba; exports.za = Ra; exports.Aa = Ga; exports.Ba = Ea; exports.Ca = La; exports.Da = Na; exports.Ea = Oa; exports.Fa = Ka; exports.Ga = qa; exports.Ha = ja; exports.Ia = Za; exports.Ja = Ha; exports.Ka = fr; exports.La = Qa; exports.Ma = Xa; exports.Na = Ya; exports.Oa = Ja; exports.Pa = eo; exports.Qa = to; exports.Ra = no; exports.Sa = ln; exports.Ta = ro; exports.Ua = so; exports.Va = ao; exports.Wa = oo; exports.Xa = uo; exports.Ya = co; exports.Za = io; exports._a = lo; exports.$a = mo; exports.ab = po; exports.bb = yo; exports.cb = To; exports.db = xo; exports.eb = fo; exports.fb = go; exports.gb = ho; exports.hb = vo; exports.ib = mn; exports.jb = Bo;
7
+ //# sourceMappingURL=chunk-ZYGTVBDH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/iwo/Projects/wigsill/packages/typegpu/dist/chunk-ZYGTVBDH.cjs","../src/data/matrix.ts","../src/tgsl/wgslGenerator.ts"],"names":["MatBase","createMatSchema","options","construct","createDualImpl","args","elements","arg","i","snip","stitch"],"mappings":"AAAA,kmCAA4kB,ICmCtjBA,EAAAA,CAAf,KAA2D,CAOlE,CAAA,CAcA,SAASC,EAAAA,CAKPC,CAAAA,CAC6E,CAC7E,IAAMC,CAAAA,CAAYC,kCAAAA,CAEhB,GAAIC,CAAAA,CAAAA,EAA6C,CAC/C,IAAMC,CAAAA,CAAqB,CAAC,CAAA,CAE5B,GAAA,CAAA,IAAWC,EAAAA,GAAOF,CAAAA,CAChB,EAAA,CAAI,OAAOE,CAAAA,EAAQ,QAAA,CACjBD,CAAAA,CAAS,IAAA,CAAKC,CAAG,CAAA,CAAA,KAEjB,GAAA,CAAA,IAAS,CAAA,CAAI,CAAA,CAAG,CAAA,CAAIA,CAAAA,CAAI,MAAA,CAAQ,EAAE,CAAA,CAChCD,CAAAA,CAAS,IAAA,CAAKC,CAAAA,CAAI,CAAC,CAAW,CAAA,CAKpC,EAAA,CACED,CAAAA,CAAS,MAAA,GAAW,CAAA,EACpBA,CAAAA,CAAS,MAAA,GAAWJ,CAAAA,CAAQ,OAAA,CAAUA,CAAAA,CAAQ,IAAA,CAE9C,MAAM,IAAI,KAAA,CACR,CAAA,CAAA,EAAIA,CAAAA,CAAQ,IAAI,CAAA,sDAAA,CAClB,CAAA,CAGF,GAAA,CAAA,IAASM,CAAAA,CAAIF,CAAAA,CAAS,MAAA,CAAQE,CAAAA,CAAIN,CAAAA,CAAQ,OAAA,CAAUA,CAAAA,CAAQ,IAAA,CAAM,EAAEM,CAAAA,CAClEF,CAAAA,CAAS,IAAA,CAAK,CAAC,CAAA,CAGjB,OAAO,IAAIJ,CAAAA,CAAQ,OAAA,CAAQ,GAAGI,CAAQ,CACxC,CAAA,CAEA,CAAA,GAAID,CAAAA,CAAAA,EACFI,kCAAAA,oBAAKC,CAAAA,EAAAA;AC4DE;AACP;AAwFOD;AAqdgC;AAiE7B","file":"/Users/iwo/Projects/wigsill/packages/typegpu/dist/chunk-ZYGTVBDH.cjs","sourcesContent":[null,"import { createDualImpl } from '../core/function/dualImpl.ts';\nimport { stitch } from '../core/resolve/stitch.ts';\nimport { $repr } from '../shared/symbols.ts';\nimport { $internal, $resolve } from '../shared/symbols.ts';\nimport type { SelfResolvable } from '../types.ts';\nimport type { AnyData } from './dataTypes.ts';\nimport { type ResolvedSnippet, snip } from './snippet.ts';\nimport { vec2f, vec3f, vec4f } from './vector.ts';\nimport type {\n m2x2f,\n m3x3f,\n m4x4f,\n mat2x2,\n Mat2x2f,\n mat3x3,\n Mat3x3f,\n mat4x4,\n Mat4x4f,\n NumberArrayView,\n v2f,\n v3f,\n v4f,\n VecKind,\n} from './wgslTypes.ts';\n\n// --------------\n// Implementation\n// --------------\n\ntype vBase = {\n kind: VecKind;\n length: number;\n [n: number]: number;\n};\n\nexport abstract class MatBase<TColumn> implements NumberArrayView {\n abstract readonly [$internal]: true;\n abstract readonly columns: readonly TColumn[];\n\n abstract readonly length: number;\n abstract [Symbol.iterator](): Iterator<number>;\n [n: number]: number;\n}\n\ninterface MatSchemaOptions<TType extends string, ColumnType> {\n type: TType;\n rows: 2 | 3 | 4;\n columns: 2 | 3 | 4;\n MatImpl: new (...args: number[]) => MatBase<ColumnType>;\n}\n\ntype MatConstructor<\n ValueType extends MatBase<ColumnType>,\n ColumnType extends vBase,\n> = (...args: (number | ColumnType)[]) => ValueType;\n\nfunction createMatSchema<\n TType extends string,\n ValueType extends MatBase<ColumnType>,\n ColumnType extends vBase,\n>(\n options: MatSchemaOptions<TType, ColumnType>,\n): { type: TType; [$repr]: ValueType } & MatConstructor<ValueType, ColumnType> {\n const construct = createDualImpl(\n // CPU implementation\n (...args: (number | ColumnType)[]): ValueType => {\n const elements: number[] = [];\n\n for (const arg of args) {\n if (typeof arg === 'number') {\n elements.push(arg);\n } else {\n for (let i = 0; i < arg.length; ++i) {\n elements.push(arg[i] as number);\n }\n }\n }\n\n if (\n elements.length !== 0 &&\n elements.length !== options.columns * options.rows\n ) {\n throw new Error(\n `'${options.type}' constructor called with invalid number of arguments.`,\n );\n }\n\n for (let i = elements.length; i < options.columns * options.rows; ++i) {\n elements.push(0);\n }\n\n return new options.MatImpl(...elements) as ValueType;\n },\n // CODEGEN implementation\n (...args) =>\n snip(stitch`${options.type}(${args})`, schema as unknown as AnyData),\n options.type,\n );\n\n const schema = Object.assign(construct, {\n type: options.type,\n identity: identityFunctions[options.columns],\n translation: options.columns === 4 ? translation4 : undefined,\n scaling: options.columns === 4 ? scaling4 : undefined,\n rotationX: options.columns === 4 ? rotationX4 : undefined,\n rotationY: options.columns === 4 ? rotationY4 : undefined,\n rotationZ: options.columns === 4 ? rotationZ4 : undefined,\n }) as unknown as {\n type: TType;\n [$repr]: ValueType;\n } & MatConstructor<ValueType, ColumnType>;\n\n return schema;\n}\n\nabstract class mat2x2Impl<TColumn extends v2f> extends MatBase<TColumn>\n implements mat2x2<TColumn>, SelfResolvable {\n public readonly [$internal] = true;\n public readonly columns: readonly [TColumn, TColumn];\n public readonly length = 4;\n public abstract readonly kind: string;\n [n: number]: number;\n\n constructor(...elements: number[]) {\n super();\n this.columns = [\n this.makeColumn(elements[0] as number, elements[1] as number),\n this.makeColumn(elements[2] as number, elements[3] as number),\n ];\n }\n\n abstract makeColumn(e0: number, e1: number): TColumn;\n\n get 0() {\n return this.columns[0].x;\n }\n\n get 1() {\n return this.columns[0].y;\n }\n\n get 2() {\n return this.columns[1].x;\n }\n\n get 3() {\n return this.columns[1].y;\n }\n\n set 0(value: number) {\n this.columns[0].x = value;\n }\n\n set 1(value: number) {\n this.columns[0].y = value;\n }\n\n set 2(value: number) {\n this.columns[1].x = value;\n }\n\n set 3(value: number) {\n this.columns[1].y = value;\n }\n\n *[Symbol.iterator]() {\n yield this[0];\n yield this[1];\n yield this[2];\n yield this[3];\n }\n\n [$resolve](): ResolvedSnippet {\n return snip(\n `${this.kind}(${\n Array.from({ length: this.length })\n .map((_, i) => this[i])\n .join(', ')\n })`,\n mat2x2f,\n );\n }\n\n toString() {\n return this[$resolve]().value;\n }\n}\n\nclass mat2x2fImpl extends mat2x2Impl<v2f> {\n public readonly kind = 'mat2x2f';\n\n makeColumn(e0: number, e1: number): v2f {\n return vec2f(e0, e1);\n }\n}\n\nabstract class mat3x3Impl<TColumn extends v3f> extends MatBase<TColumn>\n implements mat3x3<TColumn>, SelfResolvable {\n public readonly [$internal] = true;\n public readonly columns: readonly [TColumn, TColumn, TColumn];\n public readonly length = 12;\n public abstract readonly kind: string;\n [n: number]: number;\n\n constructor(...elements: number[]) {\n super();\n this.columns = [\n this.makeColumn(\n elements[0] as number,\n elements[1] as number,\n elements[2] as number,\n ),\n this.makeColumn(\n elements[3] as number,\n elements[4] as number,\n elements[5] as number,\n ),\n this.makeColumn(\n elements[6] as number,\n elements[7] as number,\n elements[8] as number,\n ),\n ];\n }\n\n abstract makeColumn(x: number, y: number, z: number): TColumn;\n\n get 0() {\n return this.columns[0].x;\n }\n\n get 1() {\n return this.columns[0].y;\n }\n\n get 2() {\n return this.columns[0].z;\n }\n\n get 3() {\n return 0;\n }\n\n get 4() {\n return this.columns[1].x;\n }\n\n get 5() {\n return this.columns[1].y;\n }\n\n get 6() {\n return this.columns[1].z;\n }\n\n get 7() {\n return 0;\n }\n\n get 8() {\n return this.columns[2].x;\n }\n\n get 9() {\n return this.columns[2].y;\n }\n\n get 10() {\n return this.columns[2].z;\n }\n\n get 11() {\n return 0;\n }\n\n set 0(value: number) {\n this.columns[0].x = value;\n }\n\n set 1(value: number) {\n this.columns[0].y = value;\n }\n\n set 2(value: number) {\n this.columns[0].z = value;\n }\n\n set 3(_: number) {}\n\n set 4(value: number) {\n this.columns[1].x = value;\n }\n\n set 5(value: number) {\n this.columns[1].y = value;\n }\n\n set 6(value: number) {\n this.columns[1].z = value;\n }\n\n set 7(_: number) {}\n\n set 8(value: number) {\n this.columns[2].x = value;\n }\n\n set 9(value: number) {\n this.columns[2].y = value;\n }\n\n set 10(value: number) {\n this.columns[2].z = value;\n }\n\n set 11(_: number) {}\n\n *[Symbol.iterator]() {\n for (let i = 0; i < 12; i++) {\n yield this[i] as number;\n }\n }\n\n [$resolve](): ResolvedSnippet {\n return snip(\n `${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${\n this[5]\n }, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`,\n mat3x3f,\n );\n }\n\n toString() {\n return this[$resolve]().value;\n }\n}\n\nclass mat3x3fImpl extends mat3x3Impl<v3f> {\n public readonly kind = 'mat3x3f';\n makeColumn(x: number, y: number, z: number): v3f {\n return vec3f(x, y, z);\n }\n}\n\nabstract class mat4x4Impl<TColumn extends v4f> extends MatBase<TColumn>\n implements mat4x4<TColumn>, SelfResolvable {\n public readonly [$internal] = true;\n public readonly columns: readonly [TColumn, TColumn, TColumn, TColumn];\n public abstract readonly kind: string;\n\n constructor(...elements: number[]) {\n super();\n this.columns = [\n this.makeColumn(\n elements[0] as number,\n elements[1] as number,\n elements[2] as number,\n elements[3] as number,\n ),\n this.makeColumn(\n elements[4] as number,\n elements[5] as number,\n elements[6] as number,\n elements[7] as number,\n ),\n this.makeColumn(\n elements[8] as number,\n elements[9] as number,\n elements[10] as number,\n elements[11] as number,\n ),\n this.makeColumn(\n elements[12] as number,\n elements[13] as number,\n elements[14] as number,\n elements[15] as number,\n ),\n ];\n }\n\n abstract makeColumn(x: number, y: number, z: number, w: number): TColumn;\n\n public readonly length = 16;\n [n: number]: number;\n\n get 0() {\n return this.columns[0].x;\n }\n\n get 1() {\n return this.columns[0].y;\n }\n\n get 2() {\n return this.columns[0].z;\n }\n\n get 3() {\n return this.columns[0].w;\n }\n\n get 4() {\n return this.columns[1].x;\n }\n\n get 5() {\n return this.columns[1].y;\n }\n\n get 6() {\n return this.columns[1].z;\n }\n\n get 7() {\n return this.columns[1].w;\n }\n\n get 8() {\n return this.columns[2].x;\n }\n\n get 9() {\n return this.columns[2].y;\n }\n\n get 10() {\n return this.columns[2].z;\n }\n\n get 11() {\n return this.columns[2].w;\n }\n\n get 12() {\n return this.columns[3].x;\n }\n\n get 13() {\n return this.columns[3].y;\n }\n\n get 14() {\n return this.columns[3].z;\n }\n\n get 15() {\n return this.columns[3].w;\n }\n\n set 0(value: number) {\n this.columns[0].x = value;\n }\n\n set 1(value: number) {\n this.columns[0].y = value;\n }\n\n set 2(value: number) {\n this.columns[0].z = value;\n }\n\n set 3(value: number) {\n this.columns[0].w = value;\n }\n\n set 4(value: number) {\n this.columns[1].x = value;\n }\n\n set 5(value: number) {\n this.columns[1].y = value;\n }\n\n set 6(value: number) {\n this.columns[1].z = value;\n }\n\n set 7(value: number) {\n this.columns[1].w = value;\n }\n\n set 8(value: number) {\n this.columns[2].x = value;\n }\n\n set 9(value: number) {\n this.columns[2].y = value;\n }\n\n set 10(value: number) {\n this.columns[2].z = value;\n }\n\n set 11(value: number) {\n this.columns[2].w = value;\n }\n\n set 12(value: number) {\n this.columns[3].x = value;\n }\n\n set 13(value: number) {\n this.columns[3].y = value;\n }\n\n set 14(value: number) {\n this.columns[3].z = value;\n }\n\n set 15(value: number) {\n this.columns[3].w = value;\n }\n\n *[Symbol.iterator]() {\n for (let i = 0; i < 16; i++) {\n yield this[i] as number;\n }\n }\n\n [$resolve](): ResolvedSnippet {\n return snip(\n `${this.kind}(${\n Array.from({ length: this.length })\n .map((_, i) => this[i])\n .join(', ')\n })`,\n mat4x4f,\n );\n }\n\n toString() {\n return this[$resolve]().value;\n }\n}\n\nclass mat4x4fImpl extends mat4x4Impl<v4f> {\n public readonly kind = 'mat4x4f';\n\n makeColumn(x: number, y: number, z: number, w: number): v4f {\n return vec4f(x, y, z, w);\n }\n}\n\n// ----------\n// Matrix ops\n// ----------\n\n/**\n * Returns a 2-by-2 identity matrix.\n * @returns {m2x2f} The result matrix.\n */\nexport const identity2 = createDualImpl(\n // CPU implementation\n () => mat2x2f(1, 0, 0, 1),\n // CODEGEN implementation\n () => snip('mat2x2f(1, 0, 0, 1)', mat2x2f),\n 'identity2',\n);\n\n/**\n * Returns a 3-by-3 identity matrix.\n * @returns {m3x3f} The result matrix.\n */\nexport const identity3 = createDualImpl(\n // CPU implementation\n () => mat3x3f(1, 0, 0, 0, 1, 0, 0, 0, 1),\n // CODEGEN implementation\n () => snip('mat3x3f(1, 0, 0, 0, 1, 0, 0, 0, 1)', mat3x3f),\n 'identity3',\n);\n\n/**\n * Returns a 4-by-4 identity matrix.\n * @returns {m4x4f} The result matrix.\n */\nexport const identity4 = createDualImpl(\n // CPU implementation\n () => mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),\n // CODEGEN implementation\n () =>\n snip('mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)', mat4x4f),\n 'identity4',\n);\n\nconst identityFunctions = {\n 2: identity2,\n 3: identity3,\n 4: identity4,\n};\n\n/**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param {v3f} vector - The vector by which to translate.\n * @returns {m4x4f} The translation matrix.\n */\nexport const translation4 = createDualImpl(\n // CPU implementation\n (vector: v3f) =>\n // deno-fmt-ignore\n mat4x4f(\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n vector.x, vector.y, vector.z, 1,\n ),\n // CODEGEN implementation\n (v) =>\n snip(\n stitch`mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ${v}.x, ${v}.y, ${v}.z, 1)`,\n mat4x4f,\n ),\n 'translation4',\n);\n\n/**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by the corresponding entry in the given vector.\n * @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.\n * @returns {m4x4f} The scaling matrix.\n */\nexport const scaling4 = createDualImpl(\n // CPU implementation\n (vector: v3f) =>\n // deno-fmt-ignore\n mat4x4f(\n vector.x, 0, 0, 0,\n 0, vector.y, 0, 0,\n 0, 0, vector.z, 0,\n 0, 0, 0, 1,\n ),\n // CODEGEN implementation\n (v) =>\n snip(\n stitch`mat4x4f(${v}.x, 0, 0, 0, 0, ${v}.y, 0, 0, 0, 0, ${v}.z, 0, 0, 0, 0, 1)`,\n mat4x4f,\n ),\n 'scaling4',\n);\n\n/**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param {number} angle - The angle by which to rotate (in radians).\n * @returns {m4x4f} The rotation matrix.\n */\nexport const rotationX4 = createDualImpl(\n // CPU implementation\n (a: number) =>\n // deno-fmt-ignore\n mat4x4f(\n 1, 0, 0, 0,\n 0, Math.cos(a), Math.sin(a), 0,\n 0, -Math.sin(a), Math.cos(a), 0,\n 0, 0, 0, 1,\n ),\n // CODEGEN implementation\n (a) =>\n snip(\n stitch`mat4x4f(1, 0, 0, 0, 0, cos(${a}), sin(${a}), 0, 0, -sin(${a}), cos(${a}), 0, 0, 0, 0, 1)`,\n mat4x4f,\n ),\n 'rotationX4',\n);\n\n/**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param {number} angle - The angle by which to rotate (in radians).\n * @returns {m4x4f} The rotation matrix.\n */\nexport const rotationY4 = createDualImpl(\n // CPU implementation\n (a: number) =>\n // deno-fmt-ignore\n mat4x4f(\n Math.cos(a), 0, -Math.sin(a), 0,\n 0, 1, 0, 0,\n Math.sin(a), 0, Math.cos(a), 0,\n 0, 0, 0, 1,\n ),\n // CODEGEN implementation\n (a) =>\n snip(\n stitch`mat4x4f(cos(${a}), 0, -sin(${a}), 0, 0, 1, 0, 0, sin(${a}), 0, cos(${a}), 0, 0, 0, 0, 1)`,\n mat4x4f,\n ),\n 'rotationY4',\n);\n\n/**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param {number} angle - The angle by which to rotate (in radians).\n * @returns {m4x4f} The rotation matrix.\n */\nexport const rotationZ4 = createDualImpl(\n // CPU implementation\n (a: number) =>\n // deno-fmt-ignore\n mat4x4f(\n Math.cos(a), Math.sin(a), 0, 0,\n -Math.sin(a), Math.cos(a), 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1,\n ),\n // CODEGEN implementation\n (a) =>\n snip(\n stitch`mat4x4f(cos(${a}), sin(${a}), 0, 0, -sin(${a}), cos(${a}), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)`,\n mat4x4f,\n ),\n 'rotationZ4',\n);\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32.\n * Also a constructor function for this matrix type.\n *\n * @example\n * const zero2x2 = mat2x2f(); // filled with zeros\n *\n * @example\n * const mat = mat2x2f(0, 1, 2, 3);\n * mat.columns[0] // vec2f(0, 1)\n * mat.columns[1] // vec2f(2, 3)\n *\n * @example\n * const mat = mat2x2f(\n * vec2f(0, 1), // column 0\n * vec2f(1, 2), // column 1\n * );\n *\n * @example\n * const buffer = root.createBuffer(d.mat2x2f, d.mat2x2f(0, 1, 2, 3)); // buffer holding a d.mat2x2f value, with an initial value of ((0, 1), (2, 3))\n */\nexport const mat2x2f = createMatSchema<'mat2x2f', m2x2f, v2f>({\n type: 'mat2x2f',\n rows: 2,\n columns: 2,\n MatImpl: mat2x2fImpl,\n}) as Mat2x2f;\n\n/**\n * Schema representing mat3x3f - a matrix with 3 rows and 3 columns, with elements of type f32.\n * Also a constructor function for this matrix type.\n *\n * @example\n * const zero3x3 = mat3x3f(); // filled with zeros\n *\n * @example\n * const mat = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8);\n * mat.columns[0] // vec3f(0, 1, 2)\n * mat.columns[1] // vec3f(3, 4, 5)\n * mat.columns[2] // vec3f(6, 7, 8)\n *\n * @example\n * const mat = mat3x3f(\n * vec3f(0, 1, 2), // column 0\n * vec3f(2, 3, 4), // column 1\n * vec3f(5, 6, 7), // column 2\n * );\n *\n * @example\n * const buffer = root.createBuffer(d.mat3x3f, d.mat3x3f()); // buffer holding a d.mat3x3f value, with an initial value of mat3x3f filled with zeros\n */\nexport const mat3x3f = createMatSchema<'mat3x3f', m3x3f, v3f>({\n type: 'mat3x3f',\n rows: 3,\n columns: 3,\n MatImpl: mat3x3fImpl,\n}) as Mat3x3f;\n\n/**\n * Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32.\n * Also a constructor function for this matrix type.\n *\n * @example\n * const zero4x4 = mat4x4f(); // filled with zeros\n *\n * @example\n * const mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);\n * mat.columns[0] // vec4f(0, 1, 2, 3)\n * mat.columns[1] // vec4f(4, 5, 6, 7)\n * mat.columns[2] // vec4f(8, 9, 10, 11)\n * mat.columns[3] // vec4f(12, 13, 14, 15)\n *\n * @example\n * const mat = mat4x4f(\n * vec4f(0, 1, 2, 3), // column 0\n * vec4f(4, 5, 6, 7), // column 1\n * vec4f(8, 9, 10, 11), // column 2\n * vec4f(12, 13, 14, 15), // column 3\n * );\n *\n * @example\n * const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros\n */\nexport const mat4x4f = createMatSchema<'mat4x4f', m4x4f, v4f>({\n type: 'mat4x4f',\n rows: 4,\n columns: 4,\n MatImpl: mat4x4fImpl,\n}) as Mat4x4f;\n\nexport function matToArray(mat: m2x2f | m3x3f | m4x4f): number[] {\n if (mat.kind === 'mat3x3f') {\n return [\n mat[0],\n mat[1],\n mat[2],\n mat[4],\n mat[5],\n mat[6],\n mat[8],\n mat[9],\n mat[10],\n ] as number[];\n }\n\n return Array.from({ length: mat.length }).map((_, idx) => mat[idx] as number);\n}\n","import * as tinyest from 'tinyest';\nimport { stitch } from '../core/resolve/stitch.ts';\nimport { arrayOf } from '../data/array.ts';\nimport {\n type AnyData,\n ConsoleLog,\n InfixDispatch,\n isData,\n isLooseData,\n MatrixColumnsAccess,\n UnknownData,\n} from '../data/dataTypes.ts';\nimport { abstractInt, bool, u32 } from '../data/numeric.ts';\nimport { isSnippet, snip, type Snippet } from '../data/snippet.ts';\nimport * as wgsl from '../data/wgslTypes.ts';\nimport { invariant, ResolutionError, WgslTypeError } from '../errors.ts';\nimport { getName } from '../shared/meta.ts';\nimport { isMarkedInternal } from '../shared/symbols.ts';\nimport { safeStringify } from '../shared/stringify.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport { pow } from '../std/numeric.ts';\nimport { add, div, mul, sub } from '../std/operators.ts';\nimport type { FnArgsConversionHint } from '../types.ts';\nimport {\n convertStructValues,\n convertToCommonType,\n tryConvertSnippet,\n} from './conversion.ts';\nimport {\n coerceToSnippet,\n concretize,\n type GenerationCtx,\n getTypeForIndexAccess,\n getTypeForPropAccess,\n numericLiteralToSnippet,\n} from './generationHelpers.ts';\nimport type { ShaderGenerator } from './shaderGenerator.ts';\nimport { constant } from '../core/constant/tgpuConstant.ts';\n\nconst { NodeTypeCatalog: NODE } = tinyest;\n\nconst parenthesizedOps = [\n '==',\n '!=',\n '<',\n '<=',\n '>',\n '>=',\n '<<',\n '>>',\n '+',\n '-',\n '*',\n '/',\n '%',\n '|',\n '^',\n '&',\n '&&',\n '||',\n];\n\nconst binaryLogicalOps = ['&&', '||', '==', '!=', '<', '<=', '>', '>='];\n\nconst infixKinds = [\n 'vec2f',\n 'vec3f',\n 'vec4f',\n 'vec2h',\n 'vec3h',\n 'vec4h',\n 'vec2i',\n 'vec3i',\n 'vec4i',\n 'vec2u',\n 'vec3u',\n 'vec4u',\n 'mat2x2f',\n 'mat3x3f',\n 'mat4x4f',\n];\n\nexport const infixOperators = {\n add,\n sub,\n mul,\n div,\n} as const;\n\nexport type InfixOperator = keyof typeof infixOperators;\n\ntype Operator =\n | tinyest.BinaryOperator\n | tinyest.AssignmentOperator\n | tinyest.LogicalOperator\n | tinyest.UnaryOperator;\n\nfunction operatorToType<\n TL extends AnyData | UnknownData,\n TR extends AnyData | UnknownData,\n>(lhs: TL, op: Operator, rhs?: TR): TL | TR | wgsl.Bool {\n if (!rhs) {\n if (op === '!' || op === '~') {\n return bool;\n }\n\n return lhs;\n }\n\n if (binaryLogicalOps.includes(op)) {\n return bool;\n }\n\n if (op === '=') {\n return rhs;\n }\n\n return lhs;\n}\n\nconst opCodeToCodegen = {\n '+': add[$internal].gpuImpl,\n '-': sub[$internal].gpuImpl,\n '*': mul[$internal].gpuImpl,\n '/': div[$internal].gpuImpl,\n '**': pow[$internal].gpuImpl,\n} satisfies Partial<\n Record<tinyest.BinaryOperator, (...args: never[]) => unknown>\n>;\n\nclass WgslGenerator implements ShaderGenerator {\n #ctx: GenerationCtx | undefined = undefined;\n\n public initGenerator(ctx: GenerationCtx) {\n this.#ctx = ctx;\n }\n\n private get ctx(): GenerationCtx {\n if (!this.#ctx) {\n throw new Error(\n 'WGSL Generator has not yet been initialized. Please call initialize(ctx) before using the generator.',\n );\n }\n return this.#ctx;\n }\n\n public block(\n [_, statements]: tinyest.Block,\n ): string {\n this.ctx.pushBlockScope();\n try {\n this.ctx.indent();\n const body = statements.map((statement) => this.statement(statement))\n .join('\\n');\n this.ctx.dedent();\n return `{\n${body}\n${this.ctx.pre}}`;\n } finally {\n this.ctx.popBlockScope();\n }\n }\n\n public blockVariable(\n id: string,\n dataType: wgsl.AnyWgslData | UnknownData,\n ): Snippet {\n const snippet = snip(this.ctx.makeNameValid(id), dataType);\n this.ctx.defineVariable(id, snippet);\n return snippet;\n }\n\n public identifier(id: string): Snippet {\n if (!id) {\n throw new Error('Cannot resolve an empty identifier');\n }\n const res = this.ctx.getById(id);\n\n if (!res) {\n throw new Error(`Identifier ${id} not found`);\n }\n\n return res;\n }\n\n /**\n * A wrapper for `generateExpression` that updates `ctx.expectedType`\n * and tries to convert the result when it does not match the expected type.\n */\n public typedExpression(\n expression: tinyest.Expression,\n expectedType: AnyData,\n ) {\n const prevExpectedType = this.ctx.expectedType;\n this.ctx.expectedType = expectedType;\n\n try {\n const result = this.expression(expression);\n return tryConvertSnippet(result, expectedType);\n } finally {\n this.ctx.expectedType = prevExpectedType;\n }\n }\n\n public expression(\n expression: tinyest.Expression,\n ): Snippet {\n if (typeof expression === 'string') {\n return this.identifier(expression);\n }\n\n if (typeof expression === 'boolean') {\n return snip(expression, bool);\n }\n\n if (\n expression[0] === NODE.logicalExpr ||\n expression[0] === NODE.binaryExpr ||\n expression[0] === NODE.assignmentExpr\n ) {\n // Logical/Binary/Assignment Expression\n const [_, lhs, op, rhs] = expression;\n const lhsExpr = this.expression(lhs);\n const rhsExpr = this.expression(rhs);\n\n const codegen = opCodeToCodegen[op as keyof typeof opCodeToCodegen];\n if (codegen) {\n return codegen(lhsExpr, rhsExpr);\n }\n\n const forcedType = expression[0] === NODE.assignmentExpr\n ? lhsExpr.dataType.type === 'ptr'\n ? [lhsExpr.dataType.inner as AnyData]\n : [lhsExpr.dataType as AnyData]\n : undefined;\n\n const [convLhs, convRhs] =\n convertToCommonType([lhsExpr, rhsExpr], forcedType) ??\n [lhsExpr, rhsExpr];\n\n const lhsStr = this.ctx.resolve(convLhs.value, convLhs.dataType).value;\n const rhsStr = this.ctx.resolve(convRhs.value, convRhs.dataType).value;\n const type = operatorToType(convLhs.dataType, op, convRhs.dataType);\n\n return snip(\n parenthesizedOps.includes(op)\n ? `(${lhsStr} ${op} ${rhsStr})`\n : `${lhsStr} ${op} ${rhsStr}`,\n type,\n );\n }\n\n if (expression[0] === NODE.postUpdate) {\n // Post-Update Expression\n const [_, op, arg] = expression;\n const argExpr = this.expression(arg);\n const argStr = this.ctx.resolve(argExpr.value, argExpr.dataType).value;\n\n return snip(`${argStr}${op}`, argExpr.dataType);\n }\n\n if (expression[0] === NODE.unaryExpr) {\n // Unary Expression\n const [_, op, arg] = expression;\n const argExpr = this.expression(arg);\n const argStr = this.ctx.resolve(argExpr.value, argExpr.dataType).value;\n\n const type = operatorToType(argExpr.dataType, op);\n return snip(`${op}${argStr}`, type);\n }\n\n if (expression[0] === NODE.memberAccess) {\n // Member Access\n const [_, targetNode, property] = expression;\n const target = this.expression(targetNode);\n\n if (target.value === console) {\n return snip(\n new ConsoleLog(property),\n UnknownData,\n );\n }\n\n if (\n infixKinds.includes(target.dataType.type) &&\n property in infixOperators\n ) {\n return {\n value: new InfixDispatch(\n property,\n target,\n infixOperators[property as InfixOperator][$internal].gpuImpl,\n ),\n dataType: UnknownData,\n };\n }\n\n if (target.dataType.type === 'unknown') {\n // No idea what the type is, so we act on the snippet's value and try to guess\n\n // biome-ignore lint/suspicious/noExplicitAny: we're inspecting the value, and it could be any value\n const propValue = (target.value as any)[property];\n\n // We try to extract any type information based on the prop's value\n return coerceToSnippet(propValue);\n }\n\n if (wgsl.isPtr(target.dataType)) {\n return snip(\n `(*${this.ctx.resolve(target.value).value}).${property}`,\n getTypeForPropAccess(target.dataType.inner as AnyData, property),\n );\n }\n\n if (wgsl.isWgslArray(target.dataType) && property === 'length') {\n if (target.dataType.elementCount === 0) {\n // Dynamically-sized array\n return snip(\n `arrayLength(&${this.ctx.resolve(target.value).value})`,\n u32,\n );\n }\n\n return snip(String(target.dataType.elementCount), abstractInt);\n }\n\n if (wgsl.isMat(target.dataType) && property === 'columns') {\n return snip(new MatrixColumnsAccess(target), UnknownData);\n }\n\n if (\n wgsl.isVec(target.dataType) && wgsl.isVecInstance(target.value)\n ) {\n // We're operating on a vector that's known at resolution time\n // biome-ignore lint/suspicious/noExplicitAny: it's probably a swizzle\n return coerceToSnippet((target.value as any)[property]);\n }\n\n return snip(\n `${this.ctx.resolve(target.value).value}.${property}`,\n getTypeForPropAccess(target.dataType, property),\n );\n }\n\n if (expression[0] === NODE.indexAccess) {\n // Index Access\n const [_, targetNode, propertyNode] = expression;\n const target = this.expression(targetNode);\n const property = this.expression(propertyNode);\n const propertyStr =\n this.ctx.resolve(property.value, property.dataType).value;\n\n if (target.value instanceof MatrixColumnsAccess) {\n return snip(\n stitch`${target.value.matrix}[${propertyStr}]`,\n getTypeForIndexAccess(target.value.matrix.dataType as AnyData),\n );\n }\n const targetStr = this.ctx.resolve(target.value, target.dataType).value;\n\n if (target.dataType.type === 'unknown') {\n // No idea what the type is, so we act on the snippet's value and try to guess\n\n if (\n Array.isArray(propertyNode) && propertyNode[0] === NODE.numericLiteral\n ) {\n return coerceToSnippet(\n // biome-ignore lint/suspicious/noExplicitAny: we're inspecting the value, and it could be any value\n (target.value as any)[propertyNode[1] as number],\n );\n }\n\n throw new Error(\n `Unable to index a value of unknown type with index ${propertyStr}. If the value is an array, to address this, consider one of the following approaches: (1) declare the array using 'tgpu.const', (2) store the array in a buffer, or (3) define the array within the GPU function scope.`,\n );\n }\n\n if (wgsl.isMat(target.dataType)) {\n throw new Error(\n \"The only way of accessing matrix elements in TGSL is through the 'columns' property.\",\n );\n }\n\n if (wgsl.isPtr(target.dataType)) {\n return snip(\n `(*${targetStr})[${propertyStr}]`,\n getTypeForIndexAccess(target.dataType.inner as AnyData),\n );\n }\n\n return snip(\n `${targetStr}[${propertyStr}]`,\n isData(target.dataType)\n ? getTypeForIndexAccess(target.dataType)\n : UnknownData,\n );\n }\n\n if (expression[0] === NODE.numericLiteral) {\n // Numeric Literal\n const type = typeof expression[1] === 'string'\n ? numericLiteralToSnippet(parseNumericString(expression[1]))\n : numericLiteralToSnippet(expression[1]);\n if (!type) {\n throw new Error(`Invalid numeric literal ${expression[1]}`);\n }\n return type;\n }\n\n if (expression[0] === NODE.call) {\n // Function Call\n const [_, calleeNode, argNodes] = expression;\n const callee = this.expression(calleeNode);\n\n if (wgsl.isWgslStruct(callee.value) || wgsl.isWgslArray(callee.value)) {\n // Struct/array schema call.\n if (argNodes.length > 1) {\n throw new WgslTypeError(\n 'Array and struct schemas should always be called with at most 1 argument',\n );\n }\n\n // No arguments `Struct()`, resolve struct name and return.\n if (!argNodes[0]) {\n // the schema becomes the data type\n return snip(\n `${this.ctx.resolve(callee.value).value}()`,\n callee.value,\n );\n }\n\n const arg = this.typedExpression(\n argNodes[0],\n callee.value,\n );\n\n // Either `Struct({ x: 1, y: 2 })`, or `Struct(otherStruct)`.\n // In both cases, we just let the argument resolve everything.\n return snip(\n this.ctx.resolve(arg.value, callee.value).value,\n callee.value,\n );\n }\n\n if (callee.value === constant) {\n throw new Error(\n 'Constants cannot be defined within TypeGPU function scope. To address this, move the constant definition outside the function scope.',\n );\n }\n\n if (callee.value instanceof InfixDispatch) {\n // Infix operator dispatch.\n if (!argNodes[0]) {\n throw new WgslTypeError(\n `An infix operator '${callee.value.name}' was called without any arguments`,\n );\n }\n const rhs = this.expression(argNodes[0]);\n return callee.value.operator(callee.value.lhs, rhs);\n }\n\n if (!isMarkedInternal(callee.value)) {\n const args = argNodes.map((arg) => this.expression(arg));\n const shellless = this.ctx.shelllessRepo.get(\n callee.value as (...args: never[]) => unknown,\n args,\n );\n if (shellless) {\n return this.ctx.withResetIndentLevel(() => {\n const snippet = this.ctx.resolve(shellless);\n return snip(stitch`${snippet.value}(${args})`, snippet.dataType);\n });\n }\n\n throw new Error(\n `Function '${\n getName(callee.value) ?? String(callee.value)\n }' is not marked with the 'use gpu' directive and cannot be used in a shader`,\n );\n }\n\n // Other, including tgsl functions, std and vector/matrix schema calls.\n\n const argConversionHint =\n (callee.value[$internal] as Record<string, unknown>)\n ?.argConversionHint as FnArgsConversionHint ?? 'keep';\n try {\n let convertedArguments: Snippet[];\n\n if (Array.isArray(argConversionHint)) {\n // The hint is an array of schemas.\n convertedArguments = argNodes.map((arg, i) => {\n const argType = argConversionHint[i];\n if (!argType) {\n throw new WgslTypeError(\n `Function '${\n getName(callee.value)\n }' was called with too many arguments`,\n );\n }\n return this.typedExpression(arg, argType);\n });\n } else {\n const snippets = argNodes.map((arg) => this.expression(arg));\n\n if (argConversionHint === 'keep') {\n // The hint tells us to do nothing.\n convertedArguments = snippets;\n } else if (argConversionHint === 'unify') {\n // The hint tells us to unify the types.\n convertedArguments = convertToCommonType(snippets) ?? snippets;\n } else {\n // The hint is a function that converts the arguments.\n convertedArguments = argConversionHint(...snippets)\n .map((type, i) => [type, snippets[i] as Snippet] as const)\n .map(([type, sn]) => tryConvertSnippet(sn, type));\n }\n }\n\n if (callee.value instanceof ConsoleLog) {\n return this.ctx.generateLog(callee.value.op, convertedArguments);\n }\n\n // Assuming that `callee` is callable\n const fnRes =\n (callee.value as unknown as (...args: unknown[]) => unknown)(\n ...convertedArguments,\n );\n\n if (!isSnippet(fnRes)) {\n throw new Error(\n 'Functions running in codegen mode must return snippets',\n );\n }\n return fnRes;\n } catch (error) {\n throw new ResolutionError(error, [{\n toString: () => getName(callee.value),\n }]);\n }\n }\n\n if (expression[0] === NODE.objectExpr) {\n // Object Literal\n const obj = expression[1];\n\n const structType = this.ctx.expectedType;\n\n if (!structType || !wgsl.isWgslStruct(structType)) {\n throw new WgslTypeError(\n `No target type could be inferred for object with keys [${\n Object.keys(obj).join(', ')\n }], please wrap the object in the corresponding schema.`,\n );\n }\n\n const entries = Object.fromEntries(\n Object.entries(structType.propTypes).map(([key, value]) => {\n const val = obj[key];\n if (val === undefined) {\n throw new WgslTypeError(\n `Missing property ${key} in object literal for struct ${structType}`,\n );\n }\n const result = this.typedExpression(\n val,\n value as AnyData,\n );\n return [key, result];\n }),\n );\n\n const convertedSnippets = convertStructValues(structType, entries);\n\n return snip(\n stitch`${this.ctx.resolve(structType).value}(${convertedSnippets})`,\n structType,\n );\n }\n\n if (expression[0] === NODE.arrayExpr) {\n const [_, valueNodes] = expression;\n // Array Expression\n const arrType = this.ctx.expectedType;\n let elemType: AnyData;\n let values: Snippet[];\n\n if (wgsl.isWgslArray(arrType)) {\n elemType = arrType.elementType as AnyData;\n // The array is typed, so its elements should be as well.\n values = valueNodes.map((value) =>\n this.typedExpression(value, elemType)\n );\n // Since it's an expected type, we enforce the length\n if (values.length !== arrType.elementCount) {\n throw new WgslTypeError(\n `Cannot create value of type '${arrType}' from an array of length: ${values.length}`,\n );\n }\n } else {\n // The array is not typed, so we try to guess the types.\n const valuesSnippets = valueNodes.map((value) =>\n this.expression(value as tinyest.Expression)\n );\n\n if (valuesSnippets.length === 0) {\n throw new WgslTypeError(\n 'Cannot infer the type of an empty array literal.',\n );\n }\n\n const converted = convertToCommonType(valuesSnippets);\n if (!converted) {\n throw new WgslTypeError(\n 'The given values cannot be automatically converted to a common type. Consider wrapping the array in an appropriate schema',\n );\n }\n\n values = converted;\n elemType = concretize(values[0]?.dataType as wgsl.AnyWgslData);\n }\n\n const arrayType = `array<${\n this.ctx.resolve(elemType).value\n }, ${values.length}>`;\n\n return snip(\n stitch`${arrayType}(${values})`,\n arrayOf[$internal].jsImpl(\n elemType as wgsl.AnyWgslData,\n values.length,\n ) as wgsl.AnyWgslData,\n );\n }\n\n if (expression[0] === NODE.stringLiteral) {\n return snip(expression[1], UnknownData);\n }\n\n if (expression[0] === NODE.preUpdate) {\n throw new Error('Cannot use pre-updates in TGSL.');\n }\n\n assertExhaustive(expression);\n }\n\n public functionDefinition(\n body: tinyest.Block,\n ): string {\n return this.block(body);\n }\n\n public statement(\n statement: tinyest.Statement,\n ): string {\n if (typeof statement === 'string') {\n return `${this.ctx.pre}${\n this.ctx.resolve(this.identifier(statement).value).value\n };`;\n }\n\n if (typeof statement === 'boolean') {\n return `${this.ctx.pre}${statement ? 'true' : 'false'};`;\n }\n\n if (statement[0] === NODE.return) {\n const returnNode = statement[1];\n\n if (returnNode !== undefined) {\n const expectedReturnType = this.ctx.topFunctionReturnType;\n const returnSnippet = expectedReturnType\n ? this.typedExpression(\n returnNode,\n expectedReturnType,\n )\n : this.expression(returnNode);\n\n invariant(\n returnSnippet.dataType.type !== 'unknown',\n 'Return type should be known',\n );\n\n this.ctx.reportReturnType(returnSnippet.dataType);\n return stitch`${this.ctx.pre}return ${returnSnippet};`;\n }\n\n return `${this.ctx.pre}return;`;\n }\n\n if (statement[0] === NODE.if) {\n const [_, condNode, consNode, altNode] = statement;\n const condition = this.typedExpression(condNode, bool);\n\n const consequent = condition.value === false\n ? undefined\n : this.block(blockifySingleStatement(consNode));\n const alternate = condition.value === true || !altNode\n ? undefined\n : this.block(blockifySingleStatement(altNode));\n\n if (condition.value === true) {\n return `${this.ctx.pre}${consequent}`;\n }\n\n if (condition.value === false) {\n return alternate ? `${this.ctx.pre}${alternate}` : '';\n }\n\n if (!alternate) {\n return stitch`${this.ctx.pre}if (${condition}) ${consequent}`;\n }\n\n return stitch`\\\n${this.ctx.pre}if (${condition}) ${consequent}\n${this.ctx.pre}else ${alternate}`;\n }\n\n if (statement[0] === NODE.let || statement[0] === NODE.const) {\n const [_, rawId, rawValue] = statement;\n const eq = rawValue !== undefined ? this.expression(rawValue) : undefined;\n\n if (!eq) {\n throw new Error(\n `Cannot create variable '${rawId}' without an initial value.`,\n );\n }\n\n if (isLooseData(eq.dataType)) {\n throw new Error(\n `Cannot create variable '${rawId}' with loose data type.`,\n );\n }\n\n const snippet = this.blockVariable(\n rawId,\n concretize(eq.dataType as wgsl.AnyWgslData),\n );\n return stitch`${this.ctx.pre}var ${snippet\n .value as string} = ${eq};`;\n }\n\n if (statement[0] === NODE.block) {\n return this.block(statement);\n }\n\n if (statement[0] === NODE.for) {\n const [_, init, condition, update, body] = statement;\n\n const [initStatement, conditionExpr, updateStatement] = this.ctx\n .withResetIndentLevel(\n () => [\n init ? this.statement(init) : undefined,\n condition ? this.typedExpression(condition, bool) : undefined,\n update ? this.statement(update) : undefined,\n ],\n );\n\n const initStr = initStatement ? initStatement.slice(0, -1) : '';\n const updateStr = updateStatement ? updateStatement.slice(0, -1) : '';\n\n const bodyStr = this.block(blockifySingleStatement(body));\n return stitch`${this.ctx.pre}for (${initStr}; ${conditionExpr}; ${updateStr}) ${bodyStr}`;\n }\n\n if (statement[0] === NODE.while) {\n const [_, condition, body] = statement;\n const condSnippet = this.typedExpression(condition, bool);\n const conditionStr = this.ctx.resolve(condSnippet.value).value;\n\n const bodyStr = this.block(blockifySingleStatement(body));\n return `${this.ctx.pre}while (${conditionStr}) ${bodyStr}`;\n }\n\n if (statement[0] === NODE.continue) {\n return `${this.ctx.pre}continue;`;\n }\n\n if (statement[0] === NODE.break) {\n return `${this.ctx.pre}break;`;\n }\n\n return `${this.ctx.pre}${\n this.ctx.resolve(this.expression(statement).value).value\n };`;\n }\n}\n\nfunction assertExhaustive(value: never): never {\n throw new Error(\n `'${safeStringify(value)}' was not handled by the WGSL generator.`,\n );\n}\n\nfunction parseNumericString(str: string): number {\n // Hex literals\n if (/^0x[0-9a-f]+$/i.test(str)) {\n return Number.parseInt(str);\n }\n\n // Binary literals\n if (/^0b[01]+$/i.test(str)) {\n return Number.parseInt(str.slice(2), 2);\n }\n\n return Number.parseFloat(str);\n}\n\nfunction blockifySingleStatement(statement: tinyest.Statement): tinyest.Block {\n return typeof statement !== 'object' ||\n statement[0] !== NODE.block\n ? [NODE.block, [statement]]\n : statement;\n}\n\nconst wgslGenerator: WgslGenerator = new WgslGenerator();\nexport default wgslGenerator;\n"]}
package/common/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkESIHND6Wcjs = require('../chunk-ESIHND6W.cjs');var _chunk44LAYHPRcjs = require('../chunk-44LAYHPR.cjs');var o=_chunkESIHND6Wcjs.h.call(void 0, {in:{vertexIndex:_chunk44LAYHPRcjs.vc.vertexIndex},out:{pos:_chunk44LAYHPRcjs.vc.position,uv:_chunk44LAYHPRcjs.Ya}})`{
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5Y6GTBWRcjs = require('../chunk-5Y6GTBWR.cjs');var _chunkTRE7NUKEcjs = require('../chunk-TRE7NUKE.cjs');var o=_chunk5Y6GTBWRcjs.h.call(void 0, {in:{vertexIndex:_chunkTRE7NUKEcjs.uc.vertexIndex},out:{pos:_chunkTRE7NUKEcjs.uc.position,uv:_chunkTRE7NUKEcjs.Xa}})`{
2
2
  const pos = array<vec2f, 3>(vec2f(-1, -1), vec2f(3, -1), vec2f(-1, 3));
3
3
  const uv = array<vec2f, 3>(vec2f(0, 1), vec2f(2, 1), vec2f(0, -1));
4
4
 
@@ -1,4 +1,4 @@
1
- import { aE as TgpuVertexFn, aM as Vec2f } from '../tgpuConstant-sKeoSjPD.cjs';
1
+ import { aH as TgpuVertexFn, aP as Vec2f } from '../tgpuConstant-BU72w5qs.cjs';
2
2
  import 'tinyest';
3
3
 
4
4
  /**
package/common/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { aE as TgpuVertexFn, aM as Vec2f } from '../tgpuConstant-sKeoSjPD.js';
1
+ import { aH as TgpuVertexFn, aP as Vec2f } from '../tgpuConstant-BU72w5qs.js';
2
2
  import 'tinyest';
3
3
 
4
4
  /**
package/common/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{h as n}from"../chunk-MJ6A4DOA.js";import{Ya as r,vc as e}from"../chunk-BDGVKGU4.js";var o=n({in:{vertexIndex:e.vertexIndex},out:{pos:e.position,uv:r}})`{
1
+ import{h as n}from"../chunk-7XFSK632.js";import{Xa as r,uc as e}from"../chunk-4W5Z7BO4.js";var o=n({in:{vertexIndex:e.vertexIndex},out:{pos:e.position,uv:r}})`{
2
2
  const pos = array<vec2f, 3>(vec2f(-1, -1), vec2f(3, -1), vec2f(-1, 3));
3
3
  const uv = array<vec2f, 3>(vec2f(0, 1), vec2f(2, 1), vec2f(0, -1));
4
4
 
package/data/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWDMOZFKNcjs = require('../chunk-WDMOZFKN.cjs');var _chunkHLB6TY7Icjs = require('../chunk-HLB6TY7I.cjs');var _chunk44LAYHPRcjs = require('../chunk-44LAYHPR.cjs');exports.Void = _chunk44LAYHPRcjs.q; exports.align = _chunk44LAYHPRcjs.kc; exports.alignmentOf = _chunk44LAYHPRcjs.gc; exports.arrayOf = _chunk44LAYHPRcjs.uc; exports.atomic = _chunkHLB6TY7Icjs.R; exports.bool = _chunk44LAYHPRcjs.Ra; exports.builtin = _chunk44LAYHPRcjs.vc; exports.comparisonSampler = _chunkHLB6TY7Icjs.t; exports.deepEqual = _chunkWDMOZFKNcjs.i; exports.disarrayOf = _chunkWDMOZFKNcjs.g; exports.f16 = _chunk44LAYHPRcjs.Wa; exports.f32 = _chunk44LAYHPRcjs.Va; exports.float16 = _chunk44LAYHPRcjs.Ob; exports.float16x2 = _chunk44LAYHPRcjs.Pb; exports.float16x4 = _chunk44LAYHPRcjs.Qb; exports.float32 = _chunk44LAYHPRcjs.Rb; exports.float32x2 = _chunk44LAYHPRcjs.Sb; exports.float32x3 = _chunk44LAYHPRcjs.Tb; exports.float32x4 = _chunk44LAYHPRcjs.Ub; exports.formatToWGSLType = _chunk44LAYHPRcjs.ob; exports.i32 = _chunk44LAYHPRcjs.Ua; exports.interpolate = _chunk44LAYHPRcjs.nc; exports.invariant = _chunk44LAYHPRcjs.oc; exports.isAlignAttrib = _chunk44LAYHPRcjs.G; exports.isAtomic = _chunk44LAYHPRcjs.F; exports.isBuiltin = _chunk44LAYHPRcjs.pc; exports.isBuiltinAttrib = _chunk44LAYHPRcjs.K; exports.isData = _chunk44LAYHPRcjs.V; exports.isDecorated = _chunk44LAYHPRcjs.L; exports.isDisarray = _chunk44LAYHPRcjs.R; exports.isInterpolateAttrib = _chunk44LAYHPRcjs.J; exports.isLocationAttrib = _chunk44LAYHPRcjs.I; exports.isLooseData = _chunk44LAYHPRcjs.Q; exports.isLooseDecorated = _chunk44LAYHPRcjs.T; exports.isPackedData = _chunk44LAYHPRcjs.dc; exports.isPtr = _chunk44LAYHPRcjs.E; exports.isSizeAttrib = _chunk44LAYHPRcjs.H; exports.isUnstruct = _chunk44LAYHPRcjs.S; exports.isWgslArray = _chunk44LAYHPRcjs.C; exports.isWgslData = _chunk44LAYHPRcjs.B; exports.isWgslStruct = _chunk44LAYHPRcjs.D; exports.location = _chunk44LAYHPRcjs.mc; exports.mat2x2f = _chunkHLB6TY7Icjs.j; exports.mat3x3f = _chunkHLB6TY7Icjs.k; exports.mat4x4f = _chunkHLB6TY7Icjs.l; exports.matToArray = _chunkHLB6TY7Icjs.m; exports.packedFormats = _chunk44LAYHPRcjs.pb; exports.ptrFn = _chunkWDMOZFKNcjs.a; exports.ptrHandle = _chunkWDMOZFKNcjs.f; exports.ptrPrivate = _chunkWDMOZFKNcjs.b; exports.ptrStorage = _chunkWDMOZFKNcjs.d; exports.ptrUniform = _chunkWDMOZFKNcjs.e; exports.ptrWorkgroup = _chunkWDMOZFKNcjs.c; exports.sampler = _chunkHLB6TY7Icjs.s; exports.sint16 = _chunk44LAYHPRcjs.Fb; exports.sint16x2 = _chunk44LAYHPRcjs.Gb; exports.sint16x4 = _chunk44LAYHPRcjs.Hb; exports.sint32 = _chunk44LAYHPRcjs.Zb; exports.sint32x2 = _chunk44LAYHPRcjs._b; exports.sint32x3 = _chunk44LAYHPRcjs.$b; exports.sint32x4 = _chunk44LAYHPRcjs.ac; exports.sint8 = _chunk44LAYHPRcjs.tb; exports.sint8x2 = _chunk44LAYHPRcjs.ub; exports.sint8x4 = _chunk44LAYHPRcjs.vb; exports.size = _chunk44LAYHPRcjs.lc; exports.sizeOf = _chunk44LAYHPRcjs.jc; exports.snorm16 = _chunk44LAYHPRcjs.Lb; exports.snorm16x2 = _chunk44LAYHPRcjs.Mb; exports.snorm16x4 = _chunk44LAYHPRcjs.Nb; exports.snorm8 = _chunk44LAYHPRcjs.zb; exports.snorm8x2 = _chunk44LAYHPRcjs.Ab; exports.snorm8x4 = _chunk44LAYHPRcjs.Bb; exports.struct = _chunk44LAYHPRcjs.sc; exports.texture1d = _chunkHLB6TY7Icjs.y; exports.texture2d = _chunkHLB6TY7Icjs.z; exports.texture2dArray = _chunkHLB6TY7Icjs.B; exports.texture3d = _chunkHLB6TY7Icjs.E; exports.textureCube = _chunkHLB6TY7Icjs.C; exports.textureCubeArray = _chunkHLB6TY7Icjs.D; exports.textureDepth2d = _chunkHLB6TY7Icjs.J; exports.textureDepth2dArray = _chunkHLB6TY7Icjs.L; exports.textureDepthCube = _chunkHLB6TY7Icjs.M; exports.textureDepthCubeArray = _chunkHLB6TY7Icjs.N; exports.textureDepthMultisampled2d = _chunkHLB6TY7Icjs.K; exports.textureExternal = _chunkHLB6TY7Icjs.O; exports.textureMultisampled2d = _chunkHLB6TY7Icjs.A; exports.textureStorage1d = _chunkHLB6TY7Icjs.F; exports.textureStorage2d = _chunkHLB6TY7Icjs.G; exports.textureStorage2dArray = _chunkHLB6TY7Icjs.H; exports.textureStorage3d = _chunkHLB6TY7Icjs.I; exports.u16 = _chunk44LAYHPRcjs.Ta; exports.u32 = _chunk44LAYHPRcjs.Sa; exports.uint16 = _chunk44LAYHPRcjs.Cb; exports.uint16x2 = _chunk44LAYHPRcjs.Db; exports.uint16x4 = _chunk44LAYHPRcjs.Eb; exports.uint32 = _chunk44LAYHPRcjs.Vb; exports.uint32x2 = _chunk44LAYHPRcjs.Wb; exports.uint32x3 = _chunk44LAYHPRcjs.Xb; exports.uint32x4 = _chunk44LAYHPRcjs.Yb; exports.uint8 = _chunk44LAYHPRcjs.qb; exports.uint8x2 = _chunk44LAYHPRcjs.rb; exports.uint8x4 = _chunk44LAYHPRcjs.sb; exports.unorm10_10_10_2 = _chunk44LAYHPRcjs.bc; exports.unorm16 = _chunk44LAYHPRcjs.Ib; exports.unorm16x2 = _chunk44LAYHPRcjs.Jb; exports.unorm16x4 = _chunk44LAYHPRcjs.Kb; exports.unorm8 = _chunk44LAYHPRcjs.wb; exports.unorm8x2 = _chunk44LAYHPRcjs.xb; exports.unorm8x4 = _chunk44LAYHPRcjs.yb; exports.unorm8x4_bgra = _chunk44LAYHPRcjs.cc; exports.unstruct = _chunkWDMOZFKNcjs.h; exports.vec2b = _chunk44LAYHPRcjs.ab; exports.vec2f = _chunk44LAYHPRcjs.Ya; exports.vec2h = _chunk44LAYHPRcjs.Za; exports.vec2i = _chunk44LAYHPRcjs._a; exports.vec2u = _chunk44LAYHPRcjs.$a; exports.vec3b = _chunk44LAYHPRcjs.fb; exports.vec3f = _chunk44LAYHPRcjs.bb; exports.vec3h = _chunk44LAYHPRcjs.cb; exports.vec3i = _chunk44LAYHPRcjs.db; exports.vec3u = _chunk44LAYHPRcjs.eb; exports.vec4b = _chunk44LAYHPRcjs.kb; exports.vec4f = _chunk44LAYHPRcjs.gb; exports.vec4h = _chunk44LAYHPRcjs.hb; exports.vec4i = _chunk44LAYHPRcjs.ib; exports.vec4u = _chunk44LAYHPRcjs.jb;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPRMFGUQTcjs = require('../chunk-PRMFGUQT.cjs');var _chunkZYGTVBDHcjs = require('../chunk-ZYGTVBDH.cjs');var _chunkTRE7NUKEcjs = require('../chunk-TRE7NUKE.cjs');exports.Void = _chunkTRE7NUKEcjs.q; exports.align = _chunkTRE7NUKEcjs.jc; exports.alignmentOf = _chunkTRE7NUKEcjs.fc; exports.arrayOf = _chunkTRE7NUKEcjs.tc; exports.atomic = _chunkZYGTVBDHcjs.T; exports.bool = _chunkTRE7NUKEcjs.Qa; exports.builtin = _chunkTRE7NUKEcjs.uc; exports.comparisonSampler = _chunkZYGTVBDHcjs.v; exports.deepEqual = _chunkPRMFGUQTcjs.i; exports.disarrayOf = _chunkPRMFGUQTcjs.g; exports.f16 = _chunkTRE7NUKEcjs.Va; exports.f32 = _chunkTRE7NUKEcjs.Ua; exports.float16 = _chunkTRE7NUKEcjs.Nb; exports.float16x2 = _chunkTRE7NUKEcjs.Ob; exports.float16x4 = _chunkTRE7NUKEcjs.Pb; exports.float32 = _chunkTRE7NUKEcjs.Qb; exports.float32x2 = _chunkTRE7NUKEcjs.Rb; exports.float32x3 = _chunkTRE7NUKEcjs.Sb; exports.float32x4 = _chunkTRE7NUKEcjs.Tb; exports.formatToWGSLType = _chunkTRE7NUKEcjs.nb; exports.i32 = _chunkTRE7NUKEcjs.Ta; exports.interpolate = _chunkTRE7NUKEcjs.mc; exports.invariant = _chunkTRE7NUKEcjs.nc; exports.isAlignAttrib = _chunkTRE7NUKEcjs.G; exports.isAtomic = _chunkTRE7NUKEcjs.F; exports.isBuiltin = _chunkTRE7NUKEcjs.oc; exports.isBuiltinAttrib = _chunkTRE7NUKEcjs.K; exports.isData = _chunkTRE7NUKEcjs.V; exports.isDecorated = _chunkTRE7NUKEcjs.L; exports.isDisarray = _chunkTRE7NUKEcjs.R; exports.isInterpolateAttrib = _chunkTRE7NUKEcjs.J; exports.isLocationAttrib = _chunkTRE7NUKEcjs.I; exports.isLooseData = _chunkTRE7NUKEcjs.Q; exports.isLooseDecorated = _chunkTRE7NUKEcjs.T; exports.isPackedData = _chunkTRE7NUKEcjs.cc; exports.isPtr = _chunkTRE7NUKEcjs.E; exports.isSizeAttrib = _chunkTRE7NUKEcjs.H; exports.isUnstruct = _chunkTRE7NUKEcjs.S; exports.isWgslArray = _chunkTRE7NUKEcjs.C; exports.isWgslData = _chunkTRE7NUKEcjs.B; exports.isWgslStruct = _chunkTRE7NUKEcjs.D; exports.location = _chunkTRE7NUKEcjs.lc; exports.mat2x2f = _chunkZYGTVBDHcjs.j; exports.mat3x3f = _chunkZYGTVBDHcjs.k; exports.mat4x4f = _chunkZYGTVBDHcjs.l; exports.matToArray = _chunkZYGTVBDHcjs.m; exports.packedFormats = _chunkTRE7NUKEcjs.ob; exports.ptrFn = _chunkPRMFGUQTcjs.a; exports.ptrHandle = _chunkPRMFGUQTcjs.f; exports.ptrPrivate = _chunkPRMFGUQTcjs.b; exports.ptrStorage = _chunkPRMFGUQTcjs.d; exports.ptrUniform = _chunkPRMFGUQTcjs.e; exports.ptrWorkgroup = _chunkPRMFGUQTcjs.c; exports.sampler = _chunkZYGTVBDHcjs.u; exports.sint16 = _chunkTRE7NUKEcjs.Eb; exports.sint16x2 = _chunkTRE7NUKEcjs.Fb; exports.sint16x4 = _chunkTRE7NUKEcjs.Gb; exports.sint32 = _chunkTRE7NUKEcjs.Yb; exports.sint32x2 = _chunkTRE7NUKEcjs.Zb; exports.sint32x3 = _chunkTRE7NUKEcjs._b; exports.sint32x4 = _chunkTRE7NUKEcjs.$b; exports.sint8 = _chunkTRE7NUKEcjs.sb; exports.sint8x2 = _chunkTRE7NUKEcjs.tb; exports.sint8x4 = _chunkTRE7NUKEcjs.ub; exports.size = _chunkTRE7NUKEcjs.kc; exports.sizeOf = _chunkTRE7NUKEcjs.ic; exports.snorm16 = _chunkTRE7NUKEcjs.Kb; exports.snorm16x2 = _chunkTRE7NUKEcjs.Lb; exports.snorm16x4 = _chunkTRE7NUKEcjs.Mb; exports.snorm8 = _chunkTRE7NUKEcjs.yb; exports.snorm8x2 = _chunkTRE7NUKEcjs.zb; exports.snorm8x4 = _chunkTRE7NUKEcjs.Ab; exports.struct = _chunkTRE7NUKEcjs.rc; exports.texture1d = _chunkZYGTVBDHcjs.A; exports.texture2d = _chunkZYGTVBDHcjs.B; exports.texture2dArray = _chunkZYGTVBDHcjs.D; exports.texture3d = _chunkZYGTVBDHcjs.G; exports.textureCube = _chunkZYGTVBDHcjs.E; exports.textureCubeArray = _chunkZYGTVBDHcjs.F; exports.textureDepth2d = _chunkZYGTVBDHcjs.L; exports.textureDepth2dArray = _chunkZYGTVBDHcjs.N; exports.textureDepthCube = _chunkZYGTVBDHcjs.O; exports.textureDepthCubeArray = _chunkZYGTVBDHcjs.P; exports.textureDepthMultisampled2d = _chunkZYGTVBDHcjs.M; exports.textureExternal = _chunkZYGTVBDHcjs.Q; exports.textureMultisampled2d = _chunkZYGTVBDHcjs.C; exports.textureStorage1d = _chunkZYGTVBDHcjs.H; exports.textureStorage2d = _chunkZYGTVBDHcjs.I; exports.textureStorage2dArray = _chunkZYGTVBDHcjs.J; exports.textureStorage3d = _chunkZYGTVBDHcjs.K; exports.u16 = _chunkTRE7NUKEcjs.Sa; exports.u32 = _chunkTRE7NUKEcjs.Ra; exports.uint16 = _chunkTRE7NUKEcjs.Bb; exports.uint16x2 = _chunkTRE7NUKEcjs.Cb; exports.uint16x4 = _chunkTRE7NUKEcjs.Db; exports.uint32 = _chunkTRE7NUKEcjs.Ub; exports.uint32x2 = _chunkTRE7NUKEcjs.Vb; exports.uint32x3 = _chunkTRE7NUKEcjs.Wb; exports.uint32x4 = _chunkTRE7NUKEcjs.Xb; exports.uint8 = _chunkTRE7NUKEcjs.pb; exports.uint8x2 = _chunkTRE7NUKEcjs.qb; exports.uint8x4 = _chunkTRE7NUKEcjs.rb; exports.unorm10_10_10_2 = _chunkTRE7NUKEcjs.ac; exports.unorm16 = _chunkTRE7NUKEcjs.Hb; exports.unorm16x2 = _chunkTRE7NUKEcjs.Ib; exports.unorm16x4 = _chunkTRE7NUKEcjs.Jb; exports.unorm8 = _chunkTRE7NUKEcjs.vb; exports.unorm8x2 = _chunkTRE7NUKEcjs.wb; exports.unorm8x4 = _chunkTRE7NUKEcjs.xb; exports.unorm8x4_bgra = _chunkTRE7NUKEcjs.bc; exports.unstruct = _chunkPRMFGUQTcjs.h; exports.vec2b = _chunkTRE7NUKEcjs.$a; exports.vec2f = _chunkTRE7NUKEcjs.Xa; exports.vec2h = _chunkTRE7NUKEcjs.Ya; exports.vec2i = _chunkTRE7NUKEcjs.Za; exports.vec2u = _chunkTRE7NUKEcjs._a; exports.vec3b = _chunkTRE7NUKEcjs.eb; exports.vec3f = _chunkTRE7NUKEcjs.ab; exports.vec3h = _chunkTRE7NUKEcjs.bb; exports.vec3i = _chunkTRE7NUKEcjs.cb; exports.vec3u = _chunkTRE7NUKEcjs.db; exports.vec4b = _chunkTRE7NUKEcjs.jb; exports.vec4f = _chunkTRE7NUKEcjs.fb; exports.vec4h = _chunkTRE7NUKEcjs.gb; exports.vec4i = _chunkTRE7NUKEcjs.hb; exports.vec4u = _chunkTRE7NUKEcjs.ib;
2
2
  //# sourceMappingURL=index.cjs.map