typegpu 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { D as Decorated, U as U32, aa as Builtin, d as Vec4f, q as WgslArray, F as F32, l as Vec3u, B as BaseData, a9 as Align, a8 as Size, L as Location, ab as Interpolate, bb as InterpolationType, w as AnyData, bc as PerspectiveOrLinearInterpolationType, bd as PerspectiveOrLinearInterpolatableData, be as FlatInterpolationType, bf as FlatInterpolatableData, A as AnyWgslData, am as LooseDecorated, an as AnyLooseData, z as WgslTypeLiteral, bg as LooseTypeLiteral } from './wgslTypes-D8LnuOPy.cjs';
1
+ import { D as Decorated, l as Vec3u, aa as Builtin, U as U32, d as Vec4f, q as WgslArray, F as F32, B as BaseData, a9 as Align, a8 as Size, L as Location, ab as Interpolate, bb as InterpolationType, x as WgslTypeLiteral, bc as LooseTypeLiteral, am as LooseDecorated, w as AnyData, bd as PerspectiveOrLinearInterpolationType, be as PerspectiveOrLinearInterpolatableData, bf as FlatInterpolationType, bg as FlatInterpolatableData, A as AnyWgslData, an as AnyLooseData } from './wgslTypes-DgaoTc4M.cjs';
2
2
 
3
3
  type BuiltinVertexIndex = Decorated<U32, [Builtin<'vertex_index'>]>;
4
4
  type BuiltinInstanceIndex = Decorated<U32, [Builtin<'instance_index'>]>;
@@ -156,4 +156,4 @@ declare function interpolate<TInterpolation extends PerspectiveOrLinearInterpola
156
156
  declare function interpolate<TInterpolation extends FlatInterpolationType, TData extends FlatInterpolatableData>(interpolationType: TInterpolation, data: TData): Decorate<TData, Interpolate<TInterpolation>>;
157
157
  declare function isBuiltin<T extends Decorated<AnyWgslData, AnyAttribute[]> | LooseDecorated<AnyLooseData, AnyAttribute[]>>(value: T | unknown): value is T;
158
158
 
159
- export { type AnyAttribute as A, type BuiltinVertexIndex as B, type Decorate as D, type HasCustomLocation as H, type IsBuiltin as I, type OmitBuiltins as O, type AnyComputeBuiltin as a, type AnyFragmentOutputBuiltin as b, type AnyFragmentInputBuiltin as c, align as d, isBuiltin as e, builtin as f, type BuiltinInstanceIndex as g, type BuiltinPosition as h, interpolate as i, type BuiltinClipDistances as j, type BuiltinFrontFacing as k, location as l, type BuiltinFragDepth as m, type BuiltinSampleIndex as n, type BuiltinSampleMask as o, type BuiltinLocalInvocationId as p, type BuiltinLocalInvocationIndex as q, type BuiltinGlobalInvocationId as r, size as s, type BuiltinWorkgroupId as t, type BuiltinNumWorkgroups as u, type AnyBuiltin as v };
159
+ export { type AnyAttribute as A, type BuiltinVertexIndex as B, type Decorate as D, type HasCustomLocation as H, type IsBuiltin as I, type OmitBuiltins as O, type AnyComputeBuiltin as a, type AnyFragmentInputBuiltin as b, type AnyFragmentOutputBuiltin as c, align as d, isBuiltin as e, builtin as f, type BuiltinInstanceIndex as g, type BuiltinPosition as h, interpolate as i, type BuiltinClipDistances as j, type BuiltinFrontFacing as k, location as l, type BuiltinFragDepth as m, type BuiltinSampleIndex as n, type BuiltinSampleMask as o, type BuiltinLocalInvocationId as p, type BuiltinLocalInvocationIndex as q, type BuiltinGlobalInvocationId as r, size as s, type BuiltinWorkgroupId as t, type BuiltinNumWorkgroups as u, type AnyBuiltin as v };
@@ -1,4 +1,4 @@
1
- import { D as Decorated, U as U32, aa as Builtin, d as Vec4f, q as WgslArray, F as F32, l as Vec3u, B as BaseData, a9 as Align, a8 as Size, L as Location, ab as Interpolate, bb as InterpolationType, w as AnyData, bc as PerspectiveOrLinearInterpolationType, bd as PerspectiveOrLinearInterpolatableData, be as FlatInterpolationType, bf as FlatInterpolatableData, A as AnyWgslData, am as LooseDecorated, an as AnyLooseData, z as WgslTypeLiteral, bg as LooseTypeLiteral } from './wgslTypes-D8LnuOPy.js';
1
+ import { D as Decorated, l as Vec3u, aa as Builtin, U as U32, d as Vec4f, q as WgslArray, F as F32, B as BaseData, a9 as Align, a8 as Size, L as Location, ab as Interpolate, bb as InterpolationType, x as WgslTypeLiteral, bc as LooseTypeLiteral, am as LooseDecorated, w as AnyData, bd as PerspectiveOrLinearInterpolationType, be as PerspectiveOrLinearInterpolatableData, bf as FlatInterpolationType, bg as FlatInterpolatableData, A as AnyWgslData, an as AnyLooseData } from './wgslTypes-DgaoTc4M.js';
2
2
 
3
3
  type BuiltinVertexIndex = Decorated<U32, [Builtin<'vertex_index'>]>;
4
4
  type BuiltinInstanceIndex = Decorated<U32, [Builtin<'instance_index'>]>;
@@ -156,4 +156,4 @@ declare function interpolate<TInterpolation extends PerspectiveOrLinearInterpola
156
156
  declare function interpolate<TInterpolation extends FlatInterpolationType, TData extends FlatInterpolatableData>(interpolationType: TInterpolation, data: TData): Decorate<TData, Interpolate<TInterpolation>>;
157
157
  declare function isBuiltin<T extends Decorated<AnyWgslData, AnyAttribute[]> | LooseDecorated<AnyLooseData, AnyAttribute[]>>(value: T | unknown): value is T;
158
158
 
