typegpu 0.3.0-alpha.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/chunk-5DF7EEAZ.cjs +4 -0
- package/chunk-5DF7EEAZ.cjs.map +1 -0
- package/chunk-PN2EAL4B.js +4 -0
- package/chunk-PN2EAL4B.js.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.d.cts +122 -121
- package/data/index.d.ts +122 -121
- package/data/index.js +1 -1
- package/index.cjs +10 -12
- package/index.cjs.map +1 -1
- package/index.d.cts +51 -598
- package/index.d.ts +51 -598
- package/index.js +10 -12
- package/index.js.map +1 -1
- package/package.json +3 -9
- package/{utilityTypes-D53GCmPw.d.cts → wgslTypes-BsqIvRBG.d.cts} +1661 -1107
- package/{utilityTypes-D53GCmPw.d.ts → wgslTypes-BsqIvRBG.d.ts} +1661 -1107
- package/chunk-3A2SULTE.cjs +0 -4
- package/chunk-3A2SULTE.cjs.map +0 -1
- package/chunk-U7YXBTRR.js +0 -4
- package/chunk-U7YXBTRR.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/data/numeric.ts","../src/errors.ts","../src/gpuMode.ts","../src/data/wgslTypes.ts","../src/data/struct.ts","../src/mathUtils.ts","../src/shared/vertexFormat.ts","../src/data/dataTypes.ts","../src/data/vector.ts","../src/data/vertexFormatData.ts","../src/data/alignmentOf.ts","../src/data/sizeOf.ts","../src/data/array.ts","../src/data/disarray.ts","../src/data/unstruct.ts","../src/data/matrix.ts","../src/data/atomic.ts","../src/data/attributes.ts","../src/builtin.ts"],"sourcesContent":["import bin from 'typed-binary';\nimport { inGPUMode } from '../gpuMode';\nimport type { Bool, F16, F32, I32, U32 } from './wgslTypes';\n\n/**\n * A schema that represents a boolean value. (equivalent to `bool` in WGSL)\n */\nexport const bool: Bool = {\n type: 'bool',\n} as Bool;\n\n/**\n * Unsigned 32-bit integer schema representing a single WGSL u32 value.\n */\nexport type NativeU32 = U32 & { '~exotic': U32 } & ((\n v: number | boolean,\n ) => number);\n\nconst u32Cast = (v: number | boolean) => {\n if (inGPUMode()) {\n return `u32(${v})` as unknown as number;\n }\n\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n if (Number.isInteger(v)) {\n if (v < 0 || v > 0xffffffff) {\n console.warn(`u32 value ${v} overflowed`);\n }\n const value = v & 0xffffffff;\n return value >>> 0;\n }\n return Math.max(0, Math.min(0xffffffff, Math.floor(v)));\n};\n\n/**\n * A schema that represents an unsigned 32-bit integer value. (equivalent to `u32` in WGSL)\n *\n * Can also be called to cast a value to an u32 in accordance with WGSL casting rules.\n *\n * @example\n * const value = u32(3.14); // 3\n * @example\n * const value = u32(-1); // 4294967295\n * @example\n * const value = u32(-3.1); // 0\n */\nexport const u32: NativeU32 = Object.assign(u32Cast, {\n type: 'u32',\n}) as NativeU32;\n\n/**\n * Signed 32-bit integer schema representing a single WGSL i32 value.\n */\nexport type NativeI32 = I32 & { '~exotic': I32 } & ((\n v: number | boolean,\n ) => number);\n\nconst i32Cast = (v: number | boolean) => {\n if (inGPUMode()) {\n return `i32(${v})` as unknown as number;\n }\n\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n if (Number.isInteger(v)) {\n if (v < -0x80000000 || v > 0x7fffffff) {\n console.warn(`i32 value ${v} overflowed`);\n }\n const value = v | 0;\n return value & 0xffffffff;\n }\n // round towards zero\n const value = v < 0 ? Math.ceil(v) : Math.floor(v);\n return Math.max(-0x80000000, Math.min(0x7fffffff, value));\n};\n\n/**\n * A schema that represents a signed 32-bit integer value. (equivalent to `i32` in WGSL)\n *\n * Can also be called to cast a value to an i32 in accordance with WGSL casting rules.\n *\n * @example\n * const value = i32(3.14); // 3\n * @example\n * const value = i32(-3.9); // -3\n * @example\n * const value = i32(10000000000) // 1410065408\n */\nexport const i32: NativeI32 = Object.assign(i32Cast, {\n type: 'i32',\n}) as NativeI32;\n\n/**\n * 32-bit float schema representing a single WGSL f32 value.\n */\nexport type NativeF32 = F32 & { '~exotic': F32 } & ((\n v: number | boolean,\n ) => number);\n\nconst f32Cast = (v: number | boolean) => {\n if (inGPUMode()) {\n return `f32(${v})` as unknown as number;\n }\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n const arr = new Float32Array(1);\n arr[0] = v;\n return arr[0];\n};\n\n/**\n * A schema that represents a 32-bit float value. (equivalent to `f32` in WGSL)\n *\n * Can also be called to cast a value to an f32.\n *\n * @example\n * const value = f32(true); // 1\n */\nexport const f32: NativeF32 = Object.assign(f32Cast, {\n type: 'f32',\n}) as NativeF32;\n\n/**\n * 16-bit float schema representing a single WGSL f16 value.\n */\nexport type NativeF16 = F16 & { '~exotic': F16 } & ((\n v: number | boolean,\n ) => number);\n\nconst f16Cast = (v: number | boolean) => {\n if (inGPUMode()) {\n // TODO: make usage of f16() in GPU mode check for feature availability and throw if not available\n return `f16(${v})` as unknown as number;\n }\n if (typeof v === 'boolean') {\n return v ? 1 : 0;\n }\n const arr = new ArrayBuffer(2);\n bin.f16.write(new bin.BufferWriter(arr), v);\n return bin.f16.read(new bin.BufferReader(arr));\n};\n\n/**\n * A schema that represents a 16-bit float value. (equivalent to `f16` in WGSL)\n *\n * Can also be called to cast a value to an f16.\n *\n * @example\n * const value = f16(true); // 1\n * @example\n * const value = f16(21877.5); // 21872\n */\nexport const f16: NativeF16 = Object.assign(f16Cast, {\n type: 'f16',\n}) as NativeF16;\n","import type { TgpuBuffer } from './core/buffer/buffer';\nimport type { TgpuSlot } from './core/slot/slotTypes';\nimport type { AnyData } from './data/dataTypes';\n\nconst prefix = 'Invariant failed';\n\n/**\n * Inspired by: https://github.com/alexreardon/tiny-invariant/blob/master/src/tiny-invariant.ts\n */\nexport function invariant(\n condition: unknown,\n message?: string | (() => string),\n): asserts condition {\n if (condition) {\n // Condition passed\n return;\n }\n\n // In production we strip the message but still throw\n if (process.env.NODE_ENV === 'production') {\n throw new Error(prefix);\n }\n\n // When not in production we allow the message to pass through\n // *This block will be removed in production builds*\n\n const provided = typeof message === 'function' ? message() : message;\n\n // Options:\n // 1. message provided: `${prefix}: ${provided}`\n // 2. message not provided: prefix\n const value = provided ? `${prefix}: ${provided}` : prefix;\n throw new Error(value);\n}\n\n/**\n * An error that happens during resolution of WGSL code.\n * Contains a trace of all ancestor resolvables in\n * which this error originated.\n *\n * @category Errors\n */\nexport class ResolutionError extends Error {\n constructor(\n public readonly cause: unknown,\n public readonly trace: unknown[],\n ) {\n let entries = trace.map((ancestor) => `- ${ancestor}`);\n\n // Showing only the root and leaf nodes.\n if (entries.length > 20) {\n entries = [...entries.slice(0, 11), '...', ...entries.slice(-10)];\n }\n\n super(`Resolution of the following tree failed: \\n${entries.join('\\n')}`);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ResolutionError.prototype);\n }\n\n appendToTrace(ancestor: unknown): ResolutionError {\n const newTrace = [ancestor, ...this.trace];\n\n return new ResolutionError(this.cause, newTrace);\n }\n}\n\n/**\n * @category Errors\n */\nexport class MissingSlotValueError extends Error {\n constructor(public readonly slot: TgpuSlot<unknown>) {\n super(`Missing value for '${slot}'`);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingSlotValueError.prototype);\n }\n}\n\n/**\n * @category Errors\n */\nexport class NotUniformError extends Error {\n constructor(value: TgpuBuffer<AnyData>) {\n super(\n `Buffer '${value.label ?? '<unnamed>'}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, NotUniformError.prototype);\n }\n}\n\nexport class MissingLinksError extends Error {\n constructor(fnLabel: string | undefined, externalNames: string[]) {\n super(\n `The function '${fnLabel ?? '<unnamed>'}' is missing links to the following external values: ${externalNames}.`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingLinksError.prototype);\n }\n}\n\nexport class MissingBindGroupError extends Error {\n constructor(layoutLabel: string | undefined) {\n super(\n `Bind group was not provided for '${layoutLabel ?? '<unnamed>'}' layout.`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingBindGroupError.prototype);\n }\n}\n","import { invariant } from './errors';\nimport type { ResolutionCtx } from './types';\n\nlet resolutionCtx: ResolutionCtx | null = null;\n\nexport function provideCtx<T>(ctx: ResolutionCtx, callback: () => T): T {\n invariant(resolutionCtx === null, 'Cannot nest context providers');\n\n resolutionCtx = ctx;\n try {\n return callback();\n } finally {\n resolutionCtx = null;\n }\n}\n\nexport function getResolutionCtx(): ResolutionCtx | null {\n return resolutionCtx;\n}\n\nexport const inGPUMode = () => resolutionCtx !== null;\n","import type { Infer, InferRecord } from '../shared/repr';\nimport type { TgpuResolvable } from '../types';\n\nexport interface NumberArrayView {\n readonly length: number;\n [n: number]: number;\n}\n\nexport interface BaseWgslData {\n type: string;\n /** Type-token, not available at runtime */\n readonly '~repr': unknown;\n}\n\n// #region Instance Types\n\ninterface Swizzle2<T2, T3, T4> {\n readonly xx: T2;\n readonly xy: T2;\n readonly yx: T2;\n readonly yy: T2;\n\n readonly xxx: T3;\n readonly xxy: T3;\n readonly xyx: T3;\n readonly xyy: T3;\n readonly yxx: T3;\n readonly yxy: T3;\n readonly yyx: T3;\n readonly yyy: T3;\n\n readonly xxxx: T4;\n readonly xxxy: T4;\n readonly xxyx: T4;\n readonly xxyy: T4;\n readonly xyxx: T4;\n readonly xyxy: T4;\n readonly xyyx: T4;\n readonly xyyy: T4;\n readonly yxxx: T4;\n readonly yxxy: T4;\n readonly yxyx: T4;\n readonly yxyy: T4;\n readonly yyxx: T4;\n readonly yyxy: T4;\n readonly yyyx: T4;\n readonly yyyy: T4;\n}\n\ninterface Swizzle3<T2, T3, T4> extends Swizzle2<T2, T3, T4> {\n readonly xz: T2;\n readonly yz: T2;\n readonly zx: T2;\n readonly zy: T2;\n readonly zz: T2;\n\n readonly xxz: T3;\n readonly xyz: T3;\n readonly xzx: T3;\n readonly xzy: T3;\n readonly xzz: T3;\n readonly yxz: T3;\n readonly yyz: T3;\n readonly yzx: T3;\n readonly yzy: T3;\n readonly yzz: T3;\n readonly zxx: T3;\n readonly zxy: T3;\n readonly zxz: T3;\n readonly zyx: T3;\n readonly zyy: T3;\n readonly zyz: T3;\n readonly zzx: T3;\n readonly zzy: T3;\n readonly zzz: T3;\n\n readonly xxxz: T4;\n readonly xxyz: T4;\n readonly xxzx: T4;\n readonly xxzy: T4;\n readonly xxzz: T4;\n readonly xyxz: T4;\n readonly xyyz: T4;\n readonly xyzx: T4;\n readonly xyzy: T4;\n readonly xyzz: T4;\n readonly xzxx: T4;\n readonly xzxy: T4;\n readonly xzxz: T4;\n readonly xzyx: T4;\n readonly xzyy: T4;\n readonly xzyz: T4;\n readonly xzzx: T4;\n readonly xzzy: T4;\n readonly xzzz: T4;\n readonly yxxz: T4;\n readonly yxyz: T4;\n readonly yxzx: T4;\n readonly yxzy: T4;\n readonly yxzz: T4;\n readonly yyxz: T4;\n readonly yyyz: T4;\n readonly yyzx: T4;\n readonly yyzy: T4;\n readonly yyzz: T4;\n readonly yzxx: T4;\n readonly yzxy: T4;\n readonly yzxz: T4;\n readonly yzyx: T4;\n readonly yzyy: T4;\n readonly yzyz: T4;\n readonly yzzx: T4;\n readonly yzzy: T4;\n readonly yzzz: T4;\n readonly zxxx: T4;\n readonly zxxy: T4;\n readonly zxxz: T4;\n readonly zxyx: T4;\n readonly zxyy: T4;\n readonly zxyz: T4;\n readonly zxzx: T4;\n readonly zxzy: T4;\n readonly zxzz: T4;\n readonly zyxx: T4;\n readonly zyxy: T4;\n readonly zyxz: T4;\n readonly zyyx: T4;\n readonly zyyy: T4;\n readonly zyyz: T4;\n readonly zyzx: T4;\n readonly zyzy: T4;\n readonly zyzz: T4;\n readonly zzxx: T4;\n readonly zzxy: T4;\n readonly zzxz: T4;\n readonly zzyx: T4;\n readonly zzyy: T4;\n readonly zzyz: T4;\n readonly zzzx: T4;\n readonly zzzy: T4;\n readonly zzzz: T4;\n}\n\ninterface Swizzle4<T2, T3, T4> extends Swizzle3<T2, T3, T4> {\n readonly yw: T2;\n readonly zw: T2;\n readonly wx: T2;\n readonly wy: T2;\n readonly wz: T2;\n readonly ww: T2;\n\n readonly xxw: T3;\n readonly xyw: T3;\n readonly xzw: T3;\n readonly xwx: T3;\n readonly xwy: T3;\n readonly xwz: T3;\n readonly xww: T3;\n readonly yxw: T3;\n readonly yyw: T3;\n readonly yzw: T3;\n readonly ywx: T3;\n readonly ywy: T3;\n readonly ywz: T3;\n readonly yww: T3;\n readonly zxw: T3;\n readonly zyw: T3;\n readonly zzw: T3;\n readonly zwx: T3;\n readonly zwy: T3;\n readonly zwz: T3;\n readonly zww: T3;\n readonly wxx: T3;\n readonly wxz: T3;\n readonly wxy: T3;\n readonly wyy: T3;\n readonly wyz: T3;\n readonly wzz: T3;\n readonly wwx: T3;\n readonly wwy: T3;\n readonly wwz: T3;\n readonly www: T3;\n\n readonly xxxw: T4;\n readonly xxyw: T4;\n readonly xxzw: T4;\n readonly xxwx: T4;\n readonly xxwy: T4;\n readonly xxwz: T4;\n readonly xxww: T4;\n readonly xyxw: T4;\n readonly xyyw: T4;\n readonly xyzw: T4;\n readonly xywx: T4;\n readonly xywy: T4;\n readonly xywz: T4;\n readonly xyww: T4;\n readonly xzxw: T4;\n readonly xzyw: T4;\n readonly xzzw: T4;\n readonly xzwx: T4;\n readonly xzwy: T4;\n readonly xzwz: T4;\n readonly xzww: T4;\n readonly xwxx: T4;\n readonly xwxy: T4;\n readonly xwxz: T4;\n readonly xwyy: T4;\n readonly xwyz: T4;\n readonly xwzz: T4;\n readonly xwwx: T4;\n readonly xwwy: T4;\n readonly xwwz: T4;\n readonly xwww: T4;\n readonly yxxw: T4;\n readonly yxyw: T4;\n readonly yxzw: T4;\n readonly yxwx: T4;\n readonly yxwy: T4;\n readonly yxwz: T4;\n readonly yxww: T4;\n readonly yyxw: T4;\n readonly yyyw: T4;\n readonly yyzw: T4;\n readonly yywx: T4;\n readonly yywy: T4;\n readonly yywz: T4;\n readonly yyww: T4;\n readonly yzxw: T4;\n readonly yzyw: T4;\n readonly yzzw: T4;\n readonly yzwx: T4;\n readonly yzwy: T4;\n readonly yzwz: T4;\n readonly yzww: T4;\n readonly ywxx: T4;\n readonly ywxy: T4;\n readonly ywxz: T4;\n readonly ywxw: T4;\n readonly ywyy: T4;\n readonly ywyz: T4;\n readonly ywzz: T4;\n readonly ywwx: T4;\n readonly ywwy: T4;\n readonly ywwz: T4;\n readonly ywww: T4;\n readonly zxxw: T4;\n readonly zxyw: T4;\n readonly zxzw: T4;\n readonly zxwx: T4;\n readonly zxwy: T4;\n readonly zxwz: T4;\n readonly zxww: T4;\n readonly zyxw: T4;\n readonly zyyw: T4;\n readonly zyzw: T4;\n readonly zywx: T4;\n readonly zywy: T4;\n readonly zywz: T4;\n readonly zyww: T4;\n readonly zzxw: T4;\n readonly zzyw: T4;\n readonly zzzw: T4;\n readonly zzwx: T4;\n readonly zzwy: T4;\n readonly zzwz: T4;\n readonly zzww: T4;\n readonly zwxx: T4;\n readonly zwxy: T4;\n readonly zwxz: T4;\n readonly zwxw: T4;\n readonly zwyy: T4;\n readonly zwyz: T4;\n readonly zwzz: T4;\n readonly zwwx: T4;\n readonly zwwy: T4;\n readonly zwwz: T4;\n readonly zwww: T4;\n readonly wxxx: T4;\n readonly wxxy: T4;\n readonly wxxz: T4;\n readonly wxxw: T4;\n readonly wxyx: T4;\n readonly wxyy: T4;\n readonly wxyz: T4;\n readonly wxyw: T4;\n readonly wxzx: T4;\n readonly wxzy: T4;\n readonly wxzz: T4;\n readonly wxzw: T4;\n readonly wxwx: T4;\n readonly wxwy: T4;\n readonly wxwz: T4;\n readonly wxww: T4;\n readonly wyxx: T4;\n readonly wyxy: T4;\n readonly wyxz: T4;\n readonly wyxw: T4;\n readonly wyyy: T4;\n readonly wyyz: T4;\n readonly wyzw: T4;\n readonly wywx: T4;\n readonly wywy: T4;\n readonly wywz: T4;\n readonly wyww: T4;\n readonly wzxx: T4;\n readonly wzxy: T4;\n readonly wzxz: T4;\n readonly wzxw: T4;\n readonly wzyy: T4;\n readonly wzyz: T4;\n readonly wzzy: T4;\n readonly wzzw: T4;\n readonly wzwx: T4;\n readonly wzwy: T4;\n readonly wzwz: T4;\n readonly wzww: T4;\n readonly wwxx: T4;\n readonly wwxy: T4;\n readonly wwxz: T4;\n readonly wwxw: T4;\n readonly wwyy: T4;\n readonly wwyz: T4;\n readonly wwzz: T4;\n readonly wwwx: T4;\n readonly wwwy: T4;\n readonly wwwz: T4;\n readonly wwww: T4;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2f or vec2<f32>.\n * A vector with 2 elements of type f32\n */\nexport interface v2f\n extends NumberArrayView,\n Swizzle2<v2f, v3f, v4f>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2f';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2h or vec2<f16>.\n * A vector with 2 elements of type f16\n */\nexport interface v2h\n extends NumberArrayView,\n Swizzle2<v2h, v3h, v4h>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2h';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2i or vec2<i32>.\n * A vector with 2 elements of type i32\n */\nexport interface v2i\n extends NumberArrayView,\n Swizzle2<v2i, v3i, v4i>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2i';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec2u or vec2<u32>.\n * A vector with 2 elements of type u32\n */\nexport interface v2u\n extends NumberArrayView,\n Swizzle2<v2u, v3u, v4u>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec2u';\n x: number;\n y: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3f or vec3<f32>.\n * A vector with 3 elements of type f32\n */\nexport interface v3f\n extends NumberArrayView,\n Swizzle3<v2f, v3f, v4f>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3f';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3h or vec3<f16>.\n * A vector with 3 elements of type f16\n */\nexport interface v3h\n extends NumberArrayView,\n Swizzle3<v2h, v3h, v4h>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3h';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3i or vec3<i32>.\n * A vector with 3 elements of type i32\n */\nexport interface v3i\n extends NumberArrayView,\n Swizzle3<v2i, v3i, v4i>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3i';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec3u or vec3<u32>.\n * A vector with 3 elements of type u32\n */\nexport interface v3u\n extends NumberArrayView,\n Swizzle3<v2u, v3u, v4u>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec3u';\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4f or vec4<f32>.\n * A vector with 4 elements of type f32\n */\nexport interface v4f\n extends NumberArrayView,\n Swizzle4<v2f, v3f, v4f>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4f';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4h or vec4<f16>.\n * A vector with 4 elements of type f16\n */\nexport interface v4h\n extends NumberArrayView,\n Swizzle4<v2h, v3h, v4h>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4h';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4i or vec4<i32>.\n * A vector with 4 elements of type i32\n */\nexport interface v4i\n extends NumberArrayView,\n Swizzle4<v2i, v3i, v4i>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4i';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\n/**\n * Interface representing its WGSL vector type counterpart: vec4u or vec4<u32>.\n * A vector with 4 elements of type u32\n */\nexport interface v4u\n extends NumberArrayView,\n Swizzle4<v2u, v3u, v4u>,\n TgpuResolvable {\n /** use to distinguish between vectors of the same size on the type level */\n readonly kind: 'vec4u';\n x: number;\n y: number;\n z: number;\n w: number;\n}\n\nexport interface matBase<TColumn> extends NumberArrayView {\n readonly columns: readonly TColumn[];\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat2x2\n * A matrix with 2 rows and 2 columns, with elements of type `TColumn`\n */\nexport interface mat2x2<TColumn> extends matBase<TColumn> {\n readonly length: 4;\n [n: number]: number;\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat2x2f or mat2x2<f32>\n * A matrix with 2 rows and 2 columns, with elements of type d.f32\n */\nexport interface m2x2f extends mat2x2<v2f> {\n readonly kind: 'mat2x2f';\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat3x3\n * A matrix with 3 rows and 3 columns, with elements of type `TColumn`\n */\nexport interface mat3x3<TColumn> extends matBase<TColumn> {\n readonly length: 12;\n [n: number]: number;\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat3x3f or mat3x3<f32>\n * A matrix with 3 rows and 3 columns, with elements of type d.f32\n */\nexport interface m3x3f extends mat3x3<v3f> {\n readonly kind: 'mat3x3f';\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat4x4\n * A matrix with 4 rows and 4 columns, with elements of type `TColumn`\n */\nexport interface mat4x4<TColumn> extends matBase<TColumn> {\n readonly length: 16;\n [n: number]: number;\n}\n\n/**\n * Interface representing its WGSL matrix type counterpart: mat4x4f or mat4x4<f32>\n * A matrix with 4 rows and 4 columns, with elements of type d.f32\n */\nexport interface m4x4f extends mat4x4<v4f> {\n readonly kind: 'mat4x4f';\n}\n\n// #endregion\n\n// #region WGSL Schema Types\n\n/**\n * Boolean schema representing a single WGSL bool value.\n * Cannot be used inside buffers as it is not host-shareable.\n */\nexport interface Bool {\n readonly type: 'bool';\n readonly '~repr': boolean;\n}\n\nexport interface F32 {\n readonly type: 'f32';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n}\n\nexport interface F16 {\n readonly type: 'f16';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n}\n\nexport interface I32 {\n readonly type: 'i32';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n}\n\nexport interface U32 {\n readonly type: 'u32';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n}\n\nexport interface Vec2f {\n readonly type: 'vec2f';\n /** Type-token, not available at runtime */\n readonly '~repr': v2f;\n}\n\nexport interface Vec2h {\n readonly type: 'vec2h';\n /** Type-token, not available at runtime */\n readonly '~repr': v2h;\n}\n\nexport interface Vec2i {\n readonly type: 'vec2i';\n /** Type-token, not available at runtime */\n readonly '~repr': v2i;\n}\n\nexport interface Vec2u {\n readonly type: 'vec2u';\n /** Type-token, not available at runtime */\n readonly '~repr': v2u;\n}\n\nexport interface Vec3f {\n readonly type: 'vec3f';\n /** Type-token, not available at runtime */\n readonly '~repr': v3f;\n}\n\nexport interface Vec3h {\n readonly type: 'vec3h';\n /** Type-token, not available at runtime */\n readonly '~repr': v3h;\n}\n\nexport interface Vec3i {\n readonly type: 'vec3i';\n /** Type-token, not available at runtime */\n readonly '~repr': v3i;\n}\n\nexport interface Vec3u {\n readonly type: 'vec3u';\n /** Type-token, not available at runtime */\n readonly '~repr': v3u;\n}\n\nexport interface Vec4f {\n readonly type: 'vec4f';\n /** Type-token, not available at runtime */\n readonly '~repr': v4f;\n}\n\nexport interface Vec4h {\n readonly type: 'vec4h';\n /** Type-token, not available at runtime */\n readonly '~repr': v4h;\n}\n\nexport interface Vec4i {\n readonly type: 'vec4i';\n /** Type-token, not available at runtime */\n readonly '~repr': v4i;\n}\n\nexport interface Vec4u {\n readonly type: 'vec4u';\n /** Type-token, not available at runtime */\n readonly '~repr': v4u;\n}\n\nexport interface Mat2x2f {\n readonly type: 'mat2x2f';\n /** Type-token, not available at runtime */\n readonly '~repr': m2x2f;\n}\n\nexport interface Mat3x3f {\n readonly type: 'mat3x3f';\n /** Type-token, not available at runtime */\n readonly '~repr': m3x3f;\n}\n\nexport interface Mat4x4f {\n readonly type: 'mat4x4f';\n /** Type-token, not available at runtime */\n readonly '~repr': m4x4f;\n}\n\nexport interface WgslStruct<\n TProps extends Record<string, BaseWgslData> = Record<string, BaseWgslData>,\n> {\n readonly type: 'struct';\n readonly label?: string | undefined;\n readonly propTypes: TProps;\n /** Type-token, not available at runtime */\n readonly '~repr': InferRecord<TProps>;\n}\n\nexport interface WgslArray<TElement = BaseWgslData> {\n readonly type: 'array';\n readonly elementCount: number;\n readonly elementType: TElement;\n /** Type-token, not available at runtime */\n readonly '~repr': Infer<TElement>[];\n}\n\n/**\n * Schema representing the `atomic<...>` WGSL data type.\n */\nexport interface Atomic<TInner extends U32 | I32 = U32 | I32> {\n readonly type: 'atomic';\n readonly inner: TInner;\n /** Type-token, not available at runtime */\n readonly '~repr': Infer<TInner>;\n}\n\nexport interface Align<T extends number> {\n readonly type: '@align';\n readonly value: T;\n}\n\nexport interface Size<T extends number> {\n readonly type: '@size';\n readonly value: T;\n}\n\nexport interface Location<T extends number> {\n readonly type: '@location';\n readonly value: T;\n}\n\nexport interface Builtin<T extends string> {\n readonly type: '@builtin';\n readonly value: T;\n}\n\nexport interface Decorated<\n TInner extends BaseWgslData = BaseWgslData,\n TAttribs extends unknown[] = unknown[],\n> {\n readonly type: 'decorated';\n readonly inner: TInner;\n readonly attribs: TAttribs;\n /** Type-token, not available at runtime */\n readonly '~repr': Infer<TInner>;\n}\n\nexport const wgslTypeLiterals = [\n 'bool',\n 'f32',\n 'f16',\n 'i32',\n 'u32',\n 'vec2f',\n 'vec2h',\n 'vec2i',\n 'vec2u',\n 'vec3f',\n 'vec3h',\n 'vec3i',\n 'vec3u',\n 'vec4f',\n 'vec4h',\n 'vec4i',\n 'vec4u',\n 'mat2x2f',\n 'mat3x3f',\n 'mat4x4f',\n 'struct',\n 'array',\n 'atomic',\n 'decorated',\n] as const;\n\nexport type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];\n\nexport type AnyWgslData =\n | Bool\n | F32\n | F16\n | I32\n | U32\n | Vec2f\n | Vec2h\n | Vec2i\n | Vec2u\n | Vec3f\n | Vec3h\n | Vec3i\n | Vec3u\n | Vec4f\n | Vec4h\n | Vec4i\n | Vec4u\n | Mat2x2f\n | Mat3x3f\n | Mat4x4f\n | WgslStruct\n | WgslArray\n | Atomic\n | Decorated;\n\n// #endregion\n\nexport function isWgslData(value: unknown): value is AnyWgslData {\n return wgslTypeLiterals.includes((value as AnyWgslData)?.type);\n}\n\n/**\n * Checks whether passed in value is an array schema,\n * as opposed to, e.g., a disarray schema.\n *\n * Array schemas can be used to describe uniform and storage buffers,\n * whereas disarray schemas cannot.\n *\n * @example\n * isWgslArray(d.arrayOf(d.u32, 4)) // true\n * isWgslArray(d.disarray(d.u32, 4)) // false\n * isWgslArray(d.vec3f) // false\n */\nexport function isWgslArray<T extends WgslArray>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.type === 'array';\n}\n\n/**\n * Checks whether passed in value is a struct schema,\n * as opposed to, e.g., an unstruct schema.\n *\n * Struct schemas can be used to describe uniform and storage buffers,\n * whereas unstruct schemas cannot.\n *\n * @example\n * isWgslStruct(d.struct({ a: d.u32 })) // true\n * isWgslStruct(d.unstruct({ a: d.u32 })) // false\n * isWgslStruct(d.vec3f) // false\n */\nexport function isWgslStruct<T extends WgslStruct>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.type === 'struct';\n}\n\n/**\n * Checks whether the passed in value is an atomic schema.\n *\n * @example\n * isAtomic(d.atomic(d.u32)) // true\n * isAtomic(d.u32) // false\n */\nexport function isAtomic<T extends Atomic<U32 | I32>>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.type === 'atomic';\n}\n\nexport function isAlignAttrib<T extends Align<number>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.type === '@align';\n}\n\nexport function isSizeAttrib<T extends Size<number>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.type === '@size';\n}\n\nexport function isLocationAttrib<T extends Location<number>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.type === '@location';\n}\n\nexport function isBuiltinAttrib<T extends Builtin<string>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.type === '@builtin';\n}\n\nexport function isDecorated<T extends Decorated>(\n value: unknown | T,\n): value is T {\n return (value as T)?.type === 'decorated';\n}\n","import type { TgpuNamable } from '../namable';\nimport type { InferRecord } from '../shared/repr';\nimport type { Prettify } from '../shared/utilityTypes';\nimport type { ExoticRecord } from './exotic';\nimport type { AnyWgslData, BaseWgslData, WgslStruct } from './wgslTypes';\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Struct schema constructed via `d.struct` function.\n *\n * Responsible for handling reading and writing struct values\n * between binary and JS representation. Takes into account\n * the `byteAlignment` requirement of its members.\n */\nexport interface TgpuStruct<TProps extends Record<string, BaseWgslData>>\n extends WgslStruct<TProps>,\n TgpuNamable {\n readonly '~exotic': WgslStruct<ExoticRecord<TProps>>;\n}\n\n/**\n * Creates a struct schema that can be used to construct GPU buffers.\n * Ensures proper alignment and padding of properties (as opposed to a `d.unstruct` schema).\n * The order of members matches the passed in properties object.\n *\n * @example\n * const CircleStruct = d.struct({ radius: d.f32, pos: d.vec3f });\n *\n * @param props Record with `string` keys and `TgpuData` values,\n * each entry describing one struct member.\n */\nexport const struct = <TProps extends Record<string, AnyWgslData>>(\n props: TProps,\n): TgpuStruct<Prettify<ExoticRecord<TProps>>> =>\n new TgpuStructImpl(props as ExoticRecord<TProps>);\n\n// --------------\n// Implementation\n// --------------\n\nclass TgpuStructImpl<TProps extends Record<string, AnyWgslData>>\n implements TgpuStruct<TProps>\n{\n private _label: string | undefined;\n\n public readonly type = 'struct';\n /** Type-token, not available at runtime */\n public readonly '~repr'!: InferRecord<TProps>;\n /** Type-token, not available at runtime */\n public readonly '~exotic'!: WgslStruct<ExoticRecord<TProps>>;\n\n constructor(public readonly propTypes: TProps) {}\n\n get label() {\n return this._label;\n }\n\n $name(label: string) {\n this._label = label;\n return this;\n }\n\n toString() {\n return `struct:${this.label ?? '<unnamed>'}`;\n }\n}\n","/**\n * @param value\n * @param modulo has to be power of 2\n */\nexport const roundUp = (value: number, modulo: number) => {\n const bitMask = modulo - 1;\n const invBitMask = ~bitMask;\n return (value & bitMask) === 0 ? value : (value & invBitMask) + modulo;\n};\n","export const vertexFormats = [\n 'uint8',\n 'uint8x2',\n 'uint8x4',\n 'sint8',\n 'sint8x2',\n 'sint8x4',\n 'unorm8',\n 'unorm8x2',\n 'unorm8x4',\n 'snorm8',\n 'snorm8x2',\n 'snorm8x4',\n 'uint16',\n 'uint16x2',\n 'uint16x4',\n 'sint16',\n 'sint16x2',\n 'sint16x4',\n 'unorm16',\n 'unorm16x2',\n 'unorm16x4',\n 'snorm16',\n 'snorm16x2',\n 'snorm16x4',\n 'float16',\n 'float16x2',\n 'float16x4',\n 'float32',\n 'float32x2',\n 'float32x3',\n 'float32x4',\n 'uint32',\n 'uint32x2',\n 'uint32x3',\n 'uint32x4',\n 'sint32',\n 'sint32x2',\n 'sint32x3',\n 'sint32x4',\n 'unorm10-10-10-2',\n 'unorm8x4-bgra',\n] as const;\n\nexport type VertexFormat = (typeof vertexFormats)[number];\n\nexport const kindToDefaultFormatMap = {\n f32: 'float32',\n vec2f: 'float32x2',\n vec3f: 'float32x3',\n vec4f: 'float32x4',\n f16: 'float16',\n vec2h: 'float16x2',\n // vec3h has no direct equivalent in the spec\n vec4h: 'float16x4',\n u32: 'uint32',\n vec2u: 'uint32x2',\n vec3u: 'uint32x3',\n vec4u: 'uint32x4',\n i32: 'sint32',\n vec2i: 'sint32x2',\n vec3i: 'sint32x3',\n vec4i: 'sint32x4',\n} as const;\n\nexport type KindToDefaultFormatMap = typeof kindToDefaultFormatMap;\n\nexport interface TgpuVertexAttrib<TFormat extends VertexFormat = VertexFormat> {\n readonly format: TFormat;\n readonly offset: number;\n}\n\nexport type AnyVertexAttribs =\n | Record<string, TgpuVertexAttrib>\n | TgpuVertexAttrib;\n\n/**\n * All vertex attribute formats that can be interpreted as\n * an single or multi component u32 in a shader.\n * https://www.w3.org/TR/webgpu/#vertex-formats\n */\ntype U32CompatibleFormats =\n | TgpuVertexAttrib<'uint8'>\n | TgpuVertexAttrib<'uint8x2'>\n | TgpuVertexAttrib<'uint8x4'>\n | TgpuVertexAttrib<'uint16'>\n | TgpuVertexAttrib<'uint16x2'>\n | TgpuVertexAttrib<'uint16x4'>\n | TgpuVertexAttrib<'uint32'>\n | TgpuVertexAttrib<'uint32x2'>\n | TgpuVertexAttrib<'uint32x3'>\n | TgpuVertexAttrib<'uint32x4'>;\n\n/**\n * All vertex attribute formats that can be interpreted as\n * an single or multi component i32 in a shader.\n * https://www.w3.org/TR/webgpu/#vertex-formats\n */\ntype I32CompatibleFormats =\n | TgpuVertexAttrib<'sint8'>\n | TgpuVertexAttrib<'sint8x2'>\n | TgpuVertexAttrib<'sint8x4'>\n | TgpuVertexAttrib<'sint16'>\n | TgpuVertexAttrib<'sint16x2'>\n | TgpuVertexAttrib<'sint16x4'>\n | TgpuVertexAttrib<'sint32'>\n | TgpuVertexAttrib<'sint32x2'>\n | TgpuVertexAttrib<'sint32x3'>\n | TgpuVertexAttrib<'sint32x4'>;\n\n/**\n * All vertex attribute formats that can be interpreted as\n * an single or multi component f32 in a shader.\n * https://www.w3.org/TR/webgpu/#vertex-formats\n */\ntype F32CompatibleFormats =\n | TgpuVertexAttrib<'unorm8'>\n | TgpuVertexAttrib<'unorm8x2'>\n | TgpuVertexAttrib<'unorm8x4'>\n | TgpuVertexAttrib<'snorm8'>\n | TgpuVertexAttrib<'snorm8x2'>\n | TgpuVertexAttrib<'snorm8x4'>\n | TgpuVertexAttrib<'unorm16'>\n | TgpuVertexAttrib<'unorm16x2'>\n | TgpuVertexAttrib<'unorm16x4'>\n | TgpuVertexAttrib<'snorm16'>\n | TgpuVertexAttrib<'snorm16x2'>\n | TgpuVertexAttrib<'snorm16x4'>\n | TgpuVertexAttrib<'float16'>\n | TgpuVertexAttrib<'float16x2'>\n | TgpuVertexAttrib<'float16x4'>\n | TgpuVertexAttrib<'float32'>\n | TgpuVertexAttrib<'float32x2'>\n | TgpuVertexAttrib<'float32x3'>\n | TgpuVertexAttrib<'float32x4'>\n | TgpuVertexAttrib<'unorm10-10-10-2'>\n | TgpuVertexAttrib<'unorm8x4-bgra'>;\n\n/**\n * All vertex attribute formats that can be interpreted as\n * a single or multi component f16 in a shader. (same as f32 on the shader side)\n * https://www.w3.org/TR/webgpu/#vertex-formats\n */\ntype F16CompatibleFormats = F32CompatibleFormats;\n\nexport type KindToAcceptedAttribMap = {\n u32: U32CompatibleFormats;\n vec2u: U32CompatibleFormats;\n vec3u: U32CompatibleFormats;\n vec4u: U32CompatibleFormats;\n\n i32: I32CompatibleFormats;\n vec2i: I32CompatibleFormats;\n vec3i: I32CompatibleFormats;\n vec4i: I32CompatibleFormats;\n\n f16: F16CompatibleFormats;\n vec2h: F16CompatibleFormats;\n vec3h: F16CompatibleFormats;\n vec4h: F16CompatibleFormats;\n\n f32: F32CompatibleFormats;\n vec2f: F32CompatibleFormats;\n vec3f: F32CompatibleFormats;\n vec4f: F32CompatibleFormats;\n};\n","import type { Infer, InferRecord } from '../shared/repr';\nimport { vertexFormats } from '../shared/vertexFormat';\nimport type { PackedData } from './vertexFormatData';\nimport * as wgsl from './wgslTypes';\n\n/**\n * Array schema constructed via `d.disarrayOf` function.\n *\n * Useful for defining vertex buffers.\n * Elements in the schema are not aligned in respect to their `byteAlignment`,\n * unless they are explicitly decorated with the custom align attribute\n * via `d.align` function.\n */\nexport interface Disarray<\n TElement extends wgsl.BaseWgslData = wgsl.BaseWgslData,\n> {\n readonly type: 'disarray';\n readonly elementCount: number;\n readonly elementType: TElement;\n readonly '~repr': Infer<TElement>[];\n}\n\n/**\n * Struct schema constructed via `d.unstruct` function.\n *\n * Useful for defining vertex buffers, as the standard layout restrictions do not apply.\n * Members are not aligned in respect to their `byteAlignment`,\n * unless they are explicitly decorated with the custom align attribute\n * via `d.align` function.\n */\nexport interface Unstruct<\n TProps extends Record<string, wgsl.BaseWgslData> = Record<\n string,\n wgsl.BaseWgslData\n >,\n> {\n readonly type: 'unstruct';\n readonly propTypes: TProps;\n readonly '~repr': InferRecord<TProps>;\n}\n\nexport interface LooseDecorated<\n TInner extends wgsl.BaseWgslData = wgsl.BaseWgslData,\n TAttribs extends unknown[] = unknown[],\n> {\n readonly type: 'loose-decorated';\n readonly inner: TInner;\n readonly attribs: TAttribs;\n readonly '~repr': Infer<TInner>;\n}\n\nconst looseTypeLiterals = [\n 'unstruct',\n 'disarray',\n 'loose-decorated',\n ...vertexFormats,\n] as const;\n\nexport type LooseTypeLiteral = (typeof looseTypeLiterals)[number];\n\nexport type AnyLooseData = Disarray | Unstruct | LooseDecorated | PackedData;\n\nexport function isLooseData(data: unknown): data is AnyLooseData {\n return looseTypeLiterals.includes((data as AnyLooseData)?.type);\n}\n\n/**\n * Checks whether the passed in value is a disarray schema,\n * as opposed to, e.g., a regular array schema.\n *\n * Array schemas can be used to describe uniform and storage buffers,\n * whereas disarray schemas cannot. Disarrays are useful for\n * defining vertex buffers instead.\n *\n * @example\n * isDisarray(d.arrayOf(d.u32, 4)) // false\n * isDisarray(d.disarrayOf(d.u32, 4)) // true\n * isDisarray(d.vec3f) // false\n */\nexport function isDisarray<T extends Disarray>(\n schema: T | unknown,\n): schema is T {\n return (schema as Disarray)?.type === 'disarray';\n}\n\n/**\n * Checks whether passed in value is a unstruct schema,\n * as opposed to, e.g., a struct schema.\n *\n * Struct schemas can be used to describe uniform and storage buffers,\n * whereas unstruct schemas cannot. Unstructs are useful for\n * defining vertex buffers instead.\n *\n * @example\n * isUnstruct(d.struct({ a: d.u32 })) // false\n * isUnstruct(d.unstruct({ a: d.u32 })) // true\n * isUnstruct(d.vec3f) // false\n */\nexport function isUnstruct<T extends Unstruct>(\n schema: T | unknown,\n): schema is T {\n return (schema as T)?.type === 'unstruct';\n}\n\nexport function isLooseDecorated<T extends LooseDecorated>(\n value: T | unknown,\n): value is T {\n return (value as T)?.type === 'loose-decorated';\n}\n\nexport function getCustomAlignment(\n data: wgsl.BaseWgslData,\n): number | undefined {\n return (data as unknown as wgsl.Decorated | LooseDecorated).attribs?.find(\n wgsl.isAlignAttrib,\n )?.value;\n}\n\nexport function getCustomSize(data: wgsl.BaseWgslData): number | undefined {\n return (data as unknown as wgsl.Decorated | LooseDecorated).attribs?.find(\n wgsl.isSizeAttrib,\n )?.value;\n}\n\nexport function getCustomLocation(data: wgsl.BaseWgslData): number | undefined {\n return (data as unknown as wgsl.Decorated | LooseDecorated).attribs?.find(\n wgsl.isLocationAttrib,\n )?.value;\n}\n\nexport function isData(value: unknown): value is AnyData {\n return wgsl.isWgslData(value) || isLooseData(value);\n}\n\nexport type AnyData = wgsl.AnyWgslData | AnyLooseData;\n","import { inGPUMode } from '../gpuMode';\nimport type {\n Vec2f,\n Vec2h,\n Vec2i,\n Vec2u,\n Vec3f,\n Vec3h,\n Vec3i,\n Vec3u,\n Vec4f,\n Vec4h,\n Vec4i,\n Vec4u,\n v2f,\n v2h,\n v2i,\n v2u,\n v3f,\n v3h,\n v3i,\n v3u,\n v4f,\n v4h,\n v4i,\n v4u,\n} from './wgslTypes';\n\n// --------------\n// Implementation\n// --------------\n\ninterface VecSchemaOptions<TType extends string, TValue> {\n type: TType;\n length: number;\n make: (...args: number[]) => TValue;\n makeFromScalar: (value: number) => TValue;\n}\n\ntype VecSchemaBase<TValue> = {\n readonly type: string;\n readonly '~repr': TValue;\n};\n\nfunction makeVecSchema<TType extends string, TValue>(\n options: VecSchemaOptions<TType, TValue>,\n): VecSchemaBase<TValue> & ((...args: number[]) => TValue) {\n const VecSchema: VecSchemaBase<TValue> = {\n /** Type-token, not available at runtime */\n '~repr': undefined as unknown as TValue,\n type: options.type,\n };\n\n const construct = (...args: number[]): TValue => {\n const values = args; // TODO: Allow users to pass in vectors that fill part of the values.\n\n if (inGPUMode()) {\n return `${VecSchema.type}(${values.join(', ')})` as unknown as TValue;\n }\n\n if (values.length <= 1) {\n return options.makeFromScalar(values[0] ?? 0);\n }\n\n if (values.length === options.length) {\n return options.make(...values);\n }\n\n throw new Error(\n `'${options.type}' constructor called with invalid number of arguments.`,\n );\n };\n\n return Object.assign(construct, VecSchema);\n}\n\nabstract class vec2Impl {\n public readonly length = 2;\n abstract readonly kind: `vec2${'f' | 'u' | 'i' | 'h'}`;\n\n [n: number]: number;\n\n constructor(\n public x: number,\n public y: number,\n ) {}\n\n *[Symbol.iterator]() {\n yield this.x;\n yield this.y;\n }\n\n get [0]() {\n return this.x;\n }\n\n get [1]() {\n return this.y;\n }\n\n set [0](value: number) {\n this.x = value;\n }\n\n set [1](value: number) {\n this.y = value;\n }\n\n resolve(): string {\n return `${this.kind}(${this.x}, ${this.y})`;\n }\n\n toString() {\n return this.resolve();\n }\n}\n\nclass vec2fImpl extends vec2Impl {\n readonly kind = 'vec2f';\n\n make2(x: number, y: number): v2f {\n return new vec2fImpl(x, y) as unknown as v2f;\n }\n\n make3(x: number, y: number, z: number): v3f {\n return new vec3fImpl(x, y, z) as unknown as v3f;\n }\n\n make4(x: number, y: number, z: number, w: number): v4f {\n return new vec4fImpl(x, y, z, w) as unknown as v4f;\n }\n}\n\nclass vec2hImpl extends vec2Impl {\n readonly kind = 'vec2h';\n\n make2(x: number, y: number): v2h {\n return new vec2hImpl(x, y) as unknown as v2h;\n }\n\n make3(x: number, y: number, z: number): v3h {\n return new vec3hImpl(x, y, z) as unknown as v3h;\n }\n\n make4(x: number, y: number, z: number, w: number): v4h {\n return new vec4hImpl(x, y, z, w) as unknown as v4h;\n }\n}\n\nclass vec2iImpl extends vec2Impl {\n readonly kind = 'vec2i';\n\n make2(x: number, y: number): v2i {\n return new vec2iImpl(x, y) as unknown as v2i;\n }\n\n make3(x: number, y: number, z: number): v3i {\n return new vec3iImpl(x, y, z) as unknown as v3i;\n }\n\n make4(x: number, y: number, z: number, w: number): v4i {\n return new vec4iImpl(x, y, z, w) as unknown as v4i;\n }\n}\n\nclass vec2uImpl extends vec2Impl {\n readonly kind = 'vec2u';\n\n make2(x: number, y: number): v2u {\n return new vec2uImpl(x, y) as unknown as v2u;\n }\n\n make3(x: number, y: number, z: number): v3u {\n return new vec3uImpl(x, y, z) as unknown as v3u;\n }\n\n make4(x: number, y: number, z: number, w: number): v4u {\n return new vec4uImpl(x, y, z, w) as unknown as v4u;\n }\n}\n\nabstract class vec3Impl {\n public readonly length = 3;\n abstract readonly kind: `vec3${'f' | 'u' | 'i' | 'h'}`;\n [n: number]: number;\n\n constructor(\n public x: number,\n public y: number,\n public z: number,\n ) {}\n\n *[Symbol.iterator]() {\n yield this.x;\n yield this.y;\n yield this.z;\n }\n\n get [0]() {\n return this.x;\n }\n\n get [1]() {\n return this.y;\n }\n\n get [2]() {\n return this.z;\n }\n\n set [0](value: number) {\n this.x = value;\n }\n\n set [1](value: number) {\n this.y = value;\n }\n\n set [2](value: number) {\n this.z = value;\n }\n\n resolve(): string {\n return `${this.kind}(${this.x}, ${this.y}, ${this.z})`;\n }\n\n toString() {\n return this.resolve();\n }\n}\n\nclass vec3fImpl extends vec3Impl {\n readonly kind = 'vec3f';\n\n make2(x: number, y: number): v2f {\n return new vec2fImpl(x, y) as unknown as v2f;\n }\n\n make3(x: number, y: number, z: number): v3f {\n return new vec3fImpl(x, y, z) as unknown as v3f;\n }\n\n make4(x: number, y: number, z: number, w: number): v4f {\n return new vec4fImpl(x, y, z, w) as unknown as v4f;\n }\n}\n\nclass vec3hImpl extends vec3Impl {\n readonly kind = 'vec3h';\n\n make2(x: number, y: number): v2h {\n return new vec2hImpl(x, y) as unknown as v2h;\n }\n\n make3(x: number, y: number, z: number): v3h {\n return new vec3hImpl(x, y, z) as unknown as v3h;\n }\n\n make4(x: number, y: number, z: number, w: number): v4h {\n return new vec4hImpl(x, y, z, w) as unknown as v4h;\n }\n}\n\nclass vec3iImpl extends vec3Impl {\n readonly kind = 'vec3i';\n\n make2(x: number, y: number): v2i {\n return new vec2iImpl(x, y) as unknown as v2i;\n }\n\n make3(x: number, y: number, z: number): v3i {\n return new vec3iImpl(x, y, z) as unknown as v3i;\n }\n\n make4(x: number, y: number, z: number, w: number): v4i {\n return new vec4iImpl(x, y, z, w) as unknown as v4i;\n }\n}\n\nclass vec3uImpl extends vec3Impl {\n readonly kind = 'vec3u';\n\n make2(x: number, y: number): v2u {\n return new vec2uImpl(x, y) as unknown as v2u;\n }\n\n make3(x: number, y: number, z: number): v3u {\n return new vec3uImpl(x, y, z) as unknown as v3u;\n }\n\n make4(x: number, y: number, z: number, w: number): v4u {\n return new vec4uImpl(x, y, z, w) as unknown as v4u;\n }\n}\n\nabstract class vec4Impl {\n public readonly length = 4;\n abstract readonly kind: `vec4${'f' | 'u' | 'i' | 'h'}`;\n [n: number]: number;\n\n constructor(\n public x: number,\n public y: number,\n public z: number,\n public w: number,\n ) {}\n\n *[Symbol.iterator]() {\n yield this.x;\n yield this.y;\n yield this.z;\n yield this.w;\n }\n\n get [0]() {\n return this.x;\n }\n\n get [1]() {\n return this.y;\n }\n\n get [2]() {\n return this.z;\n }\n\n get [3]() {\n return this.w;\n }\n\n set [0](value: number) {\n this.x = value;\n }\n\n set [1](value: number) {\n this.y = value;\n }\n\n set [2](value: number) {\n this.z = value;\n }\n\n set [3](value: number) {\n this.w = value;\n }\n\n resolve(): string {\n return `${this.kind}(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n }\n\n toString() {\n return this.resolve();\n }\n}\n\nclass vec4fImpl extends vec4Impl {\n readonly kind = 'vec4f';\n\n make2(x: number, y: number): v2f {\n return new vec2fImpl(x, y) as unknown as v2f;\n }\n\n make3(x: number, y: number, z: number): v3f {\n return new vec3fImpl(x, y, z) as unknown as v3f;\n }\n\n make4(x: number, y: number, z: number, w: number): v4f {\n return new vec4fImpl(x, y, z, w) as unknown as v4f;\n }\n}\n\nclass vec4hImpl extends vec4Impl {\n readonly kind = 'vec4h';\n\n make2(x: number, y: number): v2h {\n return new vec2hImpl(x, y) as unknown as v2h;\n }\n\n make3(x: number, y: number, z: number): v3h {\n return new vec3hImpl(x, y, z) as unknown as v3h;\n }\n\n make4(x: number, y: number, z: number, w: number): v4h {\n return new vec4hImpl(x, y, z, w) as unknown as v4h;\n }\n}\n\nclass vec4iImpl extends vec4Impl {\n readonly kind = 'vec4i';\n\n make2(x: number, y: number): v2i {\n return new vec2iImpl(x, y) as unknown as v2i;\n }\n\n make3(x: number, y: number, z: number): v3i {\n return new vec3iImpl(x, y, z) as unknown as v3i;\n }\n\n make4(x: number, y: number, z: number, w: number): v4i {\n return new vec4iImpl(x, y, z, w) as unknown as v4i;\n }\n}\n\nclass vec4uImpl extends vec4Impl {\n readonly kind = 'vec4u';\n\n make2(x: number, y: number): v2u {\n return new vec2uImpl(x, y) as unknown as v2u;\n }\n\n make3(x: number, y: number, z: number): v3u {\n return new vec3uImpl(x, y, z) as unknown as v3u;\n }\n\n make4(x: number, y: number, z: number, w: number): v4u {\n return new vec4uImpl(x, y, z, w) as unknown as v4u;\n }\n}\n\nconst vecProxyHandler: ProxyHandler<{ kind: VecKind }> = {\n get: (target, prop) => {\n if (typeof prop === 'symbol' || !Number.isNaN(Number.parseInt(prop))) {\n return Reflect.get(target, prop);\n }\n\n const targetAsVec4 = target as unknown as vec4uImpl;\n const values = new Array(prop.length) as number[];\n\n let idx = 0;\n for (const char of prop as string) {\n switch (char) {\n case 'x':\n values[idx] = targetAsVec4.x;\n break;\n case 'y':\n values[idx] = targetAsVec4.y;\n break;\n case 'z':\n values[idx] = targetAsVec4.z;\n break;\n case 'w':\n values[idx] = targetAsVec4.w;\n break;\n default:\n return Reflect.get(targetAsVec4, prop);\n }\n idx++;\n }\n\n if (prop.length === 4) {\n return new Proxy(\n targetAsVec4.make4(\n values[0] as number,\n values[1] as number,\n values[2] as number,\n values[3] as number,\n ),\n vecProxyHandler,\n );\n }\n\n if (prop.length === 3) {\n return new Proxy(\n targetAsVec4.make3(\n values[0] as number,\n values[1] as number,\n values[2] as number,\n ),\n vecProxyHandler,\n );\n }\n\n if (prop.length === 2) {\n return new Proxy(\n targetAsVec4.make2(values[0] as number, values[1] as number),\n vecProxyHandler,\n );\n }\n\n return Reflect.get(target, prop);\n },\n};\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Type encompassing all available kinds of vector.\n */\nexport type VecKind =\n | 'vec2f'\n | 'vec2i'\n | 'vec2u'\n | 'vec2h'\n | 'vec3f'\n | 'vec3i'\n | 'vec3u'\n | 'vec3h'\n | 'vec4f'\n | 'vec4i'\n | 'vec4u'\n | 'vec4h';\n\n/**\n * Type of the `d.vec2f` object/function: vector data type schema/constructor\n */\nexport type NativeVec2f = Vec2f & { '~exotic': Vec2f } & ((\n x: number,\n y: number,\n ) => v2f) &\n ((xy: number) => v2f) &\n (() => v2f);\n\n/**\n *\n * Schema representing vec2f - a vector with 2 elements of type f32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2f(); // (0.0, 0.0)\n * const vector = d.vec2f(1); // (1.0, 1.0)\n * const vector = d.vec2f(0.5, 0.1); // (0.5, 0.1)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2f, d.vec2f(0, 1)); // buffer holding a d.vec2f value, with an initial value of vec2f(0, 1);\n */\nexport const vec2f = makeVecSchema({\n type: 'vec2f',\n length: 2,\n make: (x: number, y: number) =>\n new Proxy(new vec2fImpl(x, y), vecProxyHandler) as v2f,\n makeFromScalar: (x) => new Proxy(new vec2fImpl(x, x), vecProxyHandler) as v2f,\n}) as NativeVec2f;\n\n/**\n * Type of the `d.vec2h` object/function: vector data type schema/constructor\n */\nexport type NativeVec2h = Vec2h & { '~exotic': Vec2h } & ((\n x: number,\n y: number,\n ) => v2h) &\n ((xy: number) => v2h) &\n (() => v2h);\n\n/**\n *\n * Schema representing vec2h - a vector with 2 elements of type f16.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2h(); // (0.0, 0.0)\n * const vector = d.vec2h(1); // (1.0, 1.0)\n * const vector = d.vec2h(0.5, 0.1); // (0.5, 0.1)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2h, d.vec2h(0, 1)); // buffer holding a d.vec2h value, with an initial value of vec2h(0, 1);\n */\nexport const vec2h = makeVecSchema({\n type: 'vec2h',\n length: 2,\n make: (x: number, y: number) =>\n new Proxy(new vec2hImpl(x, y), vecProxyHandler) as v2h,\n makeFromScalar: (x) => new Proxy(new vec2hImpl(x, x), vecProxyHandler) as v2h,\n}) as NativeVec2h;\n\n/**\n * Type of the `d.vec2i` object/function: vector data type schema/constructor\n */\nexport type NativeVec2i = Vec2i & { '~exotic': Vec2i } & ((\n x: number,\n y: number,\n ) => v2i) &\n ((xy: number) => v2i) &\n (() => v2i);\n\n/**\n *\n * Schema representing vec2i - a vector with 2 elements of type i32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2i(); // (0, 0)\n * const vector = d.vec2i(1); // (1, 1)\n * const vector = d.vec2i(-1, 1); // (-1, 1)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2i, d.vec2i(0, 1)); // buffer holding a d.vec2i value, with an initial value of vec2i(0, 1);\n */\nexport const vec2i = makeVecSchema({\n type: 'vec2i',\n length: 2,\n make: (x: number, y: number) =>\n new Proxy(new vec2iImpl(x, y), vecProxyHandler) as v2i,\n makeFromScalar: (x) => new Proxy(new vec2iImpl(x, x), vecProxyHandler) as v2i,\n}) as NativeVec2i;\n\n/**\n * Type of the `d.vec2u` object/function: vector data type schema/constructor\n */\nexport type NativeVec2u = Vec2u & { '~exotic': Vec2u } & ((\n x: number,\n y: number,\n ) => v2u) &\n ((xy: number) => v2u) &\n (() => v2u);\n\n/**\n *\n * Schema representing vec2u - a vector with 2 elements of type u32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec2u(); // (0, 0)\n * const vector = d.vec2u(1); // (1, 1)\n * const vector = d.vec2u(1, 2); // (1, 2)\n *\n * @example\n * const buffer = root.createBuffer(d.vec2u, d.vec2u(0, 1)); // buffer holding a d.vec2u value, with an initial value of vec2u(0, 1);\n */\nexport const vec2u = makeVecSchema({\n type: 'vec2u',\n length: 2,\n make: (x: number, y: number) =>\n new Proxy(new vec2uImpl(x, y), vecProxyHandler) as v2u,\n makeFromScalar: (x) => new Proxy(new vec2uImpl(x, x), vecProxyHandler) as v2u,\n}) as NativeVec2u;\n\n/**\n * Type of the `d.vec3f` object/function: vector data type schema/constructor\n */\nexport type NativeVec3f = Vec3f & { '~exotic': Vec3f } & ((\n x: number,\n y: number,\n z: number,\n ) => v3f) &\n ((xyz: number) => v3f) &\n (() => v3f);\n\n/**\n *\n * Schema representing vec3f - a vector with 3 elements of type f32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3f(); // (0.0, 0.0, 0.0)\n * const vector = d.vec3f(1); // (1.0, 1.0, 1.0)\n * const vector = d.vec3f(1, 2, 3.5); // (1.0, 2.0, 3.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3f, d.vec3f(0, 1, 2)); // buffer holding a d.vec3f value, with an initial value of vec3f(0, 1, 2);\n */\nexport const vec3f = makeVecSchema({\n type: 'vec3f',\n length: 3,\n make: (x, y, z) => new Proxy(new vec3fImpl(x, y, z), vecProxyHandler) as v3f,\n makeFromScalar: (x) =>\n new Proxy(new vec3fImpl(x, x, x), vecProxyHandler) as v3f,\n}) as NativeVec3f;\n\n/**\n * Type of the `d.vec3h` object/function: vector data type schema/constructor\n */\nexport type NativeVec3h = Vec3h & { '~exotic': Vec3h } & ((\n x: number,\n y: number,\n z: number,\n ) => v3h) &\n ((xyz: number) => v3h) &\n (() => v3h);\n\n/**\n *\n * Schema representing vec3h - a vector with 3 elements of type f16.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3h(); // (0.0, 0.0, 0.0)\n * const vector = d.vec3h(1); // (1.0, 1.0, 1.0)\n * const vector = d.vec3h(1, 2, 3.5); // (1.0, 2.0, 3.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3h, d.vec3h(0, 1, 2)); // buffer holding a d.vec3h value, with an initial value of vec3h(0, 1, 2);\n */\nexport const vec3h = makeVecSchema({\n type: 'vec3h',\n length: 3,\n make: (x, y, z) => new Proxy(new vec3hImpl(x, y, z), vecProxyHandler) as v3h,\n makeFromScalar: (x) =>\n new Proxy(new vec3hImpl(x, x, x), vecProxyHandler) as v3h,\n}) as NativeVec3h;\n\n/**\n * Type of the `d.vec3i` object/function: vector data type schema/constructor\n */\nexport type NativeVec3i = Vec3i & { '~exotic': Vec3i } & ((\n x: number,\n y: number,\n z: number,\n ) => v3i) &\n ((xyz: number) => v3i) &\n (() => v3i);\n\n/**\n *\n * Schema representing vec3i - a vector with 3 elements of type i32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3i(); // (0, 0, 0)\n * const vector = d.vec3i(1); // (1, 1, 1)\n * const vector = d.vec3i(1, 2, -3); // (1, 2, -3)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3i, d.vec3i(0, 1, 2)); // buffer holding a d.vec3i value, with an initial value of vec3i(0, 1, 2);\n */\nexport const vec3i = makeVecSchema({\n type: 'vec3i',\n length: 3,\n make: (x, y, z) => new Proxy(new vec3iImpl(x, y, z), vecProxyHandler) as v3i,\n makeFromScalar: (x) =>\n new Proxy(new vec3iImpl(x, x, x), vecProxyHandler) as v3i,\n}) as NativeVec3i;\n\n/**\n * Type of the `d.vec3u` object/function: vector data type schema/constructor\n */\nexport type NativeVec3u = Vec3u & { '~exotic': Vec3u } & ((\n x: number,\n y: number,\n z: number,\n ) => v3u) &\n ((xyz: number) => v3u) &\n (() => v3u);\n\n/**\n *\n * Schema representing vec3u - a vector with 3 elements of type u32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec3u(); // (0, 0, 0)\n * const vector = d.vec3u(1); // (1, 1, 1)\n * const vector = d.vec3u(1, 2, 3); // (1, 2, 3)\n *\n * @example\n * const buffer = root.createBuffer(d.vec3u, d.vec3u(0, 1, 2)); // buffer holding a d.vec3u value, with an initial value of vec3u(0, 1, 2);\n */\nexport const vec3u = makeVecSchema({\n type: 'vec3u',\n length: 3,\n make: (x, y, z) => new Proxy(new vec3uImpl(x, y, z), vecProxyHandler) as v3u,\n makeFromScalar: (x) =>\n new Proxy(new vec3uImpl(x, x, x), vecProxyHandler) as v3u,\n}) as NativeVec3u;\n\n/**\n * Type of the `d.vec4f` object/function: vector data type schema/constructor\n */\nexport type NativeVec4f = Vec4f & { '~exotic': Vec4f } & ((\n x: number,\n y: number,\n z: number,\n w: number,\n ) => v4f) &\n ((xyzw: number) => v4f) &\n (() => v4f);\n\n/**\n *\n * Schema representing vec4f - a vector with 4 elements of type f32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4f(); // (0.0, 0.0, 0.0, 0.0)\n * const vector = d.vec4f(1); // (1.0, 1.0, 1.0, 1.0)\n * const vector = d.vec4f(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4f, d.vec4f(0, 1, 2, 3)); // buffer holding a d.vec4f value, with an initial value of vec4f(0, 1, 2, 3);\n */\nexport const vec4f = makeVecSchema({\n type: 'vec4f',\n length: 4,\n make: (x, y, z, w) =>\n new Proxy(new vec4fImpl(x, y, z, w), vecProxyHandler) as v4f,\n makeFromScalar: (x) =>\n new Proxy(new vec4fImpl(x, x, x, x), vecProxyHandler) as v4f,\n}) as NativeVec4f;\n\n/**\n * Type of the `d.vec4h` object/function: vector data type schema/constructor\n */\nexport type NativeVec4h = Vec4h & { '~exotic': Vec4h } & ((\n x: number,\n y: number,\n z: number,\n w: number,\n ) => v4h) &\n ((xyzw: number) => v4h) &\n (() => v4h);\n\n/**\n *\n * Schema representing vec4h - a vector with 4 elements of type f16.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4h(); // (0.0, 0.0, 0.0, 0.0)\n * const vector = d.vec4h(1); // (1.0, 1.0, 1.0, 1.0)\n * const vector = d.vec4h(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4h, d.vec4h(0, 1, 2, 3)); // buffer holding a d.vec4h value, with an initial value of vec4h(0, 1, 2, 3);\n */\nexport const vec4h = makeVecSchema({\n type: 'vec4h',\n length: 4,\n make: (x, y, z, w) =>\n new Proxy(new vec4hImpl(x, y, z, w), vecProxyHandler) as v4h,\n makeFromScalar: (x) =>\n new Proxy(new vec4hImpl(x, x, x, x), vecProxyHandler) as v4h,\n}) as NativeVec4h;\n\n/**\n * Type of the `d.vec4i` object/function: vector data type schema/constructor\n */\nexport type NativeVec4i = Vec4i & { '~exotic': Vec4i } & ((\n x: number,\n y: number,\n z: number,\n w: number,\n ) => v4i) &\n ((xyzw: number) => v4i) &\n (() => v4i);\n\n/**\n *\n * Schema representing vec4i - a vector with 4 elements of type i32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4i(); // (0, 0, 0, 0)\n * const vector = d.vec4i(1); // (1, 1, 1, 1)\n * const vector = d.vec4i(1, 2, 3, -4); // (1, 2, 3, -4)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4i, d.vec4i(0, 1, 2, 3)); // buffer holding a d.vec4i value, with an initial value of vec4i(0, 1, 2, 3);\n */\nexport const vec4i = makeVecSchema({\n type: 'vec4i',\n length: 4,\n make: (x, y, z, w) =>\n new Proxy(new vec4iImpl(x, y, z, w), vecProxyHandler) as v4i,\n makeFromScalar: (x) =>\n new Proxy(new vec4iImpl(x, x, x, x), vecProxyHandler) as v4i,\n}) as NativeVec4i;\n\n/**\n * Type of the `d.vec4u` object/function: vector data type schema/constructor\n */\nexport type NativeVec4u = Vec4u & { '~exotic': Vec4u } & ((\n x: number,\n y: number,\n z: number,\n w: number,\n ) => v4u) &\n ((xyzw: number) => v4u) &\n (() => v4u);\n\n/**\n *\n * Schema representing vec4u - a vector with 4 elements of type u32.\n * Also a constructor function for this vector value.\n *\n * @example\n * const vector = d.vec4u(); // (0, 0, 0, 0)\n * const vector = d.vec4u(1); // (1, 1, 1, 1)\n * const vector = d.vec4u(1, 2, 3, 4); // (1, 2, 3, 4)\n *\n * @example\n * const buffer = root.createBuffer(d.vec4u, d.vec4u(0, 1, 2, 3)); // buffer holding a d.vec4u value, with an initial value of vec4u(0, 1, 2, 3);\n */\nexport const vec4u = makeVecSchema({\n length: 4,\n type: 'vec4u',\n make: (x, y, z, w) =>\n new Proxy(new vec4uImpl(x, y, z, w), vecProxyHandler) as v4u,\n makeFromScalar: (x) =>\n new Proxy(new vec4uImpl(x, x, x, x), vecProxyHandler) as v4u,\n}) as NativeVec4u;\n","import type { Infer } from '../shared/repr';\nimport type { VertexFormat } from '../shared/vertexFormat';\nimport { f32, i32, u32 } from './numeric';\nimport {\n vec2f,\n vec2i,\n vec2u,\n vec3f,\n vec3i,\n vec3u,\n vec4f,\n vec4i,\n vec4u,\n} from './vector';\n\nexport type FormatToWGSLType<T extends VertexFormat> =\n (typeof formatToWGSLType)[T];\n\nexport interface TgpuVertexFormatData<T extends VertexFormat> {\n readonly '~repr': Infer<FormatToWGSLType<T>>;\n readonly type: T;\n}\n\nclass TgpuVertexFormatDataImpl<T extends VertexFormat>\n implements TgpuVertexFormatData<T>\n{\n /** Used as a type-token for the `Infer<T>` functionality. */\n public readonly '~repr'!: Infer<FormatToWGSLType<T>>;\n\n constructor(public readonly type: T) {}\n}\n\nconst formatToWGSLType = {\n uint8: u32,\n uint8x2: vec2u,\n uint8x4: vec4u,\n sint8: i32,\n sint8x2: vec2i,\n sint8x4: vec4i,\n unorm8: f32,\n unorm8x2: vec2f,\n unorm8x4: vec4f,\n snorm8: f32,\n snorm8x2: vec2f,\n snorm8x4: vec4f,\n uint16: u32,\n uint16x2: vec2u,\n uint16x4: vec4u,\n sint16: i32,\n sint16x2: vec2i,\n sint16x4: vec4i,\n unorm16: f32,\n unorm16x2: vec2f,\n unorm16x4: vec4f,\n snorm16: f32,\n snorm16x2: vec2f,\n snorm16x4: vec4f,\n float16: f32,\n float16x2: vec2f,\n float16x4: vec4f,\n float32: f32,\n float32x2: vec2f,\n float32x3: vec3f,\n float32x4: vec4f,\n uint32: u32,\n uint32x2: vec2u,\n uint32x3: vec3u,\n uint32x4: vec4u,\n sint32: i32,\n sint32x2: vec2i,\n sint32x3: vec3i,\n sint32x4: vec4i,\n 'unorm10-10-10-2': vec4f,\n 'unorm8x4-bgra': vec4f,\n} as const;\n\nexport const packedFormats = Object.keys(formatToWGSLType);\n\nexport type uint8 = TgpuVertexFormatData<'uint8'>;\nexport const uint8 = new TgpuVertexFormatDataImpl('uint8') as uint8;\n\nexport type uint8x2 = TgpuVertexFormatData<'uint8x2'>;\nexport const uint8x2 = new TgpuVertexFormatDataImpl('uint8x2') as uint8x2;\n\nexport type uint8x4 = TgpuVertexFormatData<'uint8x4'>;\nexport const uint8x4 = new TgpuVertexFormatDataImpl('uint8x4') as uint8x4;\n\nexport type sint8 = TgpuVertexFormatData<'sint8'>;\nexport const sint8 = new TgpuVertexFormatDataImpl('sint8') as sint8;\n\nexport type sint8x2 = TgpuVertexFormatData<'sint8x2'>;\nexport const sint8x2 = new TgpuVertexFormatDataImpl('sint8x2') as sint8x2;\n\nexport type sint8x4 = TgpuVertexFormatData<'sint8x4'>;\nexport const sint8x4 = new TgpuVertexFormatDataImpl('sint8x4') as sint8x4;\n\nexport type unorm8 = TgpuVertexFormatData<'unorm8'>;\nexport const unorm8 = new TgpuVertexFormatDataImpl('unorm8') as unorm8;\n\nexport type unorm8x2 = TgpuVertexFormatData<'unorm8x2'>;\nexport const unorm8x2 = new TgpuVertexFormatDataImpl('unorm8x2') as unorm8x2;\n\nexport type unorm8x4 = TgpuVertexFormatData<'unorm8x4'>;\nexport const unorm8x4 = new TgpuVertexFormatDataImpl('unorm8x4') as unorm8x4;\n\nexport type snorm8 = TgpuVertexFormatData<'snorm8'>;\nexport const snorm8 = new TgpuVertexFormatDataImpl('snorm8') as snorm8;\n\nexport type snorm8x2 = TgpuVertexFormatData<'snorm8x2'>;\nexport const snorm8x2 = new TgpuVertexFormatDataImpl('snorm8x2') as snorm8x2;\n\nexport type snorm8x4 = TgpuVertexFormatData<'snorm8x4'>;\nexport const snorm8x4 = new TgpuVertexFormatDataImpl('snorm8x4') as snorm8x4;\n\nexport type uint16 = TgpuVertexFormatData<'uint16'>;\nexport const uint16 = new TgpuVertexFormatDataImpl('uint16') as uint16;\n\nexport type uint16x2 = TgpuVertexFormatData<'uint16x2'>;\nexport const uint16x2 = new TgpuVertexFormatDataImpl('uint16x2') as uint16x2;\n\nexport type uint16x4 = TgpuVertexFormatData<'uint16x4'>;\nexport const uint16x4 = new TgpuVertexFormatDataImpl('uint16x4') as uint16x4;\n\nexport type sint16 = TgpuVertexFormatData<'sint16'>;\nexport const sint16 = new TgpuVertexFormatDataImpl('sint16') as sint16;\n\nexport type sint16x2 = TgpuVertexFormatData<'sint16x2'>;\nexport const sint16x2 = new TgpuVertexFormatDataImpl('sint16x2') as sint16x2;\n\nexport type sint16x4 = TgpuVertexFormatData<'sint16x4'>;\nexport const sint16x4 = new TgpuVertexFormatDataImpl('sint16x4') as sint16x4;\n\nexport type unorm16 = TgpuVertexFormatData<'unorm16'>;\nexport const unorm16 = new TgpuVertexFormatDataImpl('unorm16') as unorm16;\n\nexport type unorm16x2 = TgpuVertexFormatData<'unorm16x2'>;\nexport const unorm16x2 = new TgpuVertexFormatDataImpl('unorm16x2') as unorm16x2;\n\nexport type unorm16x4 = TgpuVertexFormatData<'unorm16x4'>;\nexport const unorm16x4 = new TgpuVertexFormatDataImpl('unorm16x4') as unorm16x4;\n\nexport type snorm16 = TgpuVertexFormatData<'snorm16'>;\nexport const snorm16 = new TgpuVertexFormatDataImpl('snorm16') as snorm16;\n\nexport type snorm16x2 = TgpuVertexFormatData<'snorm16x2'>;\nexport const snorm16x2 = new TgpuVertexFormatDataImpl('snorm16x2') as snorm16x2;\n\nexport type snorm16x4 = TgpuVertexFormatData<'snorm16x4'>;\nexport const snorm16x4 = new TgpuVertexFormatDataImpl('snorm16x4') as snorm16x4;\n\nexport type float16 = TgpuVertexFormatData<'float16'>;\nexport const float16 = new TgpuVertexFormatDataImpl('float16') as float16;\n\nexport type float16x2 = TgpuVertexFormatData<'float16x2'>;\nexport const float16x2 = new TgpuVertexFormatDataImpl('float16x2') as float16x2;\n\nexport type float16x4 = TgpuVertexFormatData<'float16x4'>;\nexport const float16x4 = new TgpuVertexFormatDataImpl('float16x4') as float16x4;\n\nexport type float32 = TgpuVertexFormatData<'float32'>;\nexport const float32 = new TgpuVertexFormatDataImpl('float32') as float32;\n\nexport type float32x2 = TgpuVertexFormatData<'float32x2'>;\nexport const float32x2 = new TgpuVertexFormatDataImpl('float32x2') as float32x2;\n\nexport type float32x3 = TgpuVertexFormatData<'float32x3'>;\nexport const float32x3 = new TgpuVertexFormatDataImpl('float32x3') as float32x3;\n\nexport type float32x4 = TgpuVertexFormatData<'float32x4'>;\nexport const float32x4 = new TgpuVertexFormatDataImpl('float32x4') as float32x4;\n\nexport type uint32 = TgpuVertexFormatData<'uint32'>;\nexport const uint32 = new TgpuVertexFormatDataImpl('uint32') as uint32;\n\nexport type uint32x2 = TgpuVertexFormatData<'uint32x2'>;\nexport const uint32x2 = new TgpuVertexFormatDataImpl('uint32x2') as uint32x2;\n\nexport type uint32x3 = TgpuVertexFormatData<'uint32x3'>;\nexport const uint32x3 = new TgpuVertexFormatDataImpl('uint32x3') as uint32x3;\n\nexport type uint32x4 = TgpuVertexFormatData<'uint32x4'>;\nexport const uint32x4 = new TgpuVertexFormatDataImpl('uint32x4') as uint32x4;\n\nexport type sint32 = TgpuVertexFormatData<'sint32'>;\nexport const sint32 = new TgpuVertexFormatDataImpl('sint32') as sint32;\n\nexport type sint32x2 = TgpuVertexFormatData<'sint32x2'>;\nexport const sint32x2 = new TgpuVertexFormatDataImpl('sint32x2') as sint32x2;\n\nexport type sint32x3 = TgpuVertexFormatData<'sint32x3'>;\nexport const sint32x3 = new TgpuVertexFormatDataImpl('sint32x3') as sint32x3;\n\nexport type sint32x4 = TgpuVertexFormatData<'sint32x4'>;\nexport const sint32x4 = new TgpuVertexFormatDataImpl('sint32x4') as sint32x4;\n\nexport type unorm10_10_10_2 = TgpuVertexFormatData<'unorm10-10-10-2'>;\nexport const unorm10_10_10_2 = new TgpuVertexFormatDataImpl(\n 'unorm10-10-10-2',\n) as unorm10_10_10_2;\n\nexport type unorm8x4_bgra = TgpuVertexFormatData<'unorm8x4-bgra'>;\nexport const unorm8x4_bgra = new TgpuVertexFormatDataImpl(\n 'unorm8x4-bgra',\n) as unorm8x4_bgra;\n\nexport type PackedData =\n | uint8\n | uint8x2\n | uint8x4\n | sint8\n | sint8x2\n | sint8x4\n | unorm8\n | unorm8x2\n | unorm8x4\n | snorm8\n | snorm8x2\n | snorm8x4\n | uint16\n | uint16x2\n | uint16x4\n | sint16\n | sint16x2\n | sint16x4\n | unorm16\n | unorm16x2\n | unorm16x4\n | snorm16\n | snorm16x2\n | snorm16x4\n | float16\n | float16x2\n | float16x4\n | float32\n | float32x2\n | float32x3\n | float32x4\n | uint32\n | uint32x2\n | uint32x3\n | uint32x4\n | sint32\n | sint32x2\n | sint32x3\n | sint32x4\n | unorm10_10_10_2\n | unorm8x4_bgra;\n","import {\n type AnyData,\n getCustomAlignment,\n isDisarray,\n isLooseDecorated,\n isUnstruct,\n} from './dataTypes';\nimport { packedFormats } from './vertexFormatData';\nimport {\n type BaseWgslData,\n isDecorated,\n isWgslArray,\n isWgslStruct,\n} from './wgslTypes';\n\nconst knownAlignmentMap: Record<string, number> = {\n bool: 4,\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4,\n vec2f: 8,\n vec2h: 4,\n vec2i: 8,\n vec2u: 8,\n vec3f: 16,\n vec3h: 8,\n vec3i: 16,\n vec3u: 16,\n vec4f: 16,\n vec4h: 8,\n vec4i: 16,\n vec4u: 16,\n mat2x2f: 8,\n mat3x3f: 16,\n mat4x4f: 16,\n};\n\nfunction computeAlignment(data: object): number {\n const dataType = (data as BaseWgslData)?.type;\n const knownAlignment = knownAlignmentMap[dataType];\n if (knownAlignment !== undefined) {\n return knownAlignment;\n }\n\n if (isWgslStruct(data)) {\n return Object.values(data.propTypes)\n .map(alignmentOf)\n .reduce((a, b) => (a > b ? a : b));\n }\n\n if (isWgslArray(data)) {\n return alignmentOf(data.elementType);\n }\n\n if (isUnstruct(data)) {\n // A loose struct is aligned to its first property.\n const firstProp = Object.values(data.propTypes)[0];\n return firstProp ? getCustomAlignment(firstProp) ?? 1 : 1;\n }\n\n if (isDisarray(data)) {\n return getCustomAlignment(data.elementType) ?? 1;\n }\n\n if (isDecorated(data) || isLooseDecorated(data)) {\n return getCustomAlignment(data) ?? alignmentOf(data.inner);\n }\n\n if (packedFormats.includes(dataType)) {\n return 1;\n }\n\n throw new Error(\n `Cannot determine alignment of data: ${JSON.stringify(data)}`,\n );\n}\n\nfunction computeCustomAlignment(data: BaseWgslData): number {\n if (isUnstruct(data)) {\n // A loose struct is aligned to its first property.\n const firstProp = Object.values(data.propTypes)[0];\n return firstProp ? customAlignmentOf(firstProp) : 1;\n }\n\n if (isDisarray(data)) {\n return customAlignmentOf(data.elementType);\n }\n\n if (isLooseDecorated(data)) {\n return getCustomAlignment(data) ?? customAlignmentOf(data.inner);\n }\n\n return getCustomAlignment(data) ?? 1;\n}\n\n/**\n * Since alignments can be inferred from exotic/native data types, they are\n * not stored on them. Instead, this weak map acts as an extended property\n * of those data types.\n */\nconst cachedAlignments = new WeakMap<object, number>();\n\nconst cachedCustomAlignments = new WeakMap<object, number>();\n\nexport function alignmentOf(data: BaseWgslData): number {\n let alignment = cachedAlignments.get(data);\n if (alignment === undefined) {\n alignment = computeAlignment(data);\n cachedAlignments.set(data, alignment);\n }\n\n return alignment;\n}\n\nexport function customAlignmentOf(data: BaseWgslData): number {\n let alignment = cachedCustomAlignments.get(data);\n if (alignment === undefined) {\n alignment = computeCustomAlignment(data);\n cachedCustomAlignments.set(data, alignment);\n }\n\n return alignment;\n}\n\n/**\n * Returns the alignment (in bytes) of data represented by the `schema`.\n */\nexport function PUBLIC_alignmentOf(schema: AnyData): number {\n return alignmentOf(schema);\n}\n","import { roundUp } from '../mathUtils';\nimport { alignmentOf, customAlignmentOf } from './alignmentOf';\nimport type { AnyData, LooseTypeLiteral, Unstruct } from './dataTypes';\nimport {\n getCustomSize,\n isDisarray,\n isLooseDecorated,\n isUnstruct,\n} from './dataTypes';\nimport type { BaseWgslData, WgslStruct, WgslTypeLiteral } from './wgslTypes';\nimport { isDecorated, isWgslArray, isWgslStruct } from './wgslTypes';\n\nconst knownSizesMap: Record<string, number> = {\n bool: 4,\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4,\n vec2f: 8,\n vec2h: 4,\n vec2i: 8,\n vec2u: 8,\n vec3f: 12,\n vec3h: 6,\n vec3i: 12,\n vec3u: 12,\n vec4f: 16,\n vec4h: 8,\n vec4i: 16,\n vec4u: 16,\n mat2x2f: 16,\n mat3x3f: 48,\n mat4x4f: 64,\n uint8: 1,\n uint8x2: 2,\n uint8x4: 4,\n sint8: 1,\n sint8x2: 2,\n sint8x4: 4,\n unorm8: 1,\n unorm8x2: 2,\n unorm8x4: 4,\n snorm8: 1,\n snorm8x2: 2,\n snorm8x4: 4,\n uint16: 2,\n uint16x2: 4,\n uint16x4: 8,\n sint16: 2,\n sint16x2: 4,\n sint16x4: 8,\n unorm16: 2,\n unorm16x2: 4,\n unorm16x4: 8,\n snorm16: 2,\n snorm16x2: 4,\n snorm16x4: 8,\n float16: 2,\n float16x2: 4,\n float16x4: 8,\n float32: 4,\n float32x2: 8,\n float32x3: 12,\n float32x4: 16,\n uint32: 4,\n uint32x2: 8,\n uint32x3: 12,\n uint32x4: 16,\n sint32: 4,\n sint32x2: 8,\n sint32x3: 12,\n sint32x4: 16,\n 'unorm10-10-10-2': 4,\n 'unorm8x4-bgra': 4,\n} satisfies Partial<Record<WgslTypeLiteral | LooseTypeLiteral, number>>;\n\nfunction sizeOfStruct(struct: WgslStruct) {\n let size = 0;\n for (const property of Object.values(struct.propTypes)) {\n if (Number.isNaN(size)) {\n throw new Error('Only the last property of a struct can be unbounded');\n }\n\n size = roundUp(size, alignmentOf(property));\n size += sizeOf(property);\n\n if (Number.isNaN(size) && property.type !== 'array') {\n throw new Error('Cannot nest unbounded struct within another struct');\n }\n }\n\n return roundUp(size, alignmentOf(struct));\n}\n\nfunction sizeOfUnstruct(data: Unstruct) {\n let size = 0;\n\n for (const property of Object.values(data.propTypes)) {\n const alignment = customAlignmentOf(property);\n size = roundUp(size, alignment);\n size += sizeOf(property);\n }\n\n return size;\n}\n\nfunction computeSize(data: object): number {\n const knownSize = knownSizesMap[(data as BaseWgslData)?.type];\n\n if (knownSize !== undefined) {\n return knownSize;\n }\n\n if (isWgslStruct(data)) {\n return sizeOfStruct(data);\n }\n\n if (isUnstruct(data)) {\n return sizeOfUnstruct(data);\n }\n\n if (isWgslArray(data)) {\n if (data.elementCount === 0) {\n return Number.NaN;\n }\n\n const alignment = alignmentOf(data.elementType);\n const stride = roundUp(sizeOf(data.elementType), alignment);\n return stride * data.elementCount;\n }\n\n if (isDisarray(data)) {\n const alignment = customAlignmentOf(data.elementType);\n const stride = roundUp(sizeOf(data.elementType), alignment);\n return stride * data.elementCount;\n }\n\n if (isDecorated(data) || isLooseDecorated(data)) {\n return getCustomSize(data) ?? sizeOf(data.inner);\n }\n\n throw new Error(`Cannot determine size of data: ${data}`);\n}\n\n/**\n * Since sizes can be inferred from exotic/native data types, they are\n * not stored on them. Instead, this weak map acts as an extended property\n * of those data types.\n */\nconst cachedSizes = new WeakMap<BaseWgslData, number>();\n\nexport function sizeOf(schema: BaseWgslData): number {\n let size = cachedSizes.get(schema);\n\n if (size === undefined) {\n size = computeSize(schema);\n cachedSizes.set(schema, size);\n }\n\n return size;\n}\n\n/**\n * Returns the size (in bytes) of data represented by the `schema`.\n */\nexport function PUBLIC_sizeOf(schema: AnyData): number {\n return sizeOf(schema);\n}\n","import type { Infer } from '../shared/repr';\nimport type { Exotic } from './exotic';\nimport { sizeOf } from './sizeOf';\nimport type { AnyWgslData, WgslArray } from './wgslTypes';\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Array schema constructed via `d.arrayOf` function.\n *\n * Responsible for handling reading and writing array values\n * between binary and JS representation. Takes into account\n * the `byteAlignment` requirement of its elementType.\n */\nexport interface TgpuArray<TElement extends AnyWgslData>\n extends WgslArray<TElement> {\n readonly '~exotic': WgslArray<Exotic<TElement>>;\n}\n\n/**\n * Creates an array schema that can be used to construct gpu buffers.\n * Describes arrays with fixed-size length, storing elements of the same type.\n *\n * @example\n * const LENGTH = 3;\n * const array = d.arrayOf(d.u32, LENGTH);\n *\n * @param elementType The type of elements in the array.\n * @param elementCount The number of elements in the array.\n */\nexport const arrayOf = <TElement extends AnyWgslData>(\n elementType: TElement,\n elementCount: number,\n): TgpuArray<Exotic<TElement>> =>\n new TgpuArrayImpl(elementType as Exotic<TElement>, elementCount);\n\n// --------------\n// Implementation\n// --------------\n\nclass TgpuArrayImpl<TElement extends AnyWgslData>\n implements TgpuArray<TElement>\n{\n public readonly type = 'array';\n /** Type-token, not available at runtime */\n public readonly '~repr'!: Infer<TElement>[];\n /** Type-token, not available at runtime */\n public readonly '~exotic'!: WgslArray<Exotic<TElement>>;\n\n constructor(\n public readonly elementType: TElement,\n public readonly elementCount: number,\n ) {\n if (Number.isNaN(sizeOf(elementType))) {\n throw new Error('Cannot nest runtime sized arrays.');\n }\n }\n\n toString() {\n return `arrayOf(${this.elementType})`;\n }\n}\n","import type { Infer } from '../shared/repr';\nimport type { AnyData, Disarray } from './dataTypes';\nimport type { Exotic } from './exotic';\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Creates an array schema that can be used to construct vertex buffers.\n * Describes arrays with fixed-size length, storing elements of the same type.\n *\n * Elements in the schema are not aligned in respect to their `byteAlignment`,\n * unless they are explicitly decorated with the custom align attribute\n * via `d.align` function.\n *\n * @example\n * const disarray = d.disarrayOf(d.vec3f, 3); // packed array of vec3f\n *\n * @example\n * const disarray = d.disarrayOf(d.align(16, d.vec3f), 3);\n *\n * @param elementType The type of elements in the array.\n * @param count The number of elements in the array.\n */\nexport const disarrayOf = <TElement extends AnyData>(\n elementType: TElement,\n count: number,\n): Disarray<Exotic<TElement>> =>\n new DisarrayImpl(elementType as Exotic<TElement>, count);\n\n// --------------\n// Implementation\n// --------------\n\nclass DisarrayImpl<TElement extends AnyData> implements Disarray<TElement> {\n public readonly type = 'disarray';\n /** Type-token, not available at runtime */\n public readonly '~repr'!: Infer<TElement>[];\n\n constructor(\n public readonly elementType: TElement,\n public readonly elementCount: number,\n ) {}\n}\n","import type { InferRecord } from '../shared/repr';\nimport type { Unstruct } from './dataTypes';\nimport type { ExoticRecord } from './exotic';\nimport type { BaseWgslData } from './wgslTypes';\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Creates a loose struct schema that can be used to construct vertex buffers.\n * Describes structs with members of both loose and non-loose types.\n *\n * The order of members matches the passed in properties object.\n * Members are not aligned in respect to their `byteAlignment`,\n * unless they are explicitly decorated with the custom align attribute\n * via `d.align` function.\n *\n * @example\n * const CircleStruct = d.unstruct({ radius: d.f32, pos: d.vec3f }); // packed struct with no padding\n *\n * @example\n * const CircleStruct = d.unstruct({ radius: d.f32, pos: d.align(16, d.vec3f) });\n *\n * @param properties Record with `string` keys and `TgpuData` or `TgpuLooseData` values,\n * each entry describing one struct member.\n */\nexport const unstruct = <TProps extends Record<string, BaseWgslData>>(\n properties: TProps,\n): Unstruct<ExoticRecord<TProps>> =>\n new UnstructImpl(properties as ExoticRecord<TProps>);\n\n// --------------\n// Implementation\n// --------------\n\nclass UnstructImpl<TProps extends Record<string, BaseWgslData>>\n implements Unstruct<TProps>\n{\n public readonly type = 'unstruct';\n /** Type-token, not available at runtime */\n public readonly '~repr'!: InferRecord<TProps>;\n\n constructor(public readonly propTypes: TProps) {}\n}\n","import { type VecKind, vec2f, vec3f, vec4f } from './vector';\nimport type {\n Mat2x2f,\n Mat3x3f,\n Mat4x4f,\n m2x2f,\n m3x3f,\n m4x4f,\n mat2x2,\n mat3x3,\n mat4x4,\n matBase,\n v2f,\n v3f,\n v4f,\n} from './wgslTypes';\n\n// --------------\n// Implementation\n// --------------\n\ntype vBase = {\n kind: VecKind;\n length: number;\n [n: number]: number;\n};\n\ninterface MatSchemaOptions<TType extends string, ValueType> {\n type: TType;\n rows: number;\n columns: number;\n makeFromElements(...elements: number[]): ValueType;\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, ValueType>,\n): { type: TType; '~repr': ValueType } & MatConstructor<ValueType, ColumnType> {\n const MatSchema = {\n /** Type-token, not available at runtime */\n '~repr': undefined as unknown as ValueType,\n type: options.type,\n label: options.type,\n };\n\n const construct = (...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 // Fill the rest with zeros\n for (let i = elements.length; i < options.columns * options.rows; ++i) {\n elements.push(0);\n }\n\n return options.makeFromElements(...elements);\n };\n\n return Object.assign(construct, MatSchema) as unknown as {\n type: TType;\n '~repr': ValueType;\n } & MatConstructor<ValueType, ColumnType>;\n}\n\nabstract class mat2x2Impl<TColumn extends v2f> implements mat2x2<TColumn> {\n public readonly columns: readonly [TColumn, TColumn];\n public readonly length = 4;\n [n: number]: number;\n\n constructor(...elements: number[]) {\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\nclass mat2x2fImpl extends mat2x2Impl<v2f> implements m2x2f {\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> implements mat3x3<TColumn> {\n public readonly columns: readonly [TColumn, TColumn, TColumn];\n public readonly length = 12;\n [n: number]: number;\n\n constructor(...elements: number[]) {\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\nclass mat3x3fImpl extends mat3x3Impl<v3f> implements m3x3f {\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> implements mat4x4<TColumn> {\n public readonly columns: readonly [TColumn, TColumn, TColumn, TColumn];\n\n constructor(...elements: number[]) {\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\nclass mat4x4fImpl extends mat4x4Impl<v4f> implements m4x4f {\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// Public API\n// ----------\n\n/**\n * Type of the `d.mat2x2f` object/function: matrix data type schema/constructor\n */\nexport type NativeMat2x2f = Mat2x2f & { '~exotic': Mat2x2f } & ((\n ...elements: number[]\n ) => m2x2f) &\n ((...columns: v2f[]) => m2x2f) &\n (() => m2x2f);\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[0] // vec2f(0, 1)\n * mat[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 makeFromElements: (...elements: number[]) => new mat2x2fImpl(...elements),\n}) as NativeMat2x2f;\n\n/**\n * Type of the `d.mat3x3f` object/function: matrix data type schema/constructor\n */\nexport type NativeMat3x3f = Mat3x3f & { '~exotic': Mat3x3f } & ((\n ...elements: number[]\n ) => m3x3f) &\n ((...columns: v3f[]) => m3x3f) &\n (() => m3x3f);\n\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[0] // vec3f(0, 1, 2)\n * mat[1] // vec3f(3, 4, 5)\n * mat[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 makeFromElements: (...elements: number[]) => new mat3x3fImpl(...elements),\n}) as NativeMat3x3f;\n\n/**\n * Type of the `d.mat4x4f` object/function: matrix data type schema/constructor\n */\nexport type NativeMat4x4f = Mat4x4f & { '~exotic': Mat4x4f } & ((\n ...elements: number[]\n ) => m4x4f) &\n ((...columns: v4f[]) => m4x4f) &\n (() => m4x4f);\n\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 = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);\n * mat[0] // vec4f(0, 1, 2, 3)\n * mat[1] // vec4f(4, 5, 6, 7)\n * mat[2] // vec4f(8, 9, 10, 11)\n * mat[3] // vec4f(12, 13, 14, 15)\n *\n * @example\n * const mat = mat3x3f(\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 makeFromElements: (...elements: number[]) => new mat4x4fImpl(...elements),\n}) as NativeMat4x4f;\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 type { Infer } from '../shared/repr';\nimport type { Exotic } from './exotic';\nimport type { Atomic, I32, U32 } from './wgslTypes';\n\n// ----------\n// Public API\n// ----------\n\n/**\n * Marks a concrete integer scalar type schema (u32 or i32) as a WGSL atomic.\n *\n * @example\n * const atomicU32 = d.atomic(d.u32);\n * const atomicI32 = d.atomic(d.i32);\n *\n * @param data Underlying type schema.\n */\nexport function atomic<TSchema extends U32 | I32>(\n data: TSchema,\n): Atomic<Exotic<TSchema>> {\n return new AtomicImpl(data as Exotic<TSchema>);\n}\n\n// --------------\n// Implementation\n// --------------\n\nclass AtomicImpl<TSchema extends U32 | I32> implements Atomic<TSchema> {\n public readonly type = 'atomic';\n /** Type-token, not available at runtime */\n public readonly '~repr'!: Infer<TSchema>;\n\n constructor(public readonly inner: TSchema) {}\n}\n","import type { Infer } from '../shared/repr';\nimport { alignmentOf } from './alignmentOf';\nimport {\n type AnyData,\n type AnyLooseData,\n type LooseDecorated,\n type LooseTypeLiteral,\n isLooseData,\n isLooseDecorated,\n} from './dataTypes';\nimport type { Exotic } from './exotic';\nimport { sizeOf } from './sizeOf';\nimport {\n type Align,\n type AnyWgslData,\n type BaseWgslData,\n type Builtin,\n type Decorated,\n type Location,\n type Size,\n type WgslTypeLiteral,\n isAlignAttrib,\n isBuiltinAttrib,\n isDecorated,\n isSizeAttrib,\n isWgslData,\n} from './wgslTypes';\n\n// ----------\n// Public API\n// ----------\n\nexport const builtinNames = [\n 'vertex_index',\n 'instance_index',\n 'position',\n 'clip_distances',\n 'front_facing',\n 'frag_depth',\n 'sample_index',\n 'sample_mask',\n 'fragment',\n 'local_invocation_id',\n 'local_invocation_index',\n 'global_invocation_id',\n 'workgroup_id',\n 'num_workgroups',\n] as const;\n\nexport type BuiltinName = (typeof builtinNames)[number];\n\nexport type AnyAttribute =\n | Align<number>\n | Size<number>\n | Location<number>\n | Builtin<BuiltinName>;\n\nexport type ExtractAttributes<T> = T extends {\n readonly attribs: unknown[];\n}\n ? T['attribs']\n : [];\n\ntype Undecorate<T> = T extends { readonly inner: infer TInner } ? TInner : T;\n\n/**\n * Decorates a data-type `TData` with an attribute `TAttrib`.\n *\n * - if `TData` is loose\n * - if `TData` is already `LooseDecorated`\n * - Prepend `TAttrib` to the existing attribute tuple.\n * - else\n * - Wrap `TData` with `LooseDecorated` and a single attribute `[TAttrib]`\n * - else\n * - if `TData` is already `Decorated`\n * - Prepend `TAttrib` to the existing attribute tuple.\n * - else\n * - Wrap `TData` with `Decorated` and a single attribute `[TAttrib]`\n */\nexport type Decorate<\n TData extends BaseWgslData,\n TAttrib extends AnyAttribute,\n> = TData['type'] extends WgslTypeLiteral\n ? Decorated<Undecorate<TData>, [TAttrib, ...ExtractAttributes<TData>]>\n : TData['type'] extends LooseTypeLiteral\n ? LooseDecorated<Undecorate<TData>, [TAttrib, ...ExtractAttributes<TData>]>\n : never;\n\nexport type IsBuiltin<T> = ExtractAttributes<T>[number] extends []\n ? false\n : ExtractAttributes<T>[number] extends Builtin<BuiltinName>\n ? true\n : false;\n\nexport type HasCustomLocation<T> = ExtractAttributes<T>[number] extends []\n ? false\n : ExtractAttributes<T>[number] extends Location<number>\n ? true\n : false;\n\nexport function attribute<\n TData extends BaseWgslData,\n TAttrib extends AnyAttribute,\n>(data: TData, attrib: TAttrib): Decorated | LooseDecorated {\n if (isDecorated(data)) {\n return new DecoratedImpl(data.inner, [\n attrib,\n ...data.attribs,\n ]) as Decorated;\n }\n\n if (isLooseDecorated(data)) {\n return new LooseDecoratedImpl(data.inner, [\n attrib,\n ...data.attribs,\n ]) as LooseDecorated;\n }\n\n if (isLooseData(data)) {\n return new LooseDecoratedImpl(data, [attrib]) as unknown as LooseDecorated;\n }\n\n return new DecoratedImpl(data, [attrib]) as unknown as Decorated;\n}\n\n/**\n * Gives the wrapped data-type a custom byte alignment. Useful in order to\n * fulfill uniform alignment requirements.\n *\n * @example\n * const Data = d.struct({\n * a: u32, // takes up 4 bytes\n * // 12 bytes of padding, because `b` is custom aligned to multiples of 16 bytes\n * b: d.align(16, u32),\n * });\n *\n * @param alignment The multiple of bytes this data should align itself to.\n * @param data The data-type to align.\n */\nexport function align<TAlign extends number, TData extends AnyData>(\n alignment: TAlign,\n data: TData,\n): Decorate<Exotic<TData>, Align<TAlign>> {\n // biome-ignore lint/suspicious/noExplicitAny: <tired of lying to types>\n return attribute(data, { type: '@align', value: alignment }) as any;\n}\n\n/**\n * Adds padding bytes after the wrapped data-type, until the whole value takes up `size` bytes.\n *\n * @example\n * const Data = d.struct({\n * a: d.size(16, u32), // takes up 16 bytes, instead of 4\n * b: u32, // starts at byte 16, because `a` has a custom size\n * });\n *\n * @param size The amount of bytes that should be reserved for this data-type.\n * @param data The data-type to wrap.\n */\nexport function size<TSize extends number, TData extends AnyData>(\n size: TSize,\n data: TData,\n): Decorate<Exotic<TData>, Size<TSize>> {\n // biome-ignore lint/suspicious/noExplicitAny: <tired of lying to types>\n return attribute(data, { type: '@size', value: size }) as any;\n}\n\n/**\n * Assigns an explicit numeric location to a struct member or a parameter that has this type.\n *\n * @example\n * const Data = d.ioStruct({\n * a: d.u32, // has implicit location 0\n * b: d.location(5, d.u32),\n * c: d.u32, // has implicit location 6\n * });\n *\n * @param location The explicit numeric location.\n * @param data The data-type to wrap.\n */\nexport function location<TLocation extends number, TData extends AnyData>(\n location: TLocation,\n data: TData,\n): Decorate<Exotic<TData>, Location<TLocation>> {\n // biome-ignore lint/suspicious/noExplicitAny: <tired of lying to types>\n return attribute(data, { type: '@location', value: location }) as any;\n}\n\nexport function isBuiltin<\n T extends\n | Decorated<AnyWgslData, AnyAttribute[]>\n | LooseDecorated<AnyLooseData, AnyAttribute[]>,\n>(value: T | unknown): value is T {\n return (\n (isDecorated(value) || isLooseDecorated(value)) &&\n value.attribs.find(isBuiltinAttrib) !== undefined\n );\n}\n\nexport function getAttributesString<T extends BaseWgslData>(field: T): string {\n if (!isDecorated(field) && !isLooseDecorated(field)) {\n return '';\n }\n\n return (field.attribs as AnyAttribute[])\n .map((attrib) => `${attrib.type}(${attrib.value}) `)\n .join('');\n}\n\n// --------------\n// Implementation\n// --------------\n\nclass BaseDecoratedImpl<\n TInner extends BaseWgslData,\n TAttribs extends unknown[],\n> {\n // Type-token, not available at runtime\n public readonly '~repr'!: Infer<TInner>;\n\n constructor(\n public readonly inner: TInner,\n public readonly attribs: TAttribs,\n ) {\n const alignAttrib = attribs.find(isAlignAttrib)?.value;\n const sizeAttrib = attribs.find(isSizeAttrib)?.value;\n\n if (alignAttrib !== undefined) {\n if (alignAttrib <= 0) {\n throw new Error(\n `Custom data alignment must be a positive number, got: ${alignAttrib}.`,\n );\n }\n\n if (Math.log2(alignAttrib) % 1 !== 0) {\n throw new Error(\n `Alignment has to be a power of 2, got: ${alignAttrib}.`,\n );\n }\n\n if (isWgslData(this.inner)) {\n if (alignAttrib % alignmentOf(this.inner) !== 0) {\n throw new Error(\n `Custom alignment has to be a multiple of the standard data alignment. Got: ${alignAttrib}, expected multiple of: ${alignmentOf(this.inner)}.`,\n );\n }\n }\n }\n\n if (sizeAttrib !== undefined) {\n if (sizeAttrib < sizeOf(this.inner)) {\n throw new Error(\n `Custom data size cannot be smaller then the standard data size. Got: ${sizeAttrib}, expected at least: ${sizeOf(this.inner)}.`,\n );\n }\n\n if (sizeAttrib <= 0) {\n throw new Error(\n `Custom data size must be a positive number. Got: ${sizeAttrib}.`,\n );\n }\n }\n }\n}\n\nclass DecoratedImpl<TInner extends BaseWgslData, TAttribs extends unknown[]>\n extends BaseDecoratedImpl<TInner, TAttribs>\n implements Decorated<TInner, TAttribs>\n{\n public readonly type = 'decorated';\n}\n\nclass LooseDecoratedImpl<\n TInner extends BaseWgslData,\n TAttribs extends unknown[],\n >\n extends BaseDecoratedImpl<TInner, TAttribs>\n implements LooseDecorated<TInner, TAttribs>\n{\n public readonly type = 'loose-decorated';\n}\n","import { arrayOf } from './data/array';\nimport { attribute } from './data/attributes';\nimport { f32, u32 } from './data/numeric';\nimport { vec3u, vec4f } from './data/vector';\nimport type {\n BaseWgslData,\n Builtin,\n Decorated,\n F32,\n U32,\n Vec3u,\n Vec4f,\n WgslArray,\n} from './data/wgslTypes';\n\n// ----------\n// Public API\n// ----------\n\nexport type BuiltinVertexIndex = Decorated<U32, [Builtin<'vertex_index'>]>;\nexport type BuiltinInstanceIndex = Decorated<U32, [Builtin<'instance_index'>]>;\nexport type BuiltinPosition = Decorated<Vec4f, [Builtin<'position'>]>;\nexport type BuiltinClipDistances = Decorated<\n WgslArray<U32>,\n [Builtin<'clip_distances'>]\n>;\nexport type BuiltinFrontFacing = Decorated<F32, [Builtin<'front_facing'>]>;\nexport type BuiltinFragDepth = Decorated<F32, [Builtin<'frag_depth'>]>;\nexport type BuiltinSampleIndex = Decorated<U32, [Builtin<'sample_index'>]>;\nexport type BuiltinSampleMask = Decorated<U32, [Builtin<'sample_mask'>]>;\nexport type BuiltinFragment = Decorated<Vec4f, [Builtin<'fragment'>]>;\nexport type BuiltinLocalInvocationId = Decorated<\n Vec3u,\n [Builtin<'local_invocation_id'>]\n>;\nexport type BuiltinLocalInvocationIndex = Decorated<\n U32,\n [Builtin<'local_invocation_index'>]\n>;\nexport type BuiltinGlobalInvocationId = Decorated<\n Vec3u,\n [Builtin<'global_invocation_id'>]\n>;\nexport type BuiltinWorkgroupId = Decorated<Vec3u, [Builtin<'workgroup_id'>]>;\nexport type BuiltinNumWorkgroups = Decorated<\n Vec3u,\n [Builtin<'num_workgroups'>]\n>;\n\nexport const builtin = {\n vertexIndex: attribute(u32, {\n type: '@builtin',\n value: 'vertex_index',\n }) as BuiltinVertexIndex,\n instanceIndex: attribute(u32, {\n type: '@builtin',\n value: 'instance_index',\n }) as BuiltinInstanceIndex,\n position: attribute(vec4f, {\n type: '@builtin',\n value: 'position',\n }) as BuiltinPosition,\n clipDistances: attribute(arrayOf(u32, 8), {\n type: '@builtin',\n value: 'clip_distances',\n }) as BuiltinClipDistances,\n frontFacing: attribute(f32, {\n type: '@builtin',\n value: 'front_facing',\n }) as BuiltinFrontFacing,\n fragDepth: attribute(f32, {\n type: '@builtin',\n value: 'frag_depth',\n }) as BuiltinFragDepth,\n sampleIndex: attribute(u32, {\n type: '@builtin',\n value: 'sample_index',\n }) as BuiltinSampleIndex,\n sampleMask: attribute(u32, {\n type: '@builtin',\n value: 'sample_mask',\n }) as BuiltinSampleMask,\n localInvocationId: attribute(vec3u, {\n type: '@builtin',\n value: 'local_invocation_id',\n }) as BuiltinLocalInvocationId,\n localInvocationIndex: attribute(u32, {\n type: '@builtin',\n value: 'local_invocation_index',\n }) as BuiltinLocalInvocationIndex,\n globalInvocationId: attribute(vec3u, {\n type: '@builtin',\n value: 'global_invocation_id',\n }) as BuiltinGlobalInvocationId,\n workgroupId: attribute(vec3u, {\n type: '@builtin',\n value: 'workgroup_id',\n }) as BuiltinWorkgroupId,\n numWorkgroups: attribute(vec3u, {\n type: '@builtin',\n value: 'num_workgroups',\n }) as BuiltinNumWorkgroups,\n} as const;\n\nexport type AnyBuiltin = (typeof builtin)[keyof typeof builtin];\n\nexport type OmitBuiltins<S> = S extends AnyBuiltin\n ? never\n : S extends BaseWgslData\n ? S\n : {\n [Key in keyof S as S[Key] extends AnyBuiltin ? never : Key]: S[Key];\n };\n"],"mappings":"ofAAA,OAAOA,OAAS,eCIhB,IAAMC,GAAS,mBAKR,SAASC,GACdC,EACAC,EACmB,CACnB,GAAID,EAEF,OAKA,MAAM,IAAI,MAAMF,EAAM,CAa1B,CASO,IAAMI,GAAN,MAAMC,UAAwB,KAAM,CACzC,YACkBC,EACAC,EAChB,CACA,IAAIC,EAAUD,EAAM,IAAKE,GAAa,KAAKA,CAAQ,EAAE,EAGjDD,EAAQ,OAAS,KACnBA,EAAU,CAAC,GAAGA,EAAQ,MAAM,EAAG,EAAE,EAAG,MAAO,GAAGA,EAAQ,MAAM,GAAG,CAAC,GAGlE,MAAM;AAAA,EAA8CA,EAAQ,KAAK;AAAA,CAAI,CAAC,EAAE,EAVxD,WAAAF,EACA,WAAAC,EAYhB,OAAO,eAAe,KAAMF,EAAgB,SAAS,CACvD,CAEA,cAAcI,EAAoC,CAChD,IAAMC,EAAW,CAACD,EAAU,GAAG,KAAK,KAAK,EAEzC,OAAO,IAAIJ,EAAgB,KAAK,MAAOK,CAAQ,CACjD,CACF,EAKaC,GAAN,MAAMC,UAA8B,KAAM,CAC/C,YAA4BC,EAAyB,CACnD,MAAM,sBAAsBA,CAAI,GAAG,EADT,UAAAA,EAI1B,OAAO,eAAe,KAAMD,EAAsB,SAAS,CAC7D,CACF,EAKaE,GAAN,MAAMC,UAAwB,KAAM,CACzC,YAAYC,EAA4B,CAnF1C,IAAAC,EAoFI,MACE,YAAWA,EAAAD,EAAM,Q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AAM,WACN,MAAO,gBACT,CAAC,EACD,SAAUD,EAAUE,EAAO,CACzB,KAAM,WACN,MAAO,UACT,CAAC,EACD,cAAeF,EAAUG,GAAQF,EAAK,CAAC,EAAG,CACxC,KAAM,WACN,MAAO,gBACT,CAAC,EACD,YAAaD,EAAUI,EAAK,CAC1B,KAAM,WACN,MAAO,cACT,CAAC,EACD,UAAWJ,EAAUI,EAAK,CACxB,KAAM,WACN,MAAO,YACT,CAAC,EACD,YAAaJ,EAAUC,EAAK,CAC1B,KAAM,WACN,MAAO,cACT,CAAC,EACD,WAAYD,EAAUC,EAAK,CACzB,KAAM,WACN,MAAO,aACT,CAAC,EACD,kBAAmBD,EAAUK,EAAO,CAClC,KAAM,WACN,MAAO,qBACT,CAAC,EACD,qBAAsBL,EAAUC,EAAK,CACnC,KAAM,WACN,MAAO,wBACT,CAAC,EACD,mBAAoBD,EAAUK,EAAO,CACnC,KAAM,WACN,MAAO,sBACT,CAAC,EACD,YAAaL,EAAUK,EAAO,CAC5B,KAAM,WACN,MAAO,cACT,CAAC,EACD,cAAeL,EAAUK,EAAO,CAC9B,KAAM,WACN,MAAO,gBACT,CAAC,CACH","names":["bin","prefix","invariant","condition","message","ResolutionError","_ResolutionError","cause","trace","entries","ancestor","newTrace","MissingSlotValueError","_MissingSlotValueError","slot","NotUniformError","_NotUniformError","value","_a","MissingBindGroupError","_MissingBindGroupError","layoutLabel","resolutionCtx","provideCtx","ctx","callback","invariant","inGPUMode","resolutionCtx","bool","u32Cast","v","inGPUMode","u32","i32Cast","value","i32","f32Cast","arr","f32","f16Cast","bin","f16","wgslTypeLiterals","isWgslData","value","isWgslArray","schema","isWgslStruct","isAtomic","isAlignAttrib","isSizeAttrib","isLocationAttrib","isBuiltinAttrib","isDecorated","struct","props","TgpuStructImpl","propTypes","__publicField","label","_a","roundUp","value","modulo","bitMask","invBitMask","vertexFormats","looseTypeLiterals","vertexFormats","isLooseData","data","isDisarray","schema","isUnstruct","isLooseDecorated","value","getCustomAlignment","_a","_b","isAlignAttrib","getCustomSize","isSizeAttrib","getCustomLocation","isLocationAttrib","isData","isWgslData","makeVecSchema","options","VecSchema","args","_a","values","inGPUMode","vec2Impl","x","y","__publicField","value","vec2fImpl","_vec2fImpl","z","vec3fImpl","w","vec4fImpl","vec2hImpl","_vec2hImpl","vec3hImpl","vec4hImpl","vec2iImpl","_vec2iImpl","vec3iImpl","vec4iImpl","vec2uImpl","_vec2uImpl","vec3uImpl","vec4uImpl","vec3Impl","_vec3fImpl","_vec3hImpl","_vec3iImpl","_vec3uImpl","vec4Impl","_vec4fImpl","_vec4hImpl","_vec4iImpl","_vec4uImpl","vecProxyHandler","target","prop","targetAsVec4","idx","char","vec2f","vec2h","vec2i","vec2u","vec3f","vec3h","vec3i","vec3u","vec4f","vec4h","vec4i","vec4u","TgpuVertexFormatDataImpl","type","__publicField","formatToWGSLType","u32","vec2u","vec4u","i32","vec2i","vec4i","f32","vec2f","vec4f","vec3f","vec3u","vec3i","packedFormats","uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10_10_10_2","unorm8x4_bgra","knownAlignmentMap","computeAlignment","data","_a","_b","_c","dataType","knownAlignment","isWgslStruct","alignmentOf","a","b","isWgslArray","isUnstruct","firstProp","getCustomAlignment","isDisarray","isDecorated","isLooseDecorated","packedFormats","computeCustomAlignment","customAlignmentOf","cachedAlignments","cachedCustomAlignments","alignment","PUBLIC_alignmentOf","schema","knownSizesMap","sizeOfStruct","struct","size","property","roundUp","alignmentOf","sizeOf","sizeOfUnstruct","data","alignment","customAlignmentOf","computeSize","_a","knownSize","isWgslStruct","isUnstruct","isWgslArray","isDisarray","isDecorated","isLooseDecorated","getCustomSize","cachedSizes","schema","PUBLIC_sizeOf","arrayOf","elementType","elementCount","TgpuArrayImpl","__publicField","sizeOf","disarrayOf","elementType","count","DisarrayImpl","elementCount","__publicField","unstruct","properties","UnstructImpl","propTypes","__publicField","createMatSchema","options","MatSchema","args","elements","arg","i","mat2x2Impl","__publicField","value","mat2x2fImpl","e0","e1","vec2f","mat3x3Impl","_","mat3x3fImpl","x","y","z","vec3f","mat4x4Impl","mat4x4fImpl","w","vec4f","mat2x2f","mat3x3f","mat4x4f","matToArray","mat","idx","atomic","data","AtomicImpl","inner","__publicField","attribute","data","attrib","isDecorated","DecoratedImpl","isLooseDecorated","LooseDecoratedImpl","isLooseData","align","alignment","size","location","isBuiltin","value","isBuiltinAttrib","getAttributesString","field","BaseDecoratedImpl","inner","attribs","__publicField","_a","_b","alignAttrib","isAlignAttrib","sizeAttrib","isSizeAttrib","isWgslData","alignmentOf","sizeOf","builtin","attribute","u32","vec4f","arrayOf","f32","vec3u"]}
|
package/data/index.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5DF7EEAZcjs = require('../chunk-5DF7EEAZ.cjs');exports.align = _chunk5DF7EEAZcjs.Ja; exports.alignmentOf = _chunk5DF7EEAZcjs.Ga; exports.arrayOf = _chunk5DF7EEAZcjs.Pa; exports.atomic = _chunk5DF7EEAZcjs.Wa; exports.bool = _chunk5DF7EEAZcjs.z; exports.builtin = _chunk5DF7EEAZcjs.Xa; exports.disarrayOf = _chunk5DF7EEAZcjs.Qa; exports.f16 = _chunk5DF7EEAZcjs.D; exports.f32 = _chunk5DF7EEAZcjs.C; exports.float16 = _chunk5DF7EEAZcjs.na; exports.float16x2 = _chunk5DF7EEAZcjs.oa; exports.float16x4 = _chunk5DF7EEAZcjs.pa; exports.float32 = _chunk5DF7EEAZcjs.qa; exports.float32x2 = _chunk5DF7EEAZcjs.ra; exports.float32x3 = _chunk5DF7EEAZcjs.sa; exports.float32x4 = _chunk5DF7EEAZcjs.ta; exports.i32 = _chunk5DF7EEAZcjs.B; exports.isAlignAttrib = _chunk5DF7EEAZcjs.h; exports.isAtomic = _chunk5DF7EEAZcjs.g; exports.isBuiltin = _chunk5DF7EEAZcjs.Ma; exports.isBuiltinAttrib = _chunk5DF7EEAZcjs.k; exports.isData = _chunk5DF7EEAZcjs.r; exports.isDecorated = _chunk5DF7EEAZcjs.l; exports.isDisarray = _chunk5DF7EEAZcjs.n; exports.isLocationAttrib = _chunk5DF7EEAZcjs.j; exports.isLooseData = _chunk5DF7EEAZcjs.m; exports.isLooseDecorated = _chunk5DF7EEAZcjs.p; exports.isSizeAttrib = _chunk5DF7EEAZcjs.i; exports.isUnstruct = _chunk5DF7EEAZcjs.o; exports.isWgslArray = _chunk5DF7EEAZcjs.e; exports.isWgslData = _chunk5DF7EEAZcjs.d; exports.isWgslStruct = _chunk5DF7EEAZcjs.f; exports.location = _chunk5DF7EEAZcjs.La; exports.mat2x2f = _chunk5DF7EEAZcjs.Sa; exports.mat3x3f = _chunk5DF7EEAZcjs.Ta; exports.mat4x4f = _chunk5DF7EEAZcjs.Ua; exports.matToArray = _chunk5DF7EEAZcjs.Va; exports.packedFormats = _chunk5DF7EEAZcjs.Q; exports.sint16 = _chunk5DF7EEAZcjs.ea; exports.sint16x2 = _chunk5DF7EEAZcjs.fa; exports.sint16x4 = _chunk5DF7EEAZcjs.ga; exports.sint32 = _chunk5DF7EEAZcjs.ya; exports.sint32x2 = _chunk5DF7EEAZcjs.za; exports.sint32x3 = _chunk5DF7EEAZcjs.Aa; exports.sint32x4 = _chunk5DF7EEAZcjs.Ba; exports.sint8 = _chunk5DF7EEAZcjs.U; exports.sint8x2 = _chunk5DF7EEAZcjs.V; exports.sint8x4 = _chunk5DF7EEAZcjs.W; exports.size = _chunk5DF7EEAZcjs.Ka; exports.sizeOf = _chunk5DF7EEAZcjs.Ia; exports.snorm16 = _chunk5DF7EEAZcjs.ka; exports.snorm16x2 = _chunk5DF7EEAZcjs.la; exports.snorm16x4 = _chunk5DF7EEAZcjs.ma; exports.snorm8 = _chunk5DF7EEAZcjs._; exports.snorm8x2 = _chunk5DF7EEAZcjs.$; exports.snorm8x4 = _chunk5DF7EEAZcjs.aa; exports.struct = _chunk5DF7EEAZcjs.Oa; exports.u32 = _chunk5DF7EEAZcjs.A; exports.uint16 = _chunk5DF7EEAZcjs.ba; exports.uint16x2 = _chunk5DF7EEAZcjs.ca; exports.uint16x4 = _chunk5DF7EEAZcjs.da; exports.uint32 = _chunk5DF7EEAZcjs.ua; exports.uint32x2 = _chunk5DF7EEAZcjs.va; exports.uint32x3 = _chunk5DF7EEAZcjs.wa; exports.uint32x4 = _chunk5DF7EEAZcjs.xa; exports.uint8 = _chunk5DF7EEAZcjs.R; exports.uint8x2 = _chunk5DF7EEAZcjs.S; exports.uint8x4 = _chunk5DF7EEAZcjs.T; exports.unorm10_10_10_2 = _chunk5DF7EEAZcjs.Ca; exports.unorm16 = _chunk5DF7EEAZcjs.ha; exports.unorm16x2 = _chunk5DF7EEAZcjs.ia; exports.unorm16x4 = _chunk5DF7EEAZcjs.ja; exports.unorm8 = _chunk5DF7EEAZcjs.X; exports.unorm8x2 = _chunk5DF7EEAZcjs.Y; exports.unorm8x4 = _chunk5DF7EEAZcjs.Z; exports.unorm8x4_bgra = _chunk5DF7EEAZcjs.Da; exports.unstruct = _chunk5DF7EEAZcjs.Ra; exports.vec2f = _chunk5DF7EEAZcjs.E; exports.vec2h = _chunk5DF7EEAZcjs.F; exports.vec2i = _chunk5DF7EEAZcjs.G; exports.vec2u = _chunk5DF7EEAZcjs.H; exports.vec3f = _chunk5DF7EEAZcjs.I; exports.vec3h = _chunk5DF7EEAZcjs.J; exports.vec3i = _chunk5DF7EEAZcjs.K; exports.vec3u = _chunk5DF7EEAZcjs.L; exports.vec4f = _chunk5DF7EEAZcjs.M; exports.vec4h = _chunk5DF7EEAZcjs.N; exports.vec4i = _chunk5DF7EEAZcjs.O; exports.vec4u = _chunk5DF7EEAZcjs.P;
|
2
2
|
//# sourceMappingURL=index.cjs.map
|