159
- export { type AnyAttribute as A, type BuiltinVertexIndex as B, type Decorate as D, type HasCustomLocation as H, type IsBuiltin as I, type OmitBuiltins as O, type AnyComputeBuiltin as a, type AnyFragmentOutputBuiltin as b, type AnyFragmentInputBuiltin as c, align as d, isBuiltin as e, builtin as f, type BuiltinInstanceIndex as g, type BuiltinPosition as h, interpolate as i, type BuiltinClipDistances as j, type BuiltinFrontFacing as k, location as l, type BuiltinFragDepth as m, type BuiltinSampleIndex as n, type BuiltinSampleMask as o, type BuiltinLocalInvocationId as p, type BuiltinLocalInvocationIndex as q, type BuiltinGlobalInvocationId as r, size as s, type BuiltinWorkgroupId as t, type BuiltinNumWorkgroups as u, type AnyBuiltin as v };
159
+ export { type AnyAttribute as A, type BuiltinVertexIndex as B, type Decorate as D, type HasCustomLocation as H, type IsBuiltin as I, type OmitBuiltins as O, type AnyComputeBuiltin as a, type AnyFragmentInputBuiltin as b, type AnyFragmentOutputBuiltin as c, align as d, isBuiltin as e, builtin as f, type BuiltinInstanceIndex as g, type BuiltinPosition as h, interpolate as i, type BuiltinClipDistances as j, type BuiltinFrontFacing as k, location as l, type BuiltinFragDepth as m, type BuiltinSampleIndex as n, type BuiltinSampleMask as o, type BuiltinLocalInvocationId as p, type BuiltinLocalInvocationIndex as q, type BuiltinGlobalInvocationId as r, size as s, type BuiltinWorkgroupId as t, type BuiltinNumWorkgroups as u, type AnyBuiltin as v };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var C=(e,t,s)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,tt= exports.a =(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&C(e,s,t[s]);if(G)for(var s of G(t))I.call(t,s)&&C(e,s,t[s]);return e},et= exports.b =(e,t)=>X(e,Y(t));var r=(e,t,s)=>(C(e,typeof t!="symbol"?t+"":t,s),s);var $="Invariant failed";function N(e,t){if(e)return;throw new Error($)}var D=class e extends Error{constructor(s,i){let h=i.map(n=>`- ${n}`);h.length>20&&(h=[...h.slice(0,11),"...",...h.slice(-10)]);super(`Resolution of the following tree failed:
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var C=(e,t,s)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,tt= exports.a =(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&C(e,s,t[s]);if(G)for(var s of G(t))I.call(t,s)&&C(e,s,t[s]);return e},et= exports.b =(e,t)=>X(e,Y(t));var r=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);var $="Invariant failed";function N(e,t){if(e)return;throw new Error($)}var D=class e extends Error{constructor(s,i){let h=i.map(n=>`- ${n}`);h.length>20&&(h=[...h.slice(0,11),"...",...h.slice(-10)]);super(`Resolution of the following tree failed:
2
2
  ${h.join(`
3
3
  `)}`);this.cause=s;this.trace=i;Object.setPrototypeOf(this,e.prototype)}appendToTrace(s){let i=[s,...this.trace];return new e(this.cause,i)}},F= exports.f =class e extends Error{constructor(s){super(`Missing value for '${s}'`);this.slot=s;Object.setPrototypeOf(this,e.prototype)}},K= exports.g =class e extends Error{constructor(t){var s;super(`Buffer '${(s=t.label)!=null?s:"<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,e.prototype)}},U= exports.h =class e extends Error{constructor(t,s){super(`The function '${t!=null?t:"<unnamed>"}' is missing links to the following external values: ${s}.`),Object.setPrototypeOf(this,e.prototype)}},L= exports.i =class e extends Error{constructor(t){super(`Missing bind groups for layouts: '${[...t].map(s=>{var i;return(i=s.label)!=null?i:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,e.prototype)}},W= exports.j =class e extends Error{constructor(t){super(`Missing vertex buffers for layouts: '${[...t].map(s=>{var i;return(i=s.label)!=null?i:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,e.prototype)}};var T=null;function nt(e,t){N(T===null,"Cannot nest context providers"),T=e;try{return t()}finally{T=null}}function rt(){return T}var k=()=>T!==null;var v=class extends Array{"~resolve"(){return`${this.kind}(${this.join(", ")})`}toString(){return this["~resolve"]()}get xx(){return new this._Vec2(this[0],this[0])}get xy(){return new this._Vec2(this[0],this[1])}get xz(){return new this._Vec2(this[0],this[2])}get xw(){return new this._Vec2(this[0],this[3])}get yx(){return new this._Vec2(this[1],this[0])}get yy(){return new this._Vec2(this[1],this[1])}get yz(){return new this._Vec2(this[1],this[2])}get yw(){return new this._Vec2(this[1],this[3])}get zx(){return new this._Vec2(this[2],this[0])}get zy(){return new this._Vec2(this[2],this[1])}get zz(){return new this._Vec2(this[2],this[2])}get zw(){return new this._Vec2(this[2],this[3])}get wx(){return new this._Vec2(this[3],this[0])}get wy(){return new this._Vec2(this[3],this[1])}get wz(){return new this._Vec2(this[3],this[2])}get ww(){return new this._Vec2(this[3],this[3])}get xxx(){return new this._Vec3(this[0],this[0],this[0])}get xxy(){return new this._Vec3(this[0],this[0],this[1])}get xxz(){return new this._Vec3(this[0],this[0],this[2])}get xxw(){return new this._Vec3(this[0],this[0],this[3])}get xyx(){return new this._Vec3(this[0],this[1],this[0])}get xyy(){return new this._Vec3(this[0],this[1],this[1])}get xyz(){return new this._Vec3(this[0],this[1],this[2])}get xyw(){return new this._Vec3(this[0],this[1],this[3])}get xzx(){return new this._Vec3(this[0],this[2],this[0])}get xzy(){return new this._Vec3(this[0],this[2],this[1])}get xzz(){return new this._Vec3(this[0],this[2],this[2])}get xzw(){return new this._Vec3(this[0],this[2],this[3])}get xwx(){return new this._Vec3(this[0],this[3],this[0])}get xwy(){return new this._Vec3(this[0],this[3],this[1])}get xwz(){return new this._Vec3(this[0],this[3],this[2])}get xww(){return new this._Vec3(this[0],this[3],this[3])}get yxx(){return new this._Vec3(this[1],this[0],this[0])}get yxy(){return new this._Vec3(this[1],this[0],this[1])}get yxz(){return new this._Vec3(this[1],this[0],this[2])}get yxw(){return new this._Vec3(this[1],this[0],this[3])}get yyx(){return new this._Vec3(this[1],this[1],this[0])}get yyy(){return new this._Vec3(this[1],this[1],this[1])}get yyz(){return new this._Vec3(this[1],this[1],this[2])}get yyw(){return new this._Vec3(this[1],this[1],this[3])}get yzx(){return new this._Vec3(this[1],this[2],this[0])}get yzy(){return new this._Vec3(this[1],this[2],this[1])}get yzz(){return new this._Vec3(this[1],this[2],this[2])}get yzw(){return new this._Vec3(this[1],this[2],this[3])}get ywx(){return new this._Vec3(this[1],this[3],this[0])}get ywy(){return new this._Vec3(this[1],this[3],this[1])}get ywz(){return new this._Vec3(this[1],this[3],this[2])}get yww(){return new this._Vec3(this[1],this[3],this[3])}get zxx(){return new this._Vec3(this[2],this[0],this[0])}get zxy(){return new this._Vec3(this[2],this[0],this[1])}get zxz(){return new this._Vec3(this[2],this[0],this[2])}get zxw(){return new this._Vec3(this[2],this[0],this[3])}get zyx(){return new this._Vec3(this[2],this[1],this[0])}get zyy(){return new this._Vec3(this[2],this[1],this[1])}get zyz(){return new this._Vec3(this[2],this[1],this[2])}get zyw(){return new this._Vec3(this[2],this[1],this[3])}get zzx(){return new this._Vec3(this[2],this[2],this[0])}get zzy(){return new this._Vec3(this[2],this[2],this[1])}get zzz(){return new this._Vec3(this[2],this[2],this[2])}get zzw(){return new this._Vec3(this[2],this[2],this[3])}get zwx(){return new this._Vec3(this[2],this[3],this[0])}get zwy(){return new this._Vec3(this[2],this[3],this[1])}get zwz(){return new this._Vec3(this[2],this[3],this[2])}get zww(){return new this._Vec3(this[2],this[3],this[3])}get wxx(){return new this._Vec3(this[3],this[0],this[0])}get wxy(){return new this._Vec3(this[3],this[0],this[1])}get wxz(){return new this._Vec3(this[3],this[0],this[2])}get wxw(){return new this._Vec3(this[3],this[0],this[3])}get wyx(){return new this._Vec3(this[3],this[1],this[0])}get wyy(){return new this._Vec3(this[3],this[1],this[1])}get wyz(){return new this._Vec3(this[3],this[1],this[2])}get wyw(){return new this._Vec3(this[3],this[1],this[3])}get wzx(){return new this._Vec3(this[3],this[2],this[0])}get wzy(){return new this._Vec3(this[3],this[2],this[1])}get wzz(){return new this._Vec3(this[3],this[2],this[2])}get wzw(){return new this._Vec3(this[3],this[2],this[3])}get wwx(){return new this._Vec3(this[3],this[3],this[0])}get wwy(){return new this._Vec3(this[3],this[3],this[1])}get wwz(){return new this._Vec3(this[3],this[3],this[2])}get www(){return new this._Vec3(this[3],this[3],this[3])}get xxxx(){return new this._Vec4(this[0],this[0],this[0],this[0])}get xxxy(){return new this._Vec4(this[0],this[0],this[0],this[1])}get xxxz(){return new this._Vec4(this[0],this[0],this[0],this[2])}get xxxw(){return new this._Vec4(this[0],this[0],this[0],this[3])}get xxyx(){return new this._Vec4(this[0],this[0],this[1],this[0])}get xxyy(){return new this._Vec4(this[0],this[0],this[1],this[1])}get xxyz(){return new this._Vec4(this[0],this[0],this[1],this[2])}get xxyw(){return new this._Vec4(this[0],this[0],this[1],this[3])}get xxzx(){return new this._Vec4(this[0],this[0],this[2],this[0])}get xxzy(){return new this._Vec4(this[0],this[0],this[2],this[1])}get xxzz(){return new this._Vec4(this[0],this[0],this[2],this[2])}get xxzw(){return new this._Vec4(this[0],this[0],this[2],this[3])}get xxwx(){return new this._Vec4(this[0],this[0],this[3],this[0])}get xxwy(){return new this._Vec4(this[0],this[0],this[3],this[1])}get xxwz(){return new this._Vec4(this[0],this[0],this[3],this[2])}get xxww(){return new this._Vec4(this[0],this[0],this[3],this[3])}get xyxx(){return new this._Vec4(this[0],this[1],this[0],this[0])}get xyxy(){return new this._Vec4(this[0],this[1],this[0],this[1])}get xyxz(){return new this._Vec4(this[0],this[1],this[0],this[2])}get xyxw(){return new this._Vec4(this[0],this[1],this[0],this[3])}get xyyx(){return new this._Vec4(this[0],this[1],this[1],this[0])}get xyyy(){return new this._Vec4(this[0],this[1],this[1],this[1])}get xyyz(){return new this._Vec4(this[0],this[1],this[1],this[2])}get xyyw(){return new this._Vec4(this[0],this[1],this[1],this[3])}get xyzx(){return new this._Vec4(this[0],this[1],this[2],this[0])}get xyzy(){return new this._Vec4(this[0],this[1],this[2],this[1])}get xyzz(){return new this._Vec4(this[0],this[1],this[2],this[2])}get xyzw(){return new this._Vec4(this[0],this[1],this[2],this[3])}get xywx(){return new this._Vec4(this[0],this[1],this[3],this[0])}get xywy(){return new this._Vec4(this[0],this[1],this[3],this[1])}get xywz(){return new this._Vec4(this[0],this[1],this[3],this[2])}get xyww(){return new this._Vec4(this[0],this[1],this[3],this[3])}get xzxx(){return new this._Vec4(this[0],this[2],this[0],this[0])}get xzxy(){return new this._Vec4(this[0],this[2],this[0],this[1])}get xzxz(){return new this._Vec4(this[0],this[2],this[0],this[2])}get xzxw(){return new this._Vec4(this[0],this[2],this[0],this[3])}get xzyx(){return new this._Vec4(this[0],this[2],this[1],this[0])}get xzyy(){return new this._Vec4(this[0],this[2],this[1],this[1])}get xzyz(){return new this._Vec4(this[0],this[2],this[1],this[2])}get xzyw(){return new this._Vec4(this[0],this[2],this[1],this[3])}get xzzx(){return new this._Vec4(this[0],this[2],this[2],this[0])}get xzzy(){return new this._Vec4(this[0],this[2],this[2],this[1])}get xzzz(){return new this._Vec4(this[0],this[2],this[2],this[2])}get xzzw(){return new this._Vec4(this[0],this[2],this[2],this[3])}get xzwx(){return new this._Vec4(this[0],this[2],this[3],this[0])}get xzwy(){return new this._Vec4(this[0],this[2],this[3],this[1])}get xzwz(){return new this._Vec4(this[0],this[2],this[3],this[2])}get xzww(){return new this._Vec4(this[0],this[2],this[3],this[3])}get xwxx(){return new this._Vec4(this[0],this[3],this[0],this[0])}get xwxy(){return new this._Vec4(this[0],this[3],this[0],this[1])}get xwxz(){return new this._Vec4(this[0],this[3],this[0],this[2])}get xwxw(){return new this._Vec4(this[0],this[3],this[0],this[3])}get xwyx(){return new this._Vec4(this[0],this[3],this[1],this[0])}get xwyy(){return new this._Vec4(this[0],this[3],this[1],this[1])}get xwyz(){return new this._Vec4(this[0],this[3],this[1],this[2])}get xwyw(){return new this._Vec4(this[0],this[3],this[1],this[3])}get xwzx(){return new this._Vec4(this[0],this[3],this[2],this[0])}get xwzy(){return new this._Vec4(this[0],this[3],this[2],this[1])}get xwzz(){return new this._Vec4(this[0],this[3],this[2],this[2])}get xwzw(){return new this._Vec4(this[0],this[3],this[2],this[3])}get xwwx(){return new this._Vec4(this[0],this[3],this[3],this[0])}get xwwy(){return new this._Vec4(this[0],this[3],this[3],this[1])}get xwwz(){return new this._Vec4(this[0],this[3],this[3],this[2])}get xwww(){return new this._Vec4(this[0],this[3],this[3],this[3])}get yxxx(){return new this._Vec4(this[1],this[0],this[0],this[0])}get yxxy(){return new this._Vec4(this[1],this[0],this[0],this[1])}get yxxz(){return new this._Vec4(this[1],this[0],this[0],this[2])}get yxxw(){return new this._Vec4(this[1],this[0],this[0],this[3])}get yxyx(){return new this._Vec4(this[1],this[0],this[1],this[0])}get yxyy(){return new this._Vec4(this[1],this[0],this[1],this[1])}get yxyz(){return new this._Vec4(this[1],this[0],this[1],this[2])}get yxyw(){return new this._Vec4(this[1],this[0],this[1],this[3])}get yxzx(){return new this._Vec4(this[1],this[0],this[2],this[0])}get yxzy(){return new this._Vec4(this[1],this[0],this[2],this[1])}get yxzz(){return new this._Vec4(this[1],this[0],this[2],this[2])}get yxzw(){return new this._Vec4(this[1],this[0],this[2],this[3])}get yxwx(){return new this._Vec4(this[1],this[0],this[3],this[0])}get yxwy(){return new this._Vec4(this[1],this[0],this[3],this[1])}get yxwz(){return new this._Vec4(this[1],this[0],this[3],this[2])}get yxww(){return new this._Vec4(this[1],this[0],this[3],this[3])}get yyxx(){return new this._Vec4(this[1],this[1],this[0],this[0])}get yyxy(){return new this._Vec4(this[1],this[1],this[0],this[1])}get yyxz(){return new this._Vec4(this[1],this[1],this[0],this[2])}get yyxw(){return new this._Vec4(this[1],this[1],this[0],this[3])}get yyyx(){return new this._Vec4(this[1],this[1],this[1],this[0])}get yyyy(){return new this._Vec4(this[1],this[1],this[1],this[1])}get yyyz(){return new this._Vec4(this[1],this[1],this[1],this[2])}get yyyw(){return new this._Vec4(this[1],this[1],this[1],this[3])}get yyzx(){return new this._Vec4(this[1],this[1],this[2],this[0])}get yyzy(){return new this._Vec4(this[1],this[1],this[2],this[1])}get yyzz(){return new this._Vec4(this[1],this[1],this[2],this[2])}get yyzw(){return new this._Vec4(this[1],this[1],this[2],this[3])}get yywx(){return new this._Vec4(this[1],this[1],this[3],this[0])}get yywy(){return new this._Vec4(this[1],this[1],this[3],this[1])}get yywz(){return new this._Vec4(this[1],this[1],this[3],this[2])}get yyww(){return new this._Vec4(this[1],this[1],this[3],this[3])}get yzxx(){return new this._Vec4(this[1],this[2],this[0],this[0])}get yzxy(){return new this._Vec4(this[1],this[2],this[0],this[1])}get yzxz(){return new this._Vec4(this[1],this[2],this[0],this[2])}get yzxw(){return new this._Vec4(this[1],this[2],this[0],this[3])}get yzyx(){return new this._Vec4(this[1],this[2],this[1],this[0])}get yzyy(){return new this._Vec4(this[1],this[2],this[1],this[1])}get yzyz(){return new this._Vec4(this[1],this[2],this[1],this[2])}get yzyw(){return new this._Vec4(this[1],this[2],this[1],this[3])}get yzzx(){return new this._Vec4(this[1],this[2],this[2],this[0])}get yzzy(){return new this._Vec4(this[1],this[2],this[2],this[1])}get yzzz(){return new this._Vec4(this[1],this[2],this[2],this[2])}get yzzw(){return new this._Vec4(this[1],this[2],this[2],this[3])}get yzwx(){return new this._Vec4(this[1],this[2],this[3],this[0])}get yzwy(){return new this._Vec4(this[1],this[2],this[3],this[1])}get yzwz(){return new this._Vec4(this[1],this[2],this[3],this[2])}get yzww(){return new this._Vec4(this[1],this[2],this[3],this[3])}get ywxx(){return new this._Vec4(this[1],this[3],this[0],this[0])}get ywxy(){return new this._Vec4(this[1],this[3],this[0],this[1])}get ywxz(){return new this._Vec4(this[1],this[3],this[0],this[2])}get ywxw(){return new this._Vec4(this[1],this[3],this[0],this[3])}get ywyx(){return new this._Vec4(this[1],this[3],this[1],this[0])}get ywyy(){return new this._Vec4(this[1],this[3],this[1],this[1])}get ywyz(){return new this._Vec4(this[1],this[3],this[1],this[2])}get ywyw(){return new this._Vec4(this[1],this[3],this[1],this[3])}get ywzx(){return new this._Vec4(this[1],this[3],this[2],this[0])}get ywzy(){return new this._Vec4(this[1],this[3],this[2],this[1])}get ywzz(){return new this._Vec4(this[1],this[3],this[2],this[2])}get ywzw(){return new this._Vec4(this[1],this[3],this[2],this[3])}get ywwx(){return new this._Vec4(this[1],this[3],this[3],this[0])}get ywwy(){return new this._Vec4(this[1],this[3],this[3],this[1])}get ywwz(){return new this._Vec4(this[1],this[3],this[3],this[2])}get ywww(){return new this._Vec4(this[1],this[3],this[3],this[3])}get zxxx(){return new this._Vec4(this[2],this[0],this[0],this[0])}get zxxy(){return new this._Vec4(this[2],this[0],this[0],this[1])}get zxxz(){return new this._Vec4(this[2],this[0],this[0],this[2])}get zxxw(){return new this._Vec4(this[2],this[0],this[0],this[3])}get zxyx(){return new this._Vec4(this[2],this[0],this[1],this[0])}get zxyy(){return new this._Vec4(this[2],this[0],this[1],this[1])}get zxyz(){return new this._Vec4(this[2],this[0],this[1],this[2])}get zxyw(){return new this._Vec4(this[2],this[0],this[1],this[3])}get zxzx(){return new this._Vec4(this[2],this[0],this[2],this[0])}get zxzy(){return new this._Vec4(this[2],this[0],this[2],this[1])}get zxzz(){return new this._Vec4(this[2],this[0],this[2],this[2])}get zxzw(){return new this._Vec4(this[2],this[0],this[2],this[3])}get zxwx(){return new this._Vec4(this[2],this[0],this[3],this[0])}get zxwy(){return new this._Vec4(this[2],this[0],this[3],this[1])}get zxwz(){return new this._Vec4(this[2],this[0],this[3],this[2])}get zxww(){return new this._Vec4(this[2],this[0],this[3],this[3])}get zyxx(){return new this._Vec4(this[2],this[1],this[0],this[0])}get zyxy(){return new this._Vec4(this[2],this[1],this[0],this[1])}get zyxz(){return new this._Vec4(this[2],this[1],this[0],this[2])}get zyxw(){return new this._Vec4(this[2],this[1],this[0],this[3])}get zyyx(){return new this._Vec4(this[2],this[1],this[1],this[0])}get zyyy(){return new this._Vec4(this[2],this[1],this[1],this[1])}get zyyz(){return new this._Vec4(this[2],this[1],this[1],this[2])}get zyyw(){return new this._Vec4(this[2],this[1],this[1],this[3])}get zyzx(){return new this._Vec4(this[2],this[1],this[2],this[0])}get zyzy(){return new this._Vec4(this[2],this[1],this[2],this[1])}get zyzz(){return new this._Vec4(this[2],this[1],this[2],this[2])}get zyzw(){return new this._Vec4(this[2],this[1],this[2],this[3])}get zywx(){return new this._Vec4(this[2],this[1],this[3],this[0])}get zywy(){return new this._Vec4(this[2],this[1],this[3],this[1])}get zywz(){return new this._Vec4(this[2],this[1],this[3],this[2])}get zyww(){return new this._Vec4(this[2],this[1],this[3],this[3])}get zzxx(){return new this._Vec4(this[2],this[2],this[0],this[0])}get zzxy(){return new this._Vec4(this[2],this[2],this[0],this[1])}get zzxz(){return new this._Vec4(this[2],this[2],this[0],this[2])}get zzxw(){return new this._Vec4(this[2],this[2],this[0],this[3])}get zzyx(){return new this._Vec4(this[2],this[2],this[1],this[0])}get zzyy(){return new this._Vec4(this[2],this[2],this[1],this[1])}get zzyz(){return new this._Vec4(this[2],this[2],this[1],this[2])}get zzyw(){return new this._Vec4(this[2],this[2],this[1],this[3])}get zzzx(){return new this._Vec4(this[2],this[2],this[2],this[0])}get zzzy(){return new this._Vec4(this[2],this[2],this[2],this[1])}get zzzz(){return new this._Vec4(this[2],this[2],this[2],this[2])}get zzzw(){return new this._Vec4(this[2],this[2],this[2],this[3])}get zzwx(){return new this._Vec4(this[2],this[2],this[3],this[0])}get zzwy(){return new this._Vec4(this[2],this[2],this[3],this[1])}get zzwz(){return new this._Vec4(this[2],this[2],this[3],this[2])}get zzww(){return new this._Vec4(this[2],this[2],this[3],this[3])}get zwxx(){return new this._Vec4(this[2],this[3],this[0],this[0])}get zwxy(){return new this._Vec4(this[2],this[3],this[0],this[1])}get zwxz(){return new this._Vec4(this[2],this[3],this[0],this[2])}get zwxw(){return new this._Vec4(this[2],this[3],this[0],this[3])}get zwyx(){return new this._Vec4(this[2],this[3],this[1],this[0])}get zwyy(){return new this._Vec4(this[2],this[3],this[1],this[1])}get zwyz(){return new this._Vec4(this[2],this[3],this[1],this[2])}get zwyw(){return new this._Vec4(this[2],this[3],this[1],this[3])}get zwzx(){return new this._Vec4(this[2],this[3],this[2],this[0])}get zwzy(){return new this._Vec4(this[2],this[3],this[2],this[1])}get zwzz(){return new this._Vec4(this[2],this[3],this[2],this[2])}get zwzw(){return new this._Vec4(this[2],this[3],this[2],this[3])}get zwwx(){return new this._Vec4(this[2],this[3],this[3],this[0])}get zwwy(){return new this._Vec4(this[2],this[3],this[3],this[1])}get zwwz(){return new this._Vec4(this[2],this[3],this[3],this[2])}get zwww(){return new this._Vec4(this[2],this[3],this[3],this[3])}get wxxx(){return new this._Vec4(this[3],this[0],this[0],this[0])}get wxxy(){return new this._Vec4(this[3],this[0],this[0],this[1])}get wxxz(){return new this._Vec4(this[3],this[0],this[0],this[2])}get wxxw(){return new this._Vec4(this[3],this[0],this[0],this[3])}get wxyx(){return new this._Vec4(this[3],this[0],this[1],this[0])}get wxyy(){return new this._Vec4(this[3],this[0],this[1],this[1])}get wxyz(){return new this._Vec4(this[3],this[0],this[1],this[2])}get wxyw(){return new this._Vec4(this[3],this[0],this[1],this[3])}get wxzx(){return new this._Vec4(this[3],this[0],this[2],this[0])}get wxzy(){return new this._Vec4(this[3],this[0],this[2],this[1])}get wxzz(){return new this._Vec4(this[3],this[0],this[2],this[2])}get wxzw(){return new this._Vec4(this[3],this[0],this[2],this[3])}get wxwx(){return new this._Vec4(this[3],this[0],this[3],this[0])}get wxwy(){return new this._Vec4(this[3],this[0],this[3],this[1])}get wxwz(){return new this._Vec4(this[3],this[0],this[3],this[2])}get wxww(){return new this._Vec4(this[3],this[0],this[3],this[3])}get wyxx(){return new this._Vec4(this[3],this[1],this[0],this[0])}get wyxy(){return new this._Vec4(this[3],this[1],this[0],this[1])}get wyxz(){return new this._Vec4(this[3],this[1],this[0],this[2])}get wyxw(){return new this._Vec4(this[3],this[1],this[0],this[3])}get wyyx(){return new this._Vec4(this[3],this[1],this[1],this[0])}get wyyy(){return new this._Vec4(this[3],this[1],this[1],this[1])}get wyyz(){return new this._Vec4(this[3],this[1],this[1],this[2])}get wyyw(){return new this._Vec4(this[3],this[1],this[1],this[3])}get wyzx(){return new this._Vec4(this[3],this[1],this[2],this[0])}get wyzy(){return new this._Vec4(this[3],this[1],this[2],this[1])}get wyzz(){return new this._Vec4(this[3],this[1],this[2],this[2])}get wyzw(){return new this._Vec4(this[3],this[1],this[2],this[3])}get wywx(){return new this._Vec4(this[3],this[1],this[3],this[0])}get wywy(){return new this._Vec4(this[3],this[1],this[3],this[1])}get wywz(){return new this._Vec4(this[3],this[1],this[3],this[2])}get wyww(){return new this._Vec4(this[3],this[1],this[3],this[3])}get wzxx(){return new this._Vec4(this[3],this[2],this[0],this[0])}get wzxy(){return new this._Vec4(this[3],this[2],this[0],this[1])}get wzxz(){return new this._Vec4(this[3],this[2],this[0],this[2])}get wzxw(){return new this._Vec4(this[3],this[2],this[0],this[3])}get wzyx(){return new this._Vec4(this[3],this[2],this[1],this[0])}get wzyy(){return new this._Vec4(this[3],this[2],this[1],this[1])}get wzyz(){return new this._Vec4(this[3],this[2],this[1],this[2])}get wzyw(){return new this._Vec4(this[3],this[2],this[1],this[3])}get wzzx(){return new this._Vec4(this[3],this[2],this[2],this[0])}get wzzy(){return new this._Vec4(this[3],this[2],this[2],this[1])}get wzzz(){return new this._Vec4(this[3],this[2],this[2],this[2])}get wzzw(){return new this._Vec4(this[3],this[2],this[2],this[3])}get wzwx(){return new this._Vec4(this[3],this[2],this[3],this[0])}get wzwy(){return new this._Vec4(this[3],this[2],this[3],this[1])}get wzwz(){return new this._Vec4(this[3],this[2],this[3],this[2])}get wzww(){return new this._Vec4(this[3],this[2],this[3],this[3])}get wwxx(){return new this._Vec4(this[3],this[3],this[0],this[0])}get wwxy(){return new this._Vec4(this[3],this[3],this[0],this[1])}get wwxz(){return new this._Vec4(this[3],this[3],this[0],this[2])}get wwxw(){return new this._Vec4(this[3],this[3],this[0],this[3])}get wwyx(){return new this._Vec4(this[3],this[3],this[1],this[0])}get wwyy(){return new this._Vec4(this[3],this[3],this[1],this[1])}get wwyz(){return new this._Vec4(this[3],this[3],this[1],this[2])}get wwyw(){return new this._Vec4(this[3],this[3],this[1],this[3])}get wwzx(){return new this._Vec4(this[3],this[3],this[2],this[0])}get wwzy(){return new this._Vec4(this[3],this[3],this[2],this[1])}get wwzz(){return new this._Vec4(this[3],this[3],this[2],this[2])}get wwzw(){return new this._Vec4(this[3],this[3],this[2],this[3])}get wwwx(){return new this._Vec4(this[3],this[3],this[3],this[0])}get wwwy(){return new this._Vec4(this[3],this[3],this[3],this[1])}get wwwz(){return new this._Vec4(this[3],this[3],this[3],this[2])}get wwww(){return new this._Vec4(this[3],this[3],this[3],this[3])}},c=class extends v{constructor(s,i){var h;super(2);r(this,0);r(this,1);this[0]=s!=null?s:0,this[1]=(h=i!=null?i:s)!=null?h:0}get x(){return this[0]}get y(){return this[1]}set x(s){this[0]=s}set y(s){this[1]=s}},g=class extends v{constructor(s,i,h){var n,w;super(3);r(this,0);r(this,1);r(this,2);this[0]=s!=null?s:0,this[1]=(n=i!=null?i:s)!=null?n:0,this[2]=(w=h!=null?h:s)!=null?w:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(s){this[0]=s}set y(s){this[1]=s}set z(s){this[2]=s}},y=class extends v{constructor(s,i,h,n){var w,P,A;super(4);r(this,0);r(this,1);r(this,2);r(this,3);this[0]=s!=null?s:0,this[1]=(w=i!=null?i:s)!=null?w:0,this[2]=(P=h!=null?h:s)!=null?P:0,this[3]=(A=n!=null?n:s)!=null?A:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(s){this[0]=s}set y(s){this[1]=s}set z(s){this[2]=s}set w(s){this[3]=s}},x=class e extends c{get kind(){return"vec2f"}get _Vec2(){return e}get _Vec3(){return m}get _Vec4(){return p}},o=class e extends c{get kind(){return"vec2h"}get _Vec2(){return e}get _Vec3(){return z}get _Vec4(){return b}},V=class e extends c{get kind(){return"vec2i"}get _Vec2(){return e}get _Vec3(){return a}get _Vec4(){return f}},_=class e extends c{get kind(){return"vec2u"}get _Vec2(){return e}get _Vec3(){return l}get _Vec4(){return d}},m=class e extends g{get kind(){return"vec3f"}get _Vec2(){return x}get _Vec3(){return e}get _Vec4(){return p}},z=class e extends g{get kind(){return"vec3h"}get _Vec2(){return o}get _Vec3(){return e}get _Vec4(){return b}},a=class e extends g{get kind(){return"vec3i"}get _Vec2(){return V}get _Vec3(){return e}get _Vec4(){return f}},l=class e extends g{get kind(){return"vec3u"}get _Vec2(){return _}get _Vec3(){return e}get _Vec4(){return d}},p=class e extends y{get kind(){return"vec4f"}get _Vec2(){return x}get _Vec3(){return m}get _Vec4(){return e}},b=class e extends y{get kind(){return"vec4h"}get _Vec2(){return o}get _Vec3(){return z}get _Vec4(){return e}},f=class e extends y{get kind(){return"vec4i"}get _Vec2(){return V}get _Vec3(){return a}get _Vec4(){return e}},d=class e extends y{get kind(){return"vec4u"}get _Vec2(){return _}get _Vec3(){return l}get _Vec4(){return e}};function u(e){let{kind:t,length:s}=new e;return Object.assign((...h)=>{let n=h;if(k())return`${t}(${n.join(", ")})`;if(n.length<=1||n.length===s)return new e(...n);throw new Error(`'${t}' constructor called with invalid number of arguments.`)},{type:t,"~repr":void 0})}var q=u(x),xt= exports.o =u(o),ot= exports.p =u(V),Vt= exports.q =u(_),H= exports.r =u(m),_t= exports.s =u(z),mt= exports.t =u(a),zt= exports.u =u(l),J= exports.v =u(p),at= exports.w =u(b),lt= exports.x =u(f),pt= exports.y =u(d);function E(e){let t={"~repr":void 0,type:e.type,label:e.type};return Object.assign((...i)=>{if(k())return`${t.type}(${i.join(", ")})`;let h=[];for(let n of i)if(typeof n=="number")h.push(n);else for(let w=0;w<n.length;++w)h.push(n[w]);for(let n=h.length;n<e.columns*e.rows;++n)h.push(0);return e.makeFromElements(...h)},t)}var O=class{constructor(...t){r(this,"columns");r(this,"length",4);this.columns=[this.makeColumn(t[0],t[1]),this.makeColumn(t[2],t[3])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[1].x}get 3(){return this.columns[1].y}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[1].x=t}set 3(t){this.columns[1].y=t}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,s)=>this[s]).join(", ")})`}},j=class extends O{constructor(){super(...arguments);r(this,"kind","mat2x2f")}makeColumn(s,i){return q(s,i)}},M=class{constructor(...t){r(this,"columns");r(this,"length",12);this.columns=[this.makeColumn(t[0],t[1],t[2]),this.makeColumn(t[3],t[4],t[5]),this.makeColumn(t[6],t[7],t[8])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return 0}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return 0}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return 0}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){}"~resolve"(){return`${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`}},S=class extends M{constructor(){super(...arguments);r(this,"kind","mat3x3f")}makeColumn(s,i,h){return H(s,i,h)}},B=class{constructor(...t){r(this,"columns");r(this,"length",16);this.columns=[this.makeColumn(t[0],t[1],t[2],t[3]),this.makeColumn(t[4],t[5],t[6],t[7]),this.makeColumn(t[8],t[9],t[10],t[11]),this.makeColumn(t[12],t[13],t[14],t[15])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return this.columns[0].w}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return this.columns[1].w}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return this.columns[2].w}get 12(){return this.columns[3].x}get 13(){return this.columns[3].y}get 14(){return this.columns[3].z}get 15(){return this.columns[3].w}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){this.columns[0].w=t}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){this.columns[1].w=t}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){this.columns[2].w=t}set 12(t){this.columns[3].x=t}set 13(t){this.columns[3].y=t}set 14(t){this.columns[3].z=t}set 15(t){this.columns[3].w=t}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,s)=>this[s]).join(", ")})`}},R=class extends B{constructor(){super(...arguments);r(this,"kind","mat4x4f")}makeColumn(s,i,h,n){return J(s,i,h,n)}},Tt= exports.z =E({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...e)=>new j(...e)}),vt= exports.A =E({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...e)=>new S(...e)}),kt= exports.B =E({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...e)=>new R(...e)});function Ct(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,s)=>e[s])}exports.a = tt; exports.b = et; exports.c = r; exports.d = N; exports.e = D; exports.f = F; exports.g = K; exports.h = U; exports.i = L; exports.j = W; exports.k = nt; exports.l = rt; exports.m = k; exports.n = q; exports.o = xt; exports.p = ot; exports.q = Vt; exports.r = H; exports.s = _t; exports.t = mt; exports.u = zt; exports.v = J; exports.w = at; exports.x = lt; exports.y = pt; exports.z = Tt; exports.A = vt; exports.B = kt; exports.C = Ct;
4
- //# sourceMappingURL=chunk-DEMK5MOR.cjs.map
4
+ //# sourceMappingURL=chunk-7X4KDNDZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/iwo/Projects/wigsill/packages/typegpu/dist/chunk-7X4KDNDZ.cjs","../src/errors.ts"],"names":["prefix","invariant","condition","message","ResolutionError","_ResolutionError","cause","trace","entries","ancestor"],"mappings":"AAAA,6EAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,aAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CCO9d,IAAMA,CAAAA,CAAS,kBAAA,CAKR,SAASC,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACmB,CACnB,EAAA,CAAID,CAAAA,CAEF,MAAA,CAKA,MAAM,IAAI,KAAA,CAAMF,CAAM,CAa1B,CASO,IAAMI,CAAAA,CAAN,MAAMC,EAAAA,QAAwB,KAAM,CACzC,WAAA,CACkBC,CAAAA,CACAC,CAAAA,CAChB,CACA,IAAIC,CAAAA,CAAUD,CAAAA,CAAM,GAAA,CAAKE,CAAAA,EAAa,CAAA,EAAA,EAAKA,CAAQ,CAAA,CAAA;AAOc;AA0C6C","file":"/Users/iwo/Projects/wigsill/packages/typegpu/dist/chunk-7X4KDNDZ.cjs","sourcesContent":[null,"import type { TgpuBuffer } from './core/buffer/buffer';\nimport type { TgpuSlot } from './core/slot/slotTypes';\nimport type { TgpuVertexLayout } from './core/vertexLayout/vertexLayout';\nimport type { AnyData, Disarray } from './data/dataTypes';\nimport type { WgslArray } from './data/wgslTypes';\nimport type { TgpuBindGroupLayout } from './tgpuBindGroupLayout';\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 MissingBindGroupsError extends Error {\n constructor(layouts: Iterable<TgpuBindGroupLayout>) {\n super(\n `Missing bind groups for layouts: '${[...layouts].map((layout) => layout.label ?? '<unnamed>').join(', ')}'. Please provide it using pipeline.with(layout, bindGroup).(...)`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingBindGroupsError.prototype);\n }\n}\n\nexport class MissingVertexBuffersError extends Error {\n constructor(layouts: Iterable<TgpuVertexLayout<WgslArray | Disarray>>) {\n super(\n `Missing vertex buffers for layouts: '${[...layouts].map((layout) => layout.label ?? '<unnamed>').join(', ')}'. Please provide it using pipeline.with(layout, buffer).(...)`,\n );\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingVertexBuffersError.prototype);\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk7X4KDNDZcjs = require('./chunk-7X4KDNDZ.cjs');var _typedbinary = require('typed-binary'); var _typedbinary2 = _interopRequireDefault(_typedbinary);var re={type:"bool"},ne=e=>_chunk7X4KDNDZcjs.m.call(void 0, )?`u32(${e})`:typeof e=="boolean"?e?1:0:Number.isInteger(e)?((e<0||e>4294967295)&&console.warn(`u32 value ${e} overflowed`),(e&4294967295)>>>0):Math.max(0,Math.min(4294967295,Math.floor(e))),y= exports.u =Object.assign(ne,{type:"u32"}),oe=e=>{if(_chunk7X4KDNDZcjs.m.call(void 0, ))return`i32(${e})`;if(typeof e=="boolean")return e?1:0;if(Number.isInteger(e))return(e<-2147483648||e>2147483647)&&console.warn(`i32 value ${e} overflowed`),(e|0)&4294967295;let t=e<0?Math.ceil(e):Math.floor(e);return Math.max(-2147483648,Math.min(2147483647,t))},h= exports.v =Object.assign(oe,{type:"i32"}),ae=e=>{if(_chunk7X4KDNDZcjs.m.call(void 0, ))return`f32(${e})`;if(typeof e=="boolean")return e?1:0;let t=new Float32Array(1);return t[0]=e,t[0]},x= exports.w =Object.assign(ae,{type:"f32"}),ie=e=>{if(_chunk7X4KDNDZcjs.m.call(void 0, ))return`f16(${e})`;if(typeof e=="boolean")return e?1:0;let t=new ArrayBuffer(2);return _typedbinary2.default.f16.write(new _typedbinary2.default.BufferWriter(t),e),_typedbinary2.default.f16.read(new _typedbinary2.default.BufferReader(t))},ye= exports.x =Object.assign(ie,{type:"f16"});var le=["bool","f32","f16","i32","u32","vec2f","vec2h","vec2i","vec2u","vec3f","vec3h","vec3i","vec3u","vec4f","vec4h","vec4i","vec4u","mat2x2f","mat3x3f","mat4x4f","struct","array","ptrFn","atomic","decorated"];function S(e){return le.includes(e==null?void 0:e.type)}function k(e){return(e==null?void 0:e.type)==="array"}function L(e){return(e==null?void 0:e.type)==="struct"}function xe(e){return(e==null?void 0:e.type)==="ptrFn"}function se(e){return(e==null?void 0:e.type)==="atomic"}function P(e){return(e==null?void 0:e.type)==="@align"}function _(e){return(e==null?void 0:e.type)==="@size"}function R(e){return(e==null?void 0:e.type)==="@location"}function ue(e){return(e==null?void 0:e.type)==="@interpolate"}function $(e){return(e==null?void 0:e.type)==="@builtin"}function m(e){return(e==null?void 0:e.type)==="decorated"}function de(e){let t=n=>n;return Object.setPrototypeOf(t,me),t.propTypes=e,t}var me={type:"struct",_label:void 0,get label(){return this._label},$name(e){return this._label=e,this},toString(){var e;return`struct:${(e=this.label)!=null?e:"<unnamed>"}`}};var b=(e,t)=>{let n=t-1,a=~n;return e&n?(e&a)+t:e};var Q=["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"],Re= exports.m ={f32:"float32",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",f16:"float16",vec2h:"float16x2",vec4h:"float16x4",u32:"uint32",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",i32:"sint32",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4"};var Te=["unstruct","disarray","loose-decorated",...Q];function C(e){return Te.includes(e==null?void 0:e.type)}function w(e){return(e==null?void 0:e.type)==="disarray"}function z(e){return(e==null?void 0:e.type)==="unstruct"}function d(e){return(e==null?void 0:e.type)==="loose-decorated"}function g(e){var t,n;return(n=(t=e.attribs)==null?void 0:t.find(P))==null?void 0:n.value}function X(e){var t,n;return(n=(t=e.attribs)==null?void 0:t.find(_))==null?void 0:n.value}function Ge(e){var t,n;return(n=(t=e.attribs)==null?void 0:t.find(R))==null?void 0:n.value}function ce(e){return S(e)||C(e)}var r=class{constructor(t){this.type=t;_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr")}},fe= exports.A ={uint8:y,uint8x2:_chunk7X4KDNDZcjs.q,uint8x4:_chunk7X4KDNDZcjs.y,sint8:h,sint8x2:_chunk7X4KDNDZcjs.p,sint8x4:_chunk7X4KDNDZcjs.x,unorm8:x,unorm8x2:_chunk7X4KDNDZcjs.n,unorm8x4:_chunk7X4KDNDZcjs.v,snorm8:x,snorm8x2:_chunk7X4KDNDZcjs.n,snorm8x4:_chunk7X4KDNDZcjs.v,uint16:y,uint16x2:_chunk7X4KDNDZcjs.q,uint16x4:_chunk7X4KDNDZcjs.y,sint16:h,sint16x2:_chunk7X4KDNDZcjs.p,sint16x4:_chunk7X4KDNDZcjs.x,unorm16:x,unorm16x2:_chunk7X4KDNDZcjs.n,unorm16x4:_chunk7X4KDNDZcjs.v,snorm16:x,snorm16x2:_chunk7X4KDNDZcjs.n,snorm16x4:_chunk7X4KDNDZcjs.v,float16:x,float16x2:_chunk7X4KDNDZcjs.n,float16x4:_chunk7X4KDNDZcjs.v,float32:x,float32x2:_chunk7X4KDNDZcjs.n,float32x3:_chunk7X4KDNDZcjs.r,float32x4:_chunk7X4KDNDZcjs.v,uint32:y,uint32x2:_chunk7X4KDNDZcjs.q,uint32x3:_chunk7X4KDNDZcjs.u,uint32x4:_chunk7X4KDNDZcjs.y,sint32:h,sint32x2:_chunk7X4KDNDZcjs.p,sint32x3:_chunk7X4KDNDZcjs.t,sint32x4:_chunk7X4KDNDZcjs.x,"unorm10-10-10-2":_chunk7X4KDNDZcjs.v,"unorm8x4-bgra":_chunk7X4KDNDZcjs.v},Y= exports.B =Object.keys(fe),qe= exports.C =new r("uint8"),Qe= exports.D =new r("uint8x2"),Xe= exports.E =new r("uint8x4"),Ye= exports.F =new r("sint8"),Ze= exports.G =new r("sint8x2"),et= exports.H =new r("sint8x4"),tt= exports.I =new r("unorm8"),rt= exports.J =new r("unorm8x2"),nt= exports.K =new r("unorm8x4"),ot= exports.L =new r("snorm8"),at= exports.M =new r("snorm8x2"),it= exports.N =new r("snorm8x4"),yt= exports.O =new r("uint16"),lt= exports.P =new r("uint16x2"),xt= exports.Q =new r("uint16x4"),st= exports.R =new r("sint16"),ut= exports.S =new r("sint16x2"),pt= exports.T =new r("sint16x4"),dt= exports.U =new r("unorm16"),mt= exports.V =new r("unorm16x2"),Tt= exports.W =new r("unorm16x4"),ct= exports.X =new r("snorm16"),ft= exports.Y =new r("snorm16x2"),bt= exports.Z =new r("snorm16x4"),wt= exports._ =new r("float16"),zt= exports.$ =new r("float16x2"),gt= exports.aa =new r("float16x4"),vt= exports.ba =new r("float32"),Dt= exports.ca =new r("float32x2"),It= exports.da =new r("float32x3"),At= exports.ea =new r("float32x4"),Vt= exports.fa =new r("uint32"),Bt= exports.ga =new r("uint32x2"),Ft= exports.ha =new r("uint32x3"),ht= exports.ia =new r("uint32x4"),St= exports.ja =new r("sint32"),kt= exports.ka =new r("sint32x2"),Lt= exports.la =new r("sint32x3"),Pt= exports.ma =new r("sint32x4"),_t= exports.na =new r("unorm10-10-10-2"),Wt= exports.oa =new r("unorm8x4-bgra");var be={bool:4,f32:4,f16:2,i32:4,u32:4,vec2f:8,vec2h:4,vec2i:8,vec2u:8,vec3f:16,vec3h:8,vec3i:16,vec3u:16,vec4f:16,vec4h:8,vec4i:16,vec4u:16,mat2x2f:8,mat3x3f:16,mat4x4f:16,atomic:4};function we(e){var a,p,D;let t=e==null?void 0:e.type,n=be[t];if(n!==void 0)return n;if(L(e))return Object.values(e.propTypes).map(s).reduce((T,q)=>T>q?T:q);if(k(e))return s(e.elementType);if(z(e)){let T=Object.values(e.propTypes)[0];return T&&(a=g(T))!=null?a:1}if(w(e))return(p=g(e.elementType))!=null?p:1;if(m(e)||d(e))return(D=g(e))!=null?D:s(e.inner);if(Y.includes(t))return 1;throw new Error(`Cannot determine alignment of data: ${JSON.stringify(e)}`)}function ze(e){var t,n;if(z(e)){let a=Object.values(e.propTypes)[0];return a?v(a):1}return w(e)?v(e.elementType):d(e)?(t=g(e))!=null?t:v(e.inner):(n=g(e))!=null?n:1}var Z=new WeakMap,ee=new WeakMap;function s(e){let t=Z.get(e);return t===void 0&&(t=we(e),Z.set(e,t)),t}function v(e){let t=ee.get(e);return t===void 0&&(t=ze(e),ee.set(e,t)),t}function ge(e){return s(e)}var ve={bool:4,f32:4,f16:2,i32:4,u32:4,vec2f:8,vec2h:4,vec2i:8,vec2u:8,vec3f:12,vec3h:6,vec3i:12,vec3u:12,vec4f:16,vec4h:8,vec4i:16,vec4u:16,mat2x2f:16,mat3x3f:48,mat4x4f:64,uint8:1,uint8x2:2,uint8x4:4,sint8:1,sint8x2:2,sint8x4:4,unorm8:1,unorm8x2:2,unorm8x4:4,snorm8:1,snorm8x2:2,snorm8x4:4,uint16:2,uint16x2:4,uint16x4:8,sint16:2,sint16x2:4,sint16x4:8,unorm16:2,unorm16x2:4,unorm16x4:8,snorm16:2,snorm16x2:4,snorm16x4:8,float16:2,float16x2:4,float16x4:8,float32:4,float32x2:8,float32x3:12,float32x4:16,uint32:4,uint32x2:8,uint32x3:12,uint32x4:16,sint32:4,sint32x2:8,sint32x3:12,sint32x4:16,"unorm10-10-10-2":4,"unorm8x4-bgra":4,atomic:4};function De(e){let t=0;for(let n of Object.values(e.propTypes)){if(Number.isNaN(t))throw new Error("Only the last property of a struct can be unbounded");if(t=b(t,s(n)),t+=u(n),Number.isNaN(t)&&n.type!=="array")throw new Error("Cannot nest unbounded struct within another struct")}return b(t,s(e))}function Ie(e){let t=0;for(let n of Object.values(e.propTypes)){let a=v(n);t=b(t,a),t+=u(n)}return t}function Ae(e){var n;let t=ve[e==null?void 0:e.type];if(t!==void 0)return t;if(L(e))return De(e);if(z(e))return Ie(e);if(k(e)){if(e.elementCount===0)return Number.NaN;let a=s(e.elementType);return b(u(e.elementType),a)*e.elementCount}if(w(e)){let a=v(e.elementType);return b(u(e.elementType),a)*e.elementCount}if(m(e)||d(e))return(n=X(e))!=null?n:u(e.inner);throw new Error(`Cannot determine size of data: ${e}`)}var te=new WeakMap;function u(e){let t=te.get(e);return t===void 0&&(t=Ae(e),te.set(e,t)),t}function Ve(e){return u(e)}function G(e,t){return new j(e,t)}var j=class{constructor(t,n){this.elementType=t;this.elementCount=n;_chunk7X4KDNDZcjs.c.call(void 0, this,"type","array");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~reprPartial");_chunk7X4KDNDZcjs.c.call(void 0, this,"~memIdent");if(Number.isNaN(u(t)))throw new Error("Cannot nest runtime sized arrays.");if(!Number.isInteger(n)||n<0)throw new Error(`Cannot create array schema with invalid element count: ${n}.`)}toString(){return`arrayOf(${this.elementType})`}};function Be(e){return{type:"ptrFn",inner:e}}function Fe(e,t){return new K(e,t)}var K=class{constructor(t,n){this.elementType=t;this.elementCount=n;_chunk7X4KDNDZcjs.c.call(void 0, this,"type","disarray");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~reprPartial");if(!Number.isInteger(n)||n<0)throw new Error(`Cannot create disarray schema with invalid element count: ${n}.`)}};function he(e){return new H(e)}var H=class{constructor(t){this.propTypes=t;_chunk7X4KDNDZcjs.c.call(void 0, this,"_label");_chunk7X4KDNDZcjs.c.call(void 0, this,"type","unstruct");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~reprPartial")}get label(){return this._label}$name(t){return this._label=t,this}};function Se(e){return new J(e)}var J=class{constructor(t){this.inner=t;_chunk7X4KDNDZcjs.c.call(void 0, this,"type","atomic");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~memIdent")}};function i(e,t){return m(e)?new U(e.inner,[t,...e.attribs]):d(e)?new O(e.inner,[t,...e.attribs]):C(e)?new O(e,[t]):new U(e,[t])}function ke(e,t){return i(t,{type:"@align",value:e})}function Le(e,t){return i(t,{type:"@size",value:e})}function Pe(e,t){return i(t,{type:"@location",value:e})}function _e(e,t){return i(t,{type:"@interpolate",value:e})}function We(e){return(m(e)||d(e))&&e.attribs.find($)!==void 0}function yr(e){return!m(e)&&!d(e)?"":e.attribs.map(t=>`${t.type}(${t.value}) `).join("")}var M=class{constructor(t,n){this.inner=t;this.attribs=n;_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");var D,T;let a=(D=n.find(P))==null?void 0:D.value,p=(T=n.find(_))==null?void 0:T.value;if(a!==void 0){if(a<=0)throw new Error(`Custom data alignment must be a positive number, got: ${a}.`);if(Math.log2(a)%1!==0)throw new Error(`Alignment has to be a power of 2, got: ${a}.`);if(S(this.inner)&&a%s(this.inner)!==0)throw new Error(`Custom alignment has to be a multiple of the standard data alignment. Got: ${a}, expected multiple of: ${s(this.inner)}.`)}if(p!==void 0){if(p<u(this.inner))throw new Error(`Custom data size cannot be smaller then the standard data size. Got: ${p}, expected at least: ${u(this.inner)}.`);if(p<=0)throw new Error(`Custom data size must be a positive number. Got: ${p}.`)}}},U=class extends M{constructor(){super(...arguments);_chunk7X4KDNDZcjs.c.call(void 0, this,"type","decorated");_chunk7X4KDNDZcjs.c.call(void 0, this,"~memIdent")}},O=class extends M{constructor(){super(...arguments);_chunk7X4KDNDZcjs.c.call(void 0, this,"type","loose-decorated")}};var Ce={vertexIndex:i(y,{type:"@builtin",value:"vertex_index"}),instanceIndex:i(y,{type:"@builtin",value:"instance_index"}),position:i(_chunk7X4KDNDZcjs.v,{type:"@builtin",value:"position"}),clipDistances:i(G(y,8),{type:"@builtin",value:"clip_distances"}),frontFacing:i(x,{type:"@builtin",value:"front_facing"}),fragDepth:i(x,{type:"@builtin",value:"frag_depth"}),sampleIndex:i(y,{type:"@builtin",value:"sample_index"}),sampleMask:i(y,{type:"@builtin",value:"sample_mask"}),localInvocationId:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"local_invocation_id"}),localInvocationIndex:i(y,{type:"@builtin",value:"local_invocation_index"}),globalInvocationId:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"global_invocation_id"}),workgroupId:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"workgroup_id"}),numWorkgroups:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"num_workgroups"}),subgroupInvocationId:i(y,{type:"@builtin",value:"subgroup_invocation_id"}),subgroupSize:i(y,{type:"@builtin",value:"subgroup_size"})};exports.a = S; exports.b = k; exports.c = L; exports.d = xe; exports.e = se; exports.f = P; exports.g = _; exports.h = R; exports.i = ue; exports.j = $; exports.k = m; exports.l = Q; exports.m = Re; exports.n = C; exports.o = w; exports.p = z; exports.q = d; exports.r = Ge; exports.s = ce; exports.t = re; exports.u = y; exports.v = h; exports.w = x; exports.x = ye; exports.y = de; exports.z = b; exports.A = fe; exports.B = Y; exports.C = qe; exports.D = Qe; exports.E = Xe; exports.F = Ye; exports.G = Ze; exports.H = et; exports.I = tt; exports.J = rt; exports.K = nt; exports.L = ot; exports.M = at; exports.N = it; exports.O = yt; exports.P = lt; exports.Q = xt; exports.R = st; exports.S = ut; exports.T = pt; exports.U = dt; exports.V = mt; exports.W = Tt; exports.X = ct; exports.Y = ft; exports.Z = bt; exports._ = wt; exports.$ = zt; exports.aa = gt; exports.ba = vt; exports.ca = Dt; exports.da = It; exports.ea = At; exports.fa = Vt; exports.ga = Bt; exports.ha = Ft; exports.ia = ht; exports.ja = St; exports.ka = kt; exports.la = Lt; exports.ma = Pt; exports.na = _t; exports.oa = Wt; exports.pa = s; exports.qa = v; exports.ra = ge; exports.sa = u; exports.ta = Ve; exports.ua = G; exports.va = Be; exports.wa = Fe; exports.xa = he; exports.ya = Se; exports.za = i; exports.Aa = ke; exports.Ba = Le; exports.Ca = Pe; exports.Da = _e; exports.Ea = We; exports.Fa = yr; exports.Ga = Ce;
2
+ //# sourceMappingURL=chunk-C6C35PDM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/iwo/Projects/wigsill/packages/typegpu/dist/chunk-C6C35PDM.cjs","../src/data/numeric.ts","../src/data/wgslTypes.ts","../src/data/struct.ts"],"names":["bool","u32Cast","v","inGPUMode","u32","i32Cast","value","i32","f32Cast","arr","f32","f16Cast","bin","f16","wgslTypeLiterals","isWgslData","isWgslArray","schema","isWgslStruct","isPtrFn","isAtomic","isAlignAttrib","isSizeAttrib","isLocationAttrib","isInterpolateAttrib","isBuiltinAttrib","isDecorated","struct","props","WgslStructImpl","label","_a"],"mappings":"AAAA,iOAA8G,qGCA9F,IAOHA,EAAAA,CAAa,CACxB,IAAA,CAAM,MACR,CAAA,CAEMC,EAAAA,CAAWC,CAAAA,EACXC,iCAAAA,CAAU,CACL,CAAA,IAAA,EAAOD,CAAC,CAAA,CAAA,CAAA,CAGb,OAAOA,CAAAA,EAAM,SAAA,CACRA,CAAAA,CAAI,CAAA,CAAI,CAAA,CAEb,MAAA,CAAO,SAAA,CAAUA,CAAC,CAAA,CAAA,CAAA,CAChBA,CAAAA,CAAI,CAAA,EAAKA,CAAAA,CAAI,UAAA,CAAA,EACf,OAAA,CAAQ,IAAA,CAAK,CAAA,UAAA,EAAaA,CAAC,CAAA,WAAA,CAAa,CAAA,CAAA,CAE5BA,CAAAA,CAAI,UAAA,CAAA,GACD,CAAA,CAAA,CAEZ,IAAA,CAAK,GAAA,CAAI,CAAA,CAAG,IAAA,CAAK,GAAA,CAAI,UAAA,CAAY,IAAA,CAAK,KAAA,CAAMA,CAAC,CAAC,CAAC,CAAA,CAe3CE,CAAAA,aAAW,MAAA,CAAO,MAAA,CAAOH,EAAAA,CAAS,CAC7C,IAAA,CAAM,KACR,CAAC,CAAA,CAEKI,EAAAA,CAAWH,CAAAA,EAAwB,CACvC,EAAA,CAAIC,iCAAAA,CAAU,CACZ,MAAO,CAAA,IAAA,EAAOD,CAAC,CAAA,CAAA,CAAA,CAGjB,EAAA,CAAI,OAAOA,CAAAA,EAAM,SAAA,CACf,OAAOA,CAAAA,CAAI,CAAA,CAAI,CAAA,CAEjB,EAAA,CAAI,MAAA,CAAO,SAAA,CAAUA,CAAC,CAAA,CACpB,MAAA,CAAIA,CAAAA,CAAI,CAAA,UAAA,EAAeA,CAAAA,CAAI,UAAA,CAAA,EACzB,OAAA,CAAQ,IAAA,CAAK,CAAA,UAAA,EAAaA,CAAC,CAAA,WAAA,CAAa,CAAA,CAAA,CAE5BA,CAAAA,CAAI,CAAA,CAAA,CACH,UAAA,CAGjB,IAAMI,CAAAA,CAAQJ,CAAAA,CAAI,CAAA,CAAI,IAAA,CAAK,IAAA,CAAKA,CAAC,CAAA,CAAI,IAAA,CAAK,KAAA,CAAMA,CAAC,CAAA,CACjD,OAAO,IAAA,CAAK,GAAA,CAAI,CAAA,UAAA,CAAa,IAAA,CAAK,GAAA,CAAI,UAAA,CAAYI,CAAK,CAAC,CAC1D,CAAA,CAcaC,CAAAA,aAAW,MAAA,CAAO,MAAA,CAAOF,EAAAA,CAAS,CAC7C,IAAA,CAAM,KACR,CAAC,CAAA,CAEKG,EAAAA,CAAWN,CAAAA,EAAwB,CACvC,EAAA,CAAIC,iCAAAA,CAAU,CACZ,MAAO,CAAA,IAAA,EAAOD,CAAC,CAAA,CAAA,CAAA,CAEjB,EAAA,CAAI,OAAOA,CAAAA,EAAM,SAAA,CACf,OAAOA,CAAAA,CAAI,CAAA,CAAI,CAAA,CAEjB,IAAMO,CAAAA,CAAM,IAAI,YAAA,CAAa,CAAC,CAAA,CAC9B,OAAAA,CAAAA,CAAI,CAAC,CAAA,CAAIP,CAAAA,CACFO,CAAAA,CAAI,CAAC,CACd,CAAA,CAUaC,CAAAA,aAAW,MAAA,CAAO,MAAA,CAAOF,EAAAA,CAAS,CAC7C,IAAA,CAAM,KACR,CAAC,CAAA,CAEKG,EAAAA,CAAWT,CAAAA,EAAwB,CACvC,EAAA,CAAIC,iCAAAA,CAAU,CAEZ,MAAO,CAAA,IAAA,EAAOD,CAAC,CAAA,CAAA,CAAA,CAEjB,EAAA,CAAI,OAAOA,CAAAA,EAAM,SAAA,CACf,OAAOA,CAAAA,CAAI,CAAA,CAAI,CAAA,CAEjB,IAAMO,CAAAA,CAAM,IAAI,WAAA,CAAY,CAAC,CAAA,CAC7B,OAAAG,qBAAAA,CAAI,GAAA,CAAI,KAAA,CAAM,IAAIA,qBAAAA,CAAI,YAAA,CAAaH,CAAG,CAAA,CAAGP,CAAC,CAAA,CACnCU,qBAAAA,CAAI,GAAA,CAAI,IAAA,CAAK,IAAIA,qBAAAA,CAAI,YAAA,CAAaH,CAAG,CAAC,CAC/C,CAAA,CAYaI,EAAAA,aAAW,MAAA,CAAO,MAAA,CAAOF,EAAAA,CAAS,CAC7C,IAAA,CAAM,KACR,CAAC,CAAA,CC2vBM,IAAMG,EAAAA,CAAmB,CAC9B,MAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,OAAA,CACA,SAAA,CACA,SAAA,CACA,SAAA,CACA,QAAA,CACA,OAAA,CACA,OAAA,CACA,QAAA,CACA,WACF,CAAA,CAsDO,SAASC,CAAAA,CAAWT,CAAAA,CAAsC,CAC/D,OAAOQ,EAAAA,CAAiB,QAAA,CAAUR,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAuB,IAAI,CAC/D,CAcO,SAASU,CAAAA,CACdC,CAAAA,CACa,CACb,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAc,IAAA,CAAA,GAAS,OACjC,CAcO,SAASC,CAAAA,CACdD,CAAAA,CACa,CACb,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAc,IAAA,CAAA,GAAS,QACjC,CASO,SAASE,EAAAA,CAAyBF,CAAAA,CAAkC,CACzE,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAc,IAAA,CAAA,GAAS,OACjC,CASO,SAASG,EAAAA,CACdH,CAAAA,CACa,CACb,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAc,IAAA,CAAA,GAAS,QACjC,CAEO,SAASI,CAAAA,CACdf,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,IAAA,CAAA,GAAS,QAChC,CAEO,SAASgB,CAAAA,CACdhB,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,IAAA,CAAA,GAAS,OAChC,CAEO,SAASiB,CAAAA,CACdjB,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,IAAA,CAAA,GAAS,WAChC,CAEO,SAASkB,EAAAA,CACdlB,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,IAAA,CAAA,GAAS,cAChC,CAEO,SAASmB,CAAAA,CACdnB,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,IAAA,CAAA,GAAS,UAChC,CAEO,SAASoB,CAAAA,CACdpB,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,IAAA,CAAA,GAAS,WAChC,CC9/BO,SAASqB,EAAAA,CACdC,CAAAA,CAC8B,CAC9B,IAAMD,CAAAA,CAAaC,CAAAA,EAAaA,CAAAA,CAChC,OAAA,MAAA,CAAO,cAAA,CAAeD,CAAAA,CAAQE,EAAc,CAAA,CAC5CF,CAAAA,CAAO,SAAA,CAAYC,CAAAA,CAEZD,CACT,CAMA,IAAME,EAAAA,CAAiB,CACrB,IAAA,CAAM,QAAA,CACN,MAAA,CAAQ,KAAA,CAAA,CAER,IAAI,KAAA,CAAA,CAA4B,CAC9B,OAAO,IAAA,CAAK,MACd,CAAA,CAEA,KAAA,CAAMC,CAAAA,CAAe,CACnB,OAAA,IAAA,CAAK,MAAA,CAASA,CAAAA,CACP,IACT,CAAA,CAEA,QAAA,CAAA,CAAmB,CA5ErB,IAAAC,CAAAA,CA6EI,MAAO,CAAA,OAAA,EAAA,CAAUA,CAAAA,CAAA,IAAA,CAAK,KAAA,CAAA,EAAL,IAAA,CAAAA,CAAAA,CAAc,WAAW,CAAA,CAAA","file":"/Users/iwo/Projects/wigsill/packages/typegpu/dist/chunk-C6C35PDM.cjs","sourcesContent":[null,"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\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: U32 = Object.assign(u32Cast, {\n type: 'u32',\n}) as U32;\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: I32 = Object.assign(i32Cast, {\n type: 'i32',\n}) as I32;\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: F32 = Object.assign(f32Cast, {\n type: 'f32',\n}) as F32;\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: F16 = Object.assign(f16Cast, {\n type: 'f16',\n}) as F16;\n","import type { Infer, InferPartial, MemIdentity } from '../shared/repr';\nimport type { AnyWgslStruct, WgslStruct } from './struct';\n\ntype DecoratedLocation<T extends BaseData> = Decorated<T, Location<number>[]>;\n\nexport interface NumberArrayView {\n readonly length: number;\n [n: number]: number;\n}\n\nexport interface BaseData {\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 extends NumberArrayView, Swizzle2<v2f, v3f, v4f> {\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 extends NumberArrayView, Swizzle2<v2h, v3h, v4h> {\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 extends NumberArrayView, Swizzle2<v2i, v3i, v4i> {\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 extends NumberArrayView, Swizzle2<v2u, v3u, v4u> {\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 extends NumberArrayView, Swizzle3<v2f, v3f, v4f> {\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 extends NumberArrayView, Swizzle3<v2h, v3h, v4h> {\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 extends NumberArrayView, Swizzle3<v2i, v3i, v4i> {\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 extends NumberArrayView, Swizzle3<v2u, v3u, v4u> {\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 extends NumberArrayView, Swizzle4<v2f, v3f, v4f> {\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 extends NumberArrayView, Swizzle4<v2h, v3h, v4h> {\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 extends NumberArrayView, Swizzle4<v2i, v3i, v4i> {\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 extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {\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 type AnyVecInstance =\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\nexport type VecKind = AnyVecInstance['kind'];\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 readonly kind: string;\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 readonly kind: string;\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 readonly kind: string;\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\nexport type AnyMatInstance = m2x2f | m3x3f | m4x4f;\n\nexport type vBaseForMat<T extends AnyMatInstance> = T extends m2x2f\n ? v2f\n : T extends m3x3f\n ? v3f\n : v4f;\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\n/**\n * 32-bit float schema representing a single WGSL f32 value.\n */\nexport interface F32 {\n readonly type: 'f32';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n\n (v: number | boolean): number;\n}\n\n/**\n * 16-bit float schema representing a single WGSL f16 value.\n */\nexport interface F16 {\n readonly type: 'f16';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n\n (v: number | boolean): number;\n}\n\n/**\n * Signed 32-bit integer schema representing a single WGSL i32 value.\n */\nexport interface I32 {\n readonly type: 'i32';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n readonly '~memIdent': I32 | Atomic<I32> | DecoratedLocation<I32>;\n\n (v: number | boolean): number;\n}\n\n/**\n * Unsigned 32-bit integer schema representing a single WGSL u32 value.\n */\nexport interface U32 {\n readonly type: 'u32';\n /** Type-token, not available at runtime */\n readonly '~repr': number;\n readonly '~memIdent': U32 | Atomic<U32> | DecoratedLocation<U32>;\n\n (v: number | boolean): number;\n}\n\n/**\n * Type of the `d.vec2f` object/function: vector data type schema/constructor\n */\nexport interface Vec2f {\n readonly type: 'vec2f';\n /** Type-token, not available at runtime */\n readonly '~repr': v2f;\n\n (x: number, y: number): v2f;\n (xy: number): v2f;\n (): v2f;\n}\n\n/**\n * Type of the `d.vec2h` object/function: vector data type schema/constructor\n */\nexport interface Vec2h {\n readonly type: 'vec2h';\n /** Type-token, not available at runtime */\n readonly '~repr': v2h;\n\n (x: number, y: number): v2h;\n (xy: number): v2h;\n (): v2h;\n}\n\n/**\n * Type of the `d.vec2i` object/function: vector data type schema/constructor\n */\nexport interface Vec2i {\n readonly type: 'vec2i';\n /** Type-token, not available at runtime */\n readonly '~repr': v2i;\n\n (x: number, y: number): v2i;\n (xy: number): v2i;\n (): v2i;\n}\n\n/**\n * Type of the `d.vec2u` object/function: vector data type schema/constructor\n */\nexport interface Vec2u {\n readonly type: 'vec2u';\n /** Type-token, not available at runtime */\n readonly '~repr': v2u;\n\n (x: number, y: number): v2u;\n (xy: number): v2u;\n (): v2u;\n}\n\n/**\n * Type of the `d.vec3f` object/function: vector data type schema/constructor\n */\nexport interface Vec3f {\n readonly type: 'vec3f';\n /** Type-token, not available at runtime */\n readonly '~repr': v3f;\n\n (x: number, y: number, z: number): v3f;\n (xyz: number): v3f;\n (): v3f;\n}\n\n/**\n * Type of the `d.vec3h` object/function: vector data type schema/constructor\n */\nexport interface Vec3h {\n readonly type: 'vec3h';\n /** Type-token, not available at runtime */\n readonly '~repr': v3h;\n\n (x: number, y: number, z: number): v3h;\n (xyz: number): v3h;\n (): v3h;\n}\n\n/**\n * Type of the `d.vec3i` object/function: vector data type schema/constructor\n */\nexport interface Vec3i {\n readonly type: 'vec3i';\n /** Type-token, not available at runtime */\n readonly '~repr': v3i;\n\n (x: number, y: number, z: number): v3i;\n (xyz: number): v3i;\n (): v3i;\n}\n\n/**\n * Type of the `d.vec3u` object/function: vector data type schema/constructor\n */\nexport interface Vec3u {\n readonly type: 'vec3u';\n /** Type-token, not available at runtime */\n readonly '~repr': v3u;\n\n (x: number, y: number, z: number): v3u;\n (xyz: number): v3u;\n (): v3u;\n}\n\n/**\n * Type of the `d.vec4f` object/function: vector data type schema/constructor\n */\nexport interface Vec4f {\n readonly type: 'vec4f';\n /** Type-token, not available at runtime */\n readonly '~repr': v4f;\n\n (x: number, y: number, z: number, w: number): v4f;\n (xyzw: number): v4f;\n (): v4f;\n}\n\n/**\n * Type of the `d.vec4h` object/function: vector data type schema/constructor\n */\nexport interface Vec4h {\n readonly type: 'vec4h';\n /** Type-token, not available at runtime */\n readonly '~repr': v4h;\n\n (x: number, y: number, z: number, w: number): v4h;\n (xyzw: number): v4h;\n (): v4h;\n}\n\n/**\n * Type of the `d.vec4i` object/function: vector data type schema/constructor\n */\nexport interface Vec4i {\n readonly type: 'vec4i';\n /** Type-token, not available at runtime */\n readonly '~repr': v4i;\n\n (x: number, y: number, z: number, w: number): v4i;\n (xyzw: number): v4i;\n (): v4i;\n}\n\n/**\n * Type of the `d.vec4u` object/function: vector data type schema/constructor\n */\nexport interface Vec4u {\n readonly type: 'vec4u';\n /** Type-token, not available at runtime */\n readonly '~repr': v4u;\n\n (x: number, y: number, z: number, w: number): v4u;\n (xyzw: number): v4u;\n (): v4u;\n}\n\n/**\n * Type of the `d.mat2x2f` object/function: matrix data type schema/constructor\n */\nexport interface Mat2x2f {\n readonly type: 'mat2x2f';\n /** Type-token, not available at runtime */\n readonly '~repr': m2x2f;\n\n (...elements: number[]): m2x2f;\n (...columns: v2f[]): m2x2f;\n (): m2x2f;\n}\n\n/**\n * Type of the `d.mat3x3f` object/function: matrix data type schema/constructor\n */\nexport interface Mat3x3f {\n readonly type: 'mat3x3f';\n /** Type-token, not available at runtime */\n readonly '~repr': m3x3f;\n\n (...elements: number[]): m3x3f;\n (...columns: v3f[]): m3x3f;\n (): m3x3f;\n}\n\n/**\n * Type of the `d.mat4x4f` object/function: matrix data type schema/constructor\n */\nexport interface Mat4x4f {\n readonly type: 'mat4x4f';\n /** Type-token, not available at runtime */\n readonly '~repr': m4x4f;\n\n (...elements: number[]): m4x4f;\n (...columns: v4f[]): m4x4f;\n (): m4x4f;\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 WgslArray<TElement extends BaseData = BaseData> {\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 readonly '~reprPartial': { idx: number; value: InferPartial<TElement> }[];\n readonly '~memIdent': WgslArray<MemIdentity<TElement>>;\n}\n\nexport interface PtrFn<TInner = BaseData> {\n readonly type: 'ptrFn';\n readonly inner: TInner;\n /** Type-token, not available at runtime */\n readonly '~repr': Infer<TInner>;\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 readonly '~memIdent': MemIdentity<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 type PerspectiveOrLinearInterpolationType =\n `${'perspective' | 'linear'}${'' | ', center' | ', centroid' | ', sample'}`;\nexport type FlatInterpolationType = `flat${'' | ', first' | ', either'}`;\nexport type InterpolationType =\n | PerspectiveOrLinearInterpolationType\n | FlatInterpolationType;\n\nexport interface Interpolate<T extends InterpolationType> {\n readonly type: '@interpolate';\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 BaseData = BaseData,\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 readonly '~memIdent': TAttribs extends Location<number>[]\n ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs>\n : Decorated<MemIdentity<TInner>, TAttribs>;\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 'ptrFn',\n 'atomic',\n 'decorated',\n] as const;\n\nexport type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];\n\nexport type PerspectiveOrLinearInterpolatableData =\n | F32\n | F16\n | Vec2f\n | Vec2h\n | Vec3f\n | Vec3h\n | Vec4f\n | Vec4h;\n\nexport type FlatInterpolatableData =\n | PerspectiveOrLinearInterpolatableData\n | I32\n | U32\n | Vec2i\n | Vec2u\n | Vec3i\n | Vec3u\n | Vec4i\n | Vec4u;\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 | AnyWgslStruct\n | WgslArray\n | PtrFn\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 passed in value is a pointer ('function' scope) schema.\n *\n * @example\n * isPtrFn(d.ptrFn(d.f32)) // true\n * isPtrFn(d.f32) // false\n */\nexport function isPtrFn<T extends PtrFn>(schema: T | unknown): schema is T {\n return (schema as T)?.type === 'ptrFn';\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 isInterpolateAttrib<T extends Interpolate<InterpolationType>>(\n value: unknown | T,\n): value is T {\n return (value as T)?.type === '@interpolate';\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 {\n InferPartialRecord,\n InferRecord,\n MemIdentityRecord,\n} from '../shared/repr';\nimport type { Prettify } from '../shared/utilityTypes';\nimport type { AnyWgslData, BaseData } 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 WgslStruct<\n TProps extends Record<string, BaseData> = Record<string, BaseData>,\n> extends TgpuNamable {\n (props: InferRecord<TProps>): InferRecord<TProps>;\n readonly type: 'struct';\n readonly label?: string | undefined;\n readonly propTypes: TProps;\n /** Type-token, not available at runtime */\n readonly '~repr': Prettify<InferRecord<TProps>>;\n /** Type-token, not available at runtime */\n readonly '~memIdent': WgslStruct<MemIdentityRecord<TProps>>;\n /** Type-token, not available at runtime */\n readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: <we need the type to be broader than WgslStruct<Record<string, BaseWgslData>>\nexport type AnyWgslStruct = WgslStruct<any>;\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 function struct<TProps extends Record<string, AnyWgslData>>(\n props: TProps,\n): WgslStruct<Prettify<TProps>> {\n const struct = <T>(props: T) => props;\n Object.setPrototypeOf(struct, WgslStructImpl);\n struct.propTypes = props;\n\n return struct as unknown as WgslStruct<Prettify<TProps>>;\n}\n\n// --------------\n// Implementation\n// --------------\n\nconst WgslStructImpl = {\n type: 'struct',\n _label: undefined as string | undefined,\n\n get label(): string | undefined {\n return this._label;\n },\n\n $name(label: string) {\n this._label = label;\n return this;\n },\n\n toString(): string {\n return `struct:${this.label ?? '<unnamed>'}`;\n },\n};\n"]}
@@ -1,4 +1,4 @@
1
- var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var C=(e,t,s)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,tt=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&C(e,s,t[s]);if(G)for(var s of G(t))I.call(t,s)&&C(e,s,t[s]);return e},et=(e,t)=>X(e,Y(t));var r=(e,t,s)=>(C(e,typeof t!="symbol"?t+"":t,s),s);var $="Invariant failed";function N(e,t){if(e)return;throw new Error($)}var D=class e extends Error{constructor(s,i){let h=i.map(n=>`- ${n}`);h.length>20&&(h=[...h.slice(0,11),"...",...h.slice(-10)]);super(`Resolution of the following tree failed:
1
+ var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var C=(e,t,s)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,tt=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&C(e,s,t[s]);if(G)for(var s of G(t))I.call(t,s)&&C(e,s,t[s]);return e},et=(e,t)=>X(e,Y(t));var r=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);var $="Invariant failed";function N(e,t){if(e)return;throw new Error($)}var D=class e extends Error{constructor(s,i){let h=i.map(n=>`- ${n}`);h.length>20&&(h=[...h.slice(0,11),"...",...h.slice(-10)]);super(`Resolution of the following tree failed:
2
2
  ${h.join(`
3
3
  `)}`);this.cause=s;this.trace=i;Object.setPrototypeOf(this,e.prototype)}appendToTrace(s){let i=[s,...this.trace];return new e(this.cause,i)}},F=class e extends Error{constructor(s){super(`Missing value for '${s}'`);this.slot=s;Object.setPrototypeOf(this,e.prototype)}},K=class e extends Error{constructor(t){var s;super(`Buffer '${(s=t.label)!=null?s:"<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,e.prototype)}},U=class e extends Error{constructor(t,s){super(`The function '${t!=null?t:"<unnamed>"}' is missing links to the following external values: ${s}.`),Object.setPrototypeOf(this,e.prototype)}},L=class e extends Error{constructor(t){super(`Missing bind groups for layouts: '${[...t].map(s=>{var i;return(i=s.label)!=null?i:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,e.prototype)}},W=class e extends Error{constructor(t){super(`Missing vertex buffers for layouts: '${[...t].map(s=>{var i;return(i=s.label)!=null?i:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,e.prototype)}};var T=null;function nt(e,t){N(T===null,"Cannot nest context providers"),T=e;try{return t()}finally{T=null}}function rt(){return T}var k=()=>T!==null;var v=class extends Array{"~resolve"(){return`${this.kind}(${this.join(", ")})`}toString(){return this["~resolve"]()}get xx(){return new this._Vec2(this[0],this[0])}get xy(){return new this._Vec2(this[0],this[1])}get xz(){return new this._Vec2(this[0],this[2])}get xw(){return new this._Vec2(this[0],this[3])}get yx(){return new this._Vec2(this[1],this[0])}get yy(){return new this._Vec2(this[1],this[1])}get yz(){return new this._Vec2(this[1],this[2])}get yw(){return new this._Vec2(this[1],this[3])}get zx(){return new this._Vec2(this[2],this[0])}get zy(){return new this._Vec2(this[2],this[1])}get zz(){return new this._Vec2(this[2],this[2])}get zw(){return new this._Vec2(this[2],this[3])}get wx(){return new this._Vec2(this[3],this[0])}get wy(){return new this._Vec2(this[3],this[1])}get wz(){return new this._Vec2(this[3],this[2])}get ww(){return new this._Vec2(this[3],this[3])}get xxx(){return new this._Vec3(this[0],this[0],this[0])}get xxy(){return new this._Vec3(this[0],this[0],this[1])}get xxz(){return new this._Vec3(this[0],this[0],this[2])}get xxw(){return new this._Vec3(this[0],this[0],this[3])}get xyx(){return new this._Vec3(this[0],this[1],this[0])}get xyy(){return new this._Vec3(this[0],this[1],this[1])}get xyz(){return new this._Vec3(this[0],this[1],this[2])}get xyw(){return new this._Vec3(this[0],this[1],this[3])}get xzx(){return new this._Vec3(this[0],this[2],this[0])}get xzy(){return new this._Vec3(this[0],this[2],this[1])}get xzz(){return new this._Vec3(this[0],this[2],this[2])}get xzw(){return new this._Vec3(this[0],this[2],this[3])}get xwx(){return new this._Vec3(this[0],this[3],this[0])}get xwy(){return new this._Vec3(this[0],this[3],this[1])}get xwz(){return new this._Vec3(this[0],this[3],this[2])}get xww(){return new this._Vec3(this[0],this[3],this[3])}get yxx(){return new this._Vec3(this[1],this[0],this[0])}get yxy(){return new this._Vec3(this[1],this[0],this[1])}get yxz(){return new this._Vec3(this[1],this[0],this[2])}get yxw(){return new this._Vec3(this[1],this[0],this[3])}get yyx(){return new this._Vec3(this[1],this[1],this[0])}get yyy(){return new this._Vec3(this[1],this[1],this[1])}get yyz(){return new this._Vec3(this[1],this[1],this[2])}get yyw(){return new this._Vec3(this[1],this[1],this[3])}get yzx(){return new this._Vec3(this[1],this[2],this[0])}get yzy(){return new this._Vec3(this[1],this[2],this[1])}get yzz(){return new this._Vec3(this[1],this[2],this[2])}get yzw(){return new this._Vec3(this[1],this[2],this[3])}get ywx(){return new this._Vec3(this[1],this[3],this[0])}get ywy(){return new this._Vec3(this[1],this[3],this[1])}get ywz(){return new this._Vec3(this[1],this[3],this[2])}get yww(){return new this._Vec3(this[1],this[3],this[3])}get zxx(){return new this._Vec3(this[2],this[0],this[0])}get zxy(){return new this._Vec3(this[2],this[0],this[1])}get zxz(){return new this._Vec3(this[2],this[0],this[2])}get zxw(){return new this._Vec3(this[2],this[0],this[3])}get zyx(){return new this._Vec3(this[2],this[1],this[0])}get zyy(){return new this._Vec3(this[2],this[1],this[1])}get zyz(){return new this._Vec3(this[2],this[1],this[2])}get zyw(){return new this._Vec3(this[2],this[1],this[3])}get zzx(){return new this._Vec3(this[2],this[2],this[0])}get zzy(){return new this._Vec3(this[2],this[2],this[1])}get zzz(){return new this._Vec3(this[2],this[2],this[2])}get zzw(){return new this._Vec3(this[2],this[2],this[3])}get zwx(){return new this._Vec3(this[2],this[3],this[0])}get zwy(){return new this._Vec3(this[2],this[3],this[1])}get zwz(){return new this._Vec3(this[2],this[3],this[2])}get zww(){return new this._Vec3(this[2],this[3],this[3])}get wxx(){return new this._Vec3(this[3],this[0],this[0])}get wxy(){return new this._Vec3(this[3],this[0],this[1])}get wxz(){return new this._Vec3(this[3],this[0],this[2])}get wxw(){return new this._Vec3(this[3],this[0],this[3])}get wyx(){return new this._Vec3(this[3],this[1],this[0])}get wyy(){return new this._Vec3(this[3],this[1],this[1])}get wyz(){return new this._Vec3(this[3],this[1],this[2])}get wyw(){return new this._Vec3(this[3],this[1],this[3])}get wzx(){return new this._Vec3(this[3],this[2],this[0])}get wzy(){return new this._Vec3(this[3],this[2],this[1])}get wzz(){return new this._Vec3(this[3],this[2],this[2])}get wzw(){return new this._Vec3(this[3],this[2],this[3])}get wwx(){return new this._Vec3(this[3],this[3],this[0])}get wwy(){return new this._Vec3(this[3],this[3],this[1])}get wwz(){return new this._Vec3(this[3],this[3],this[2])}get www(){return new this._Vec3(this[3],this[3],this[3])}get xxxx(){return new this._Vec4(this[0],this[0],this[0],this[0])}get xxxy(){return new this._Vec4(this[0],this[0],this[0],this[1])}get xxxz(){return new this._Vec4(this[0],this[0],this[0],this[2])}get xxxw(){return new this._Vec4(this[0],this[0],this[0],this[3])}get xxyx(){return new this._Vec4(this[0],this[0],this[1],this[0])}get xxyy(){return new this._Vec4(this[0],this[0],this[1],this[1])}get xxyz(){return new this._Vec4(this[0],this[0],this[1],this[2])}get xxyw(){return new this._Vec4(this[0],this[0],this[1],this[3])}get xxzx(){return new this._Vec4(this[0],this[0],this[2],this[0])}get xxzy(){return new this._Vec4(this[0],this[0],this[2],this[1])}get xxzz(){return new this._Vec4(this[0],this[0],this[2],this[2])}get xxzw(){return new this._Vec4(this[0],this[0],this[2],this[3])}get xxwx(){return new this._Vec4(this[0],this[0],this[3],this[0])}get xxwy(){return new this._Vec4(this[0],this[0],this[3],this[1])}get xxwz(){return new this._Vec4(this[0],this[0],this[3],this[2])}get xxww(){return new this._Vec4(this[0],this[0],this[3],this[3])}get xyxx(){return new this._Vec4(this[0],this[1],this[0],this[0])}get xyxy(){return new this._Vec4(this[0],this[1],this[0],this[1])}get xyxz(){return new this._Vec4(this[0],this[1],this[0],this[2])}get xyxw(){return new this._Vec4(this[0],this[1],this[0],this[3])}get xyyx(){return new this._Vec4(this[0],this[1],this[1],this[0])}get xyyy(){return new this._Vec4(this[0],this[1],this[1],this[1])}get xyyz(){return new this._Vec4(this[0],this[1],this[1],this[2])}get xyyw(){return new this._Vec4(this[0],this[1],this[1],this[3])}get xyzx(){return new this._Vec4(this[0],this[1],this[2],this[0])}get xyzy(){return new this._Vec4(this[0],this[1],this[2],this[1])}get xyzz(){return new this._Vec4(this[0],this[1],this[2],this[2])}get xyzw(){return new this._Vec4(this[0],this[1],this[2],this[3])}get xywx(){return new this._Vec4(this[0],this[1],this[3],this[0])}get xywy(){return new this._Vec4(this[0],this[1],this[3],this[1])}get xywz(){return new this._Vec4(this[0],this[1],this[3],this[2])}get xyww(){return new this._Vec4(this[0],this[1],this[3],this[3])}get xzxx(){return new this._Vec4(this[0],this[2],this[0],this[0])}get xzxy(){return new this._Vec4(this[0],this[2],this[0],this[1])}get xzxz(){return new this._Vec4(this[0],this[2],this[0],this[2])}get xzxw(){return new this._Vec4(this[0],this[2],this[0],this[3])}get xzyx(){return new this._Vec4(this[0],this[2],this[1],this[0])}get xzyy(){return new this._Vec4(this[0],this[2],this[1],this[1])}get xzyz(){return new this._Vec4(this[0],this[2],this[1],this[2])}get xzyw(){return new this._Vec4(this[0],this[2],this[1],this[3])}get xzzx(){return new this._Vec4(this[0],this[2],this[2],this[0])}get xzzy(){return new this._Vec4(this[0],this[2],this[2],this[1])}get xzzz(){return new this._Vec4(this[0],this[2],this[2],this[2])}get xzzw(){return new this._Vec4(this[0],this[2],this[2],this[3])}get xzwx(){return new this._Vec4(this[0],this[2],this[3],this[0])}get xzwy(){return new this._Vec4(this[0],this[2],this[3],this[1])}get xzwz(){return new this._Vec4(this[0],this[2],this[3],this[2])}get xzww(){return new this._Vec4(this[0],this[2],this[3],this[3])}get xwxx(){return new this._Vec4(this[0],this[3],this[0],this[0])}get xwxy(){return new this._Vec4(this[0],this[3],this[0],this[1])}get xwxz(){return new this._Vec4(this[0],this[3],this[0],this[2])}get xwxw(){return new this._Vec4(this[0],this[3],this[0],this[3])}get xwyx(){return new this._Vec4(this[0],this[3],this[1],this[0])}get xwyy(){return new this._Vec4(this[0],this[3],this[1],this[1])}get xwyz(){return new this._Vec4(this[0],this[3],this[1],this[2])}get xwyw(){return new this._Vec4(this[0],this[3],this[1],this[3])}get xwzx(){return new this._Vec4(this[0],this[3],this[2],this[0])}get xwzy(){return new this._Vec4(this[0],this[3],this[2],this[1])}get xwzz(){return new this._Vec4(this[0],this[3],this[2],this[2])}get xwzw(){return new this._Vec4(this[0],this[3],this[2],this[3])}get xwwx(){return new this._Vec4(this[0],this[3],this[3],this[0])}get xwwy(){return new this._Vec4(this[0],this[3],this[3],this[1])}get xwwz(){return new this._Vec4(this[0],this[3],this[3],this[2])}get xwww(){return new this._Vec4(this[0],this[3],this[3],this[3])}get yxxx(){return new this._Vec4(this[1],this[0],this[0],this[0])}get yxxy(){return new this._Vec4(this[1],this[0],this[0],this[1])}get yxxz(){return new this._Vec4(this[1],this[0],this[0],this[2])}get yxxw(){return new this._Vec4(this[1],this[0],this[0],this[3])}get yxyx(){return new this._Vec4(this[1],this[0],this[1],this[0])}get yxyy(){return new this._Vec4(this[1],this[0],this[1],this[1])}get yxyz(){return new this._Vec4(this[1],this[0],this[1],this[2])}get yxyw(){return new this._Vec4(this[1],this[0],this[1],this[3])}get yxzx(){return new this._Vec4(this[1],this[0],this[2],this[0])}get yxzy(){return new this._Vec4(this[1],this[0],this[2],this[1])}get yxzz(){return new this._Vec4(this[1],this[0],this[2],this[2])}get yxzw(){return new this._Vec4(this[1],this[0],this[2],this[3])}get yxwx(){return new this._Vec4(this[1],this[0],this[3],this[0])}get yxwy(){return new this._Vec4(this[1],this[0],this[3],this[1])}get yxwz(){return new this._Vec4(this[1],this[0],this[3],this[2])}get yxww(){return new this._Vec4(this[1],this[0],this[3],this[3])}get yyxx(){return new this._Vec4(this[1],this[1],this[0],this[0])}get yyxy(){return new this._Vec4(this[1],this[1],this[0],this[1])}get yyxz(){return new this._Vec4(this[1],this[1],this[0],this[2])}get yyxw(){return new this._Vec4(this[1],this[1],this[0],this[3])}get yyyx(){return new this._Vec4(this[1],this[1],this[1],this[0])}get yyyy(){return new this._Vec4(this[1],this[1],this[1],this[1])}get yyyz(){return new this._Vec4(this[1],this[1],this[1],this[2])}get yyyw(){return new this._Vec4(this[1],this[1],this[1],this[3])}get yyzx(){return new this._Vec4(this[1],this[1],this[2],this[0])}get yyzy(){return new this._Vec4(this[1],this[1],this[2],this[1])}get yyzz(){return new this._Vec4(this[1],this[1],this[2],this[2])}get yyzw(){return new this._Vec4(this[1],this[1],this[2],this[3])}get yywx(){return new this._Vec4(this[1],this[1],this[3],this[0])}get yywy(){return new this._Vec4(this[1],this[1],this[3],this[1])}get yywz(){return new this._Vec4(this[1],this[1],this[3],this[2])}get yyww(){return new this._Vec4(this[1],this[1],this[3],this[3])}get yzxx(){return new this._Vec4(this[1],this[2],this[0],this[0])}get yzxy(){return new this._Vec4(this[1],this[2],this[0],this[1])}get yzxz(){return new this._Vec4(this[1],this[2],this[0],this[2])}get yzxw(){return new this._Vec4(this[1],this[2],this[0],this[3])}get yzyx(){return new this._Vec4(this[1],this[2],this[1],this[0])}get yzyy(){return new this._Vec4(this[1],this[2],this[1],this[1])}get yzyz(){return new this._Vec4(this[1],this[2],this[1],this[2])}get yzyw(){return new this._Vec4(this[1],this[2],this[1],this[3])}get yzzx(){return new this._Vec4(this[1],this[2],this[2],this[0])}get yzzy(){return new this._Vec4(this[1],this[2],this[2],this[1])}get yzzz(){return new this._Vec4(this[1],this[2],this[2],this[2])}get yzzw(){return new this._Vec4(this[1],this[2],this[2],this[3])}get yzwx(){return new this._Vec4(this[1],this[2],this[3],this[0])}get yzwy(){return new this._Vec4(this[1],this[2],this[3],this[1])}get yzwz(){return new this._Vec4(this[1],this[2],this[3],this[2])}get yzww(){return new this._Vec4(this[1],this[2],this[3],this[3])}get ywxx(){return new this._Vec4(this[1],this[3],this[0],this[0])}get ywxy(){return new this._Vec4(this[1],this[3],this[0],this[1])}get ywxz(){return new this._Vec4(this[1],this[3],this[0],this[2])}get ywxw(){return new this._Vec4(this[1],this[3],this[0],this[3])}get ywyx(){return new this._Vec4(this[1],this[3],this[1],this[0])}get ywyy(){return new this._Vec4(this[1],this[3],this[1],this[1])}get ywyz(){return new this._Vec4(this[1],this[3],this[1],this[2])}get ywyw(){return new this._Vec4(this[1],this[3],this[1],this[3])}get ywzx(){return new this._Vec4(this[1],this[3],this[2],this[0])}get ywzy(){return new this._Vec4(this[1],this[3],this[2],this[1])}get ywzz(){return new this._Vec4(this[1],this[3],this[2],this[2])}get ywzw(){return new this._Vec4(this[1],this[3],this[2],this[3])}get ywwx(){return new this._Vec4(this[1],this[3],this[3],this[0])}get ywwy(){return new this._Vec4(this[1],this[3],this[3],this[1])}get ywwz(){return new this._Vec4(this[1],this[3],this[3],this[2])}get ywww(){return new this._Vec4(this[1],this[3],this[3],this[3])}get zxxx(){return new this._Vec4(this[2],this[0],this[0],this[0])}get zxxy(){return new this._Vec4(this[2],this[0],this[0],this[1])}get zxxz(){return new this._Vec4(this[2],this[0],this[0],this[2])}get zxxw(){return new this._Vec4(this[2],this[0],this[0],this[3])}get zxyx(){return new this._Vec4(this[2],this[0],this[1],this[0])}get zxyy(){return new this._Vec4(this[2],this[0],this[1],this[1])}get zxyz(){return new this._Vec4(this[2],this[0],this[1],this[2])}get zxyw(){return new this._Vec4(this[2],this[0],this[1],this[3])}get zxzx(){return new this._Vec4(this[2],this[0],this[2],this[0])}get zxzy(){return new this._Vec4(this[2],this[0],this[2],this[1])}get zxzz(){return new this._Vec4(this[2],this[0],this[2],this[2])}get zxzw(){return new this._Vec4(this[2],this[0],this[2],this[3])}get zxwx(){return new this._Vec4(this[2],this[0],this[3],this[0])}get zxwy(){return new this._Vec4(this[2],this[0],this[3],this[1])}get zxwz(){return new this._Vec4(this[2],this[0],this[3],this[2])}get zxww(){return new this._Vec4(this[2],this[0],this[3],this[3])}get zyxx(){return new this._Vec4(this[2],this[1],this[0],this[0])}get zyxy(){return new this._Vec4(this[2],this[1],this[0],this[1])}get zyxz(){return new this._Vec4(this[2],this[1],this[0],this[2])}get zyxw(){return new this._Vec4(this[2],this[1],this[0],this[3])}get zyyx(){return new this._Vec4(this[2],this[1],this[1],this[0])}get zyyy(){return new this._Vec4(this[2],this[1],this[1],this[1])}get zyyz(){return new this._Vec4(this[2],this[1],this[1],this[2])}get zyyw(){return new this._Vec4(this[2],this[1],this[1],this[3])}get zyzx(){return new this._Vec4(this[2],this[1],this[2],this[0])}get zyzy(){return new this._Vec4(this[2],this[1],this[2],this[1])}get zyzz(){return new this._Vec4(this[2],this[1],this[2],this[2])}get zyzw(){return new this._Vec4(this[2],this[1],this[2],this[3])}get zywx(){return new this._Vec4(this[2],this[1],this[3],this[0])}get zywy(){return new this._Vec4(this[2],this[1],this[3],this[1])}get zywz(){return new this._Vec4(this[2],this[1],this[3],this[2])}get zyww(){return new this._Vec4(this[2],this[1],this[3],this[3])}get zzxx(){return new this._Vec4(this[2],this[2],this[0],this[0])}get zzxy(){return new this._Vec4(this[2],this[2],this[0],this[1])}get zzxz(){return new this._Vec4(this[2],this[2],this[0],this[2])}get zzxw(){return new this._Vec4(this[2],this[2],this[0],this[3])}get zzyx(){return new this._Vec4(this[2],this[2],this[1],this[0])}get zzyy(){return new this._Vec4(this[2],this[2],this[1],this[1])}get zzyz(){return new this._Vec4(this[2],this[2],this[1],this[2])}get zzyw(){return new this._Vec4(this[2],this[2],this[1],this[3])}get zzzx(){return new this._Vec4(this[2],this[2],this[2],this[0])}get zzzy(){return new this._Vec4(this[2],this[2],this[2],this[1])}get zzzz(){return new this._Vec4(this[2],this[2],this[2],this[2])}get zzzw(){return new this._Vec4(this[2],this[2],this[2],this[3])}get zzwx(){return new this._Vec4(this[2],this[2],this[3],this[0])}get zzwy(){return new this._Vec4(this[2],this[2],this[3],this[1])}get zzwz(){return new this._Vec4(this[2],this[2],this[3],this[2])}get zzww(){return new this._Vec4(this[2],this[2],this[3],this[3])}get zwxx(){return new this._Vec4(this[2],this[3],this[0],this[0])}get zwxy(){return new this._Vec4(this[2],this[3],this[0],this[1])}get zwxz(){return new this._Vec4(this[2],this[3],this[0],this[2])}get zwxw(){return new this._Vec4(this[2],this[3],this[0],this[3])}get zwyx(){return new this._Vec4(this[2],this[3],this[1],this[0])}get zwyy(){return new this._Vec4(this[2],this[3],this[1],this[1])}get zwyz(){return new this._Vec4(this[2],this[3],this[1],this[2])}get zwyw(){return new this._Vec4(this[2],this[3],this[1],this[3])}get zwzx(){return new this._Vec4(this[2],this[3],this[2],this[0])}get zwzy(){return new this._Vec4(this[2],this[3],this[2],this[1])}get zwzz(){return new this._Vec4(this[2],this[3],this[2],this[2])}get zwzw(){return new this._Vec4(this[2],this[3],this[2],this[3])}get zwwx(){return new this._Vec4(this[2],this[3],this[3],this[0])}get zwwy(){return new this._Vec4(this[2],this[3],this[3],this[1])}get zwwz(){return new this._Vec4(this[2],this[3],this[3],this[2])}get zwww(){return new this._Vec4(this[2],this[3],this[3],this[3])}get wxxx(){return new this._Vec4(this[3],this[0],this[0],this[0])}get wxxy(){return new this._Vec4(this[3],this[0],this[0],this[1])}get wxxz(){return new this._Vec4(this[3],this[0],this[0],this[2])}get wxxw(){return new this._Vec4(this[3],this[0],this[0],this[3])}get wxyx(){return new this._Vec4(this[3],this[0],this[1],this[0])}get wxyy(){return new this._Vec4(this[3],this[0],this[1],this[1])}get wxyz(){return new this._Vec4(this[3],this[0],this[1],this[2])}get wxyw(){return new this._Vec4(this[3],this[0],this[1],this[3])}get wxzx(){return new this._Vec4(this[3],this[0],this[2],this[0])}get wxzy(){return new this._Vec4(this[3],this[0],this[2],this[1])}get wxzz(){return new this._Vec4(this[3],this[0],this[2],this[2])}get wxzw(){return new this._Vec4(this[3],this[0],this[2],this[3])}get wxwx(){return new this._Vec4(this[3],this[0],this[3],this[0])}get wxwy(){return new this._Vec4(this[3],this[0],this[3],this[1])}get wxwz(){return new this._Vec4(this[3],this[0],this[3],this[2])}get wxww(){return new this._Vec4(this[3],this[0],this[3],this[3])}get wyxx(){return new this._Vec4(this[3],this[1],this[0],this[0])}get wyxy(){return new this._Vec4(this[3],this[1],this[0],this[1])}get wyxz(){return new this._Vec4(this[3],this[1],this[0],this[2])}get wyxw(){return new this._Vec4(this[3],this[1],this[0],this[3])}get wyyx(){return new this._Vec4(this[3],this[1],this[1],this[0])}get wyyy(){return new this._Vec4(this[3],this[1],this[1],this[1])}get wyyz(){return new this._Vec4(this[3],this[1],this[1],this[2])}get wyyw(){return new this._Vec4(this[3],this[1],this[1],this[3])}get wyzx(){return new this._Vec4(this[3],this[1],this[2],this[0])}get wyzy(){return new this._Vec4(this[3],this[1],this[2],this[1])}get wyzz(){return new this._Vec4(this[3],this[1],this[2],this[2])}get wyzw(){return new this._Vec4(this[3],this[1],this[2],this[3])}get wywx(){return new this._Vec4(this[3],this[1],this[3],this[0])}get wywy(){return new this._Vec4(this[3],this[1],this[3],this[1])}get wywz(){return new this._Vec4(this[3],this[1],this[3],this[2])}get wyww(){return new this._Vec4(this[3],this[1],this[3],this[3])}get wzxx(){return new this._Vec4(this[3],this[2],this[0],this[0])}get wzxy(){return new this._Vec4(this[3],this[2],this[0],this[1])}get wzxz(){return new this._Vec4(this[3],this[2],this[0],this[2])}get wzxw(){return new this._Vec4(this[3],this[2],this[0],this[3])}get wzyx(){return new this._Vec4(this[3],this[2],this[1],this[0])}get wzyy(){return new this._Vec4(this[3],this[2],this[1],this[1])}get wzyz(){return new this._Vec4(this[3],this[2],this[1],this[2])}get wzyw(){return new this._Vec4(this[3],this[2],this[1],this[3])}get wzzx(){return new this._Vec4(this[3],this[2],this[2],this[0])}get wzzy(){return new this._Vec4(this[3],this[2],this[2],this[1])}get wzzz(){return new this._Vec4(this[3],this[2],this[2],this[2])}get wzzw(){return new this._Vec4(this[3],this[2],this[2],this[3])}get wzwx(){return new this._Vec4(this[3],this[2],this[3],this[0])}get wzwy(){return new this._Vec4(this[3],this[2],this[3],this[1])}get wzwz(){return new this._Vec4(this[3],this[2],this[3],this[2])}get wzww(){return new this._Vec4(this[3],this[2],this[3],this[3])}get wwxx(){return new this._Vec4(this[3],this[3],this[0],this[0])}get wwxy(){return new this._Vec4(this[3],this[3],this[0],this[1])}get wwxz(){return new this._Vec4(this[3],this[3],this[0],this[2])}get wwxw(){return new this._Vec4(this[3],this[3],this[0],this[3])}get wwyx(){return new this._Vec4(this[3],this[3],this[1],this[0])}get wwyy(){return new this._Vec4(this[3],this[3],this[1],this[1])}get wwyz(){return new this._Vec4(this[3],this[3],this[1],this[2])}get wwyw(){return new this._Vec4(this[3],this[3],this[1],this[3])}get wwzx(){return new this._Vec4(this[3],this[3],this[2],this[0])}get wwzy(){return new this._Vec4(this[3],this[3],this[2],this[1])}get wwzz(){return new this._Vec4(this[3],this[3],this[2],this[2])}get wwzw(){return new this._Vec4(this[3],this[3],this[2],this[3])}get wwwx(){return new this._Vec4(this[3],this[3],this[3],this[0])}get wwwy(){return new this._Vec4(this[3],this[3],this[3],this[1])}get wwwz(){return new this._Vec4(this[3],this[3],this[3],this[2])}get wwww(){return new this._Vec4(this[3],this[3],this[3],this[3])}},c=class extends v{constructor(s,i){var h;super(2);r(this,0);r(this,1);this[0]=s!=null?s:0,this[1]=(h=i!=null?i:s)!=null?h:0}get x(){return this[0]}get y(){return this[1]}set x(s){this[0]=s}set y(s){this[1]=s}},g=class extends v{constructor(s,i,h){var n,w;super(3);r(this,0);r(this,1);r(this,2);this[0]=s!=null?s:0,this[1]=(n=i!=null?i:s)!=null?n:0,this[2]=(w=h!=null?h:s)!=null?w:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(s){this[0]=s}set y(s){this[1]=s}set z(s){this[2]=s}},y=class extends v{constructor(s,i,h,n){var w,P,A;super(4);r(this,0);r(this,1);r(this,2);r(this,3);this[0]=s!=null?s:0,this[1]=(w=i!=null?i:s)!=null?w:0,this[2]=(P=h!=null?h:s)!=null?P:0,this[3]=(A=n!=null?n:s)!=null?A:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(s){this[0]=s}set y(s){this[1]=s}set z(s){this[2]=s}set w(s){this[3]=s}},x=class e extends c{get kind(){return"vec2f"}get _Vec2(){return e}get _Vec3(){return m}get _Vec4(){return p}},o=class e extends c{get kind(){return"vec2h"}get _Vec2(){return e}get _Vec3(){return z}get _Vec4(){return b}},V=class e extends c{get kind(){return"vec2i"}get _Vec2(){return e}get _Vec3(){return a}get _Vec4(){return f}},_=class e extends c{get kind(){return"vec2u"}get _Vec2(){return e}get _Vec3(){return l}get _Vec4(){return d}},m=class e extends g{get kind(){return"vec3f"}get _Vec2(){return x}get _Vec3(){return e}get _Vec4(){return p}},z=class e extends g{get kind(){return"vec3h"}get _Vec2(){return o}get _Vec3(){return e}get _Vec4(){return b}},a=class e extends g{get kind(){return"vec3i"}get _Vec2(){return V}get _Vec3(){return e}get _Vec4(){return f}},l=class e extends g{get kind(){return"vec3u"}get _Vec2(){return _}get _Vec3(){return e}get _Vec4(){return d}},p=class e extends y{get kind(){return"vec4f"}get _Vec2(){return x}get _Vec3(){return m}get _Vec4(){return e}},b=class e extends y{get kind(){return"vec4h"}get _Vec2(){return o}get _Vec3(){return z}get _Vec4(){return e}},f=class e extends y{get kind(){return"vec4i"}get _Vec2(){return V}get _Vec3(){return a}get _Vec4(){return e}},d=class e extends y{get kind(){return"vec4u"}get _Vec2(){return _}get _Vec3(){return l}get _Vec4(){return e}};function u(e){let{kind:t,length:s}=new e;return Object.assign((...h)=>{let n=h;if(k())return`${t}(${n.join(", ")})`;if(n.length<=1||n.length===s)return new e(...n);throw new Error(`'${t}' constructor called with invalid number of arguments.`)},{type:t,"~repr":void 0})}var q=u(x),xt=u(o),ot=u(V),Vt=u(_),H=u(m),_t=u(z),mt=u(a),zt=u(l),J=u(p),at=u(b),lt=u(f),pt=u(d);function E(e){let t={"~repr":void 0,type:e.type,label:e.type};return Object.assign((...i)=>{if(k())return`${t.type}(${i.join(", ")})`;let h=[];for(let n of i)if(typeof n=="number")h.push(n);else for(let w=0;w<n.length;++w)h.push(n[w]);for(let n=h.length;n<e.columns*e.rows;++n)h.push(0);return e.makeFromElements(...h)},t)}var O=class{constructor(...t){r(this,"columns");r(this,"length",4);this.columns=[this.makeColumn(t[0],t[1]),this.makeColumn(t[2],t[3])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[1].x}get 3(){return this.columns[1].y}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[1].x=t}set 3(t){this.columns[1].y=t}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,s)=>this[s]).join(", ")})`}},j=class extends O{constructor(){super(...arguments);r(this,"kind","mat2x2f")}makeColumn(s,i){return q(s,i)}},M=class{constructor(...t){r(this,"columns");r(this,"length",12);this.columns=[this.makeColumn(t[0],t[1],t[2]),this.makeColumn(t[3],t[4],t[5]),this.makeColumn(t[6],t[7],t[8])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return 0}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return 0}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return 0}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){}"~resolve"(){return`${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`}},S=class extends M{constructor(){super(...arguments);r(this,"kind","mat3x3f")}makeColumn(s,i,h){return H(s,i,h)}},B=class{constructor(...t){r(this,"columns");r(this,"length",16);this.columns=[this.makeColumn(t[0],t[1],t[2],t[3]),this.makeColumn(t[4],t[5],t[6],t[7]),this.makeColumn(t[8],t[9],t[10],t[11]),this.makeColumn(t[12],t[13],t[14],t[15])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return this.columns[0].w}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return this.columns[1].w}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return this.columns[2].w}get 12(){return this.columns[3].x}get 13(){return this.columns[3].y}get 14(){return this.columns[3].z}get 15(){return this.columns[3].w}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){this.columns[0].w=t}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){this.columns[1].w=t}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){this.columns[2].w=t}set 12(t){this.columns[3].x=t}set 13(t){this.columns[3].y=t}set 14(t){this.columns[3].z=t}set 15(t){this.columns[3].w=t}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,s)=>this[s]).join(", ")})`}},R=class extends B{constructor(){super(...arguments);r(this,"kind","mat4x4f")}makeColumn(s,i,h,n){return J(s,i,h,n)}},Tt=E({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...e)=>new j(...e)}),vt=E({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...e)=>new S(...e)}),kt=E({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...e)=>new R(...e)});function Ct(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,s)=>e[s])}export{tt as a,et as b,r as c,N as d,D as e,F as f,K as g,U as h,L as i,W as j,nt as k,rt as l,k as m,q as n,xt as o,ot as p,Vt as q,H as r,_t as s,mt as t,zt as u,J as v,at as w,lt as x,pt as y,Tt as z,vt as A,kt as B,Ct as C};
4
- //# sourceMappingURL=chunk-C5JKINT2.js.map
4
+ //# sourceMappingURL=chunk-ZHXAQ2YE.js.map