typegpu 0.5.1 → 0.5.3
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.
- package/chunk-DVZNNZFQ.js +2 -0
- package/{chunk-VOFHV4Z6.js.map → chunk-DVZNNZFQ.js.map} +1 -1
- package/chunk-FM3TKZFZ.cjs +2 -0
- package/chunk-FM3TKZFZ.cjs.map +1 -0
- package/chunk-M4VUFFPZ.cjs +4 -0
- package/chunk-M4VUFFPZ.cjs.map +1 -0
- package/chunk-RMXVIINO.js +2 -0
- package/{chunk-KVOFUY5A.js.map → chunk-RMXVIINO.js.map} +1 -1
- package/chunk-UHU5Z2IS.js +4 -0
- package/{chunk-DR55IHDD.js.map → chunk-UHU5Z2IS.js.map} +1 -1
- package/chunk-UPPJES6W.cjs +2 -0
- package/chunk-UPPJES6W.cjs.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.cjs.map +1 -1
- package/data/index.js +1 -1
- package/index.cjs +17 -17
- package/index.cjs.map +1 -1
- package/index.js +17 -17
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/std/index.cjs +1 -1
- package/std/index.cjs.map +1 -1
- package/std/index.js +1 -1
- package/chunk-3JTP2ATR.cjs +0 -2
- package/chunk-3JTP2ATR.cjs.map +0 -1
- package/chunk-3QXCKMEJ.cjs +0 -2
- package/chunk-3QXCKMEJ.cjs.map +0 -1
- package/chunk-DR55IHDD.js +0 -4
- package/chunk-KVOFUY5A.js +0 -2
- package/chunk-QRLTUOBJ.cjs +0 -4
- package/chunk-QRLTUOBJ.cjs.map +0 -1
- package/chunk-VOFHV4Z6.js +0 -2
@@ -0,0 +1,4 @@
|
|
1
|
+
var M="Invariant failed";function S(t,e){if(t)return;throw new Error(M)}var L=class t extends Error{constructor(n,r){let s=r.map(i=>`- ${i}`);s.length>20&&(s=[...s.slice(0,11),"...",...s.slice(-10)]);super(`Resolution of the following tree failed:
|
2
|
+
${s.join(`
|
3
|
+
`)}: ${n&&typeof n=="object"&&"message"in n?n.message:n}`);this.cause=n;this.trace=r;Object.setPrototypeOf(this,t.prototype)}appendToTrace(n){let r=[n,...this.trace];return new t(this.cause,r)}},E=class t extends Error{constructor(n){super(`Missing value for '${n}'`);this.slot=n;Object.setPrototypeOf(this,t.prototype)}},N=class t extends Error{constructor(e){super(`Buffer '${e.label??"<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,t.prototype)}},G=class t extends Error{constructor(e,n){super(`The function '${e??"<unnamed>"}' is missing links to the following external values: ${n}.`),Object.setPrototypeOf(this,t.prototype)}},K=class t extends Error{constructor(e){super(`Missing bind groups for layouts: '${[...e].map(n=>n.label??"<unnamed>").join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,t.prototype)}},q=class t extends Error{constructor(e){super(`Missing vertex buffers for layouts: '${[...e].map(n=>n.label??"<unnamed>").join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,t.prototype)}};var I=null,J=Symbol("CPU"),Q=Symbol("GPU"),X={CPU:J,GPU:Q},v=[];function _e(t,e){S(I===null,"Cannot nest context providers"),I=t;try{return e()}finally{I=null}}function Ae(){return I}function Ie(t){v.push(t)}function ke(t){let e=v.pop();t!==void 0&&S(e===t,"Unexpected mode")}var H=()=>v.length>0&&v[v.length-1]===X.GPU;function*Se(t){let e=0;for(;;)t.has(e)||(yield e),e++}function y(t,e){return(...n)=>H()?e(...n):t(...n)}var _=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])}},a=class extends _{0;1;constructor(e,n){super(2),this[0]=e??0,this[1]=n??e??0}get x(){return this[0]}get y(){return this[1]}set x(e){this[0]=e}set y(e){this[1]=e}},o=class extends _{0;1;2;constructor(e,n,r){super(3),this[0]=e??0,this[1]=n??e??0,this[2]=r??e??0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this[0]=e}set y(e){this[1]=e}set z(e){this[2]=e}},c=class extends _{0;1;2;3;constructor(e,n,r,s){super(4),this[0]=e??0,this[1]=n??e??0,this[2]=r??e??0,this[3]=s??e??0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(e){this[0]=e}set y(e){this[1]=e}set z(e){this[2]=e}set w(e){this[3]=e}},w=class t extends a{get kind(){return"vec2f"}get _Vec2(){return t}get _Vec3(){return m}get _Vec4(){return T}},x=class t extends a{get kind(){return"vec2h"}get _Vec2(){return t}get _Vec3(){return d}get _Vec4(){return p}},l=class t extends a{get kind(){return"vec2i"}get _Vec2(){return t}get _Vec3(){return V}get _Vec4(){return b}},z=class t extends a{get kind(){return"vec2u"}get _Vec2(){return t}get _Vec3(){return g}get _Vec4(){return f}},m=class t extends o{get kind(){return"vec3f"}get _Vec2(){return w}get _Vec3(){return t}get _Vec4(){return T}},d=class t extends o{get kind(){return"vec3h"}get _Vec2(){return x}get _Vec3(){return t}get _Vec4(){return p}},V=class t extends o{get kind(){return"vec3i"}get _Vec2(){return l}get _Vec3(){return t}get _Vec4(){return b}},g=class t extends o{get kind(){return"vec3u"}get _Vec2(){return z}get _Vec3(){return t}get _Vec4(){return f}},T=class t extends c{get kind(){return"vec4f"}get _Vec2(){return w}get _Vec3(){return m}get _Vec4(){return t}},p=class t extends c{get kind(){return"vec4h"}get _Vec2(){return x}get _Vec3(){return d}get _Vec4(){return t}},b=class t extends c{get kind(){return"vec4i"}get _Vec2(){return l}get _Vec3(){return V}get _Vec4(){return t}},f=class t extends c{get kind(){return"vec4u"}get _Vec2(){return z}get _Vec3(){return g}get _Vec4(){return t}};var P=h(w),Y=h(x),Z=h(l),ee=h(z),$=h(m),te=h(d),ne=h(V),se=h(g),D=h(T),re=h(p),ie=h(b),he=h(f),ye={vec2f:P,vec2h:Y,vec2i:Z,vec2u:ee,vec3f:$,vec3h:te,vec3i:ne,vec3u:se,vec4f:D,vec4h:re,vec4i:ie,vec4u:he};function h(t){let{kind:e,length:n}=new t,r=y((...s)=>{let i=new Array(s.length),u=0;for(let A of s)if(typeof A=="number")i[u++]=A;else for(let C=0;C<A.length;++C)i[u++]=A[C];if(i.length<=1||i.length===n)return new t(...i);throw new Error(`'${e}' constructor called with invalid number of arguments.`)},(...s)=>({value:`${e}(${s.map(i=>i.value).join(", ")})`,dataType:ye[e]}));return Object.assign(r,{type:e,"~repr":void 0})}function j(t){let e={"~repr":void 0,type:t.type,label:t.type},n=y((...r)=>{let s=[];for(let i of r)if(typeof i=="number")s.push(i);else for(let u=0;u<i.length;++u)s.push(i[u]);for(let i=s.length;i<t.columns*t.rows;++i)s.push(0);return t.makeFromElements(...s)},(...r)=>({value:`${e.type}(${r.map(s=>s.value).join(", ")})`,dataType:e}));return Object.assign(n,e)}var B=class{columns;length=4;constructor(...e){this.columns=[this.makeColumn(e[0],e[1]),this.makeColumn(e[2],e[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(e){this.columns[0].x=e}set 1(e){this.columns[0].y=e}set 2(e){this.columns[1].x=e}set 3(e){this.columns[1].y=e}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((e,n)=>this[n]).join(", ")})`}},U=class extends B{kind="mat2x2f";makeColumn(e,n){return P(e,n)}},F=class{columns;length=12;constructor(...e){this.columns=[this.makeColumn(e[0],e[1],e[2]),this.makeColumn(e[3],e[4],e[5]),this.makeColumn(e[6],e[7],e[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(e){this.columns[0].x=e}set 1(e){this.columns[0].y=e}set 2(e){this.columns[0].z=e}set 3(e){}set 4(e){this.columns[1].x=e}set 5(e){this.columns[1].y=e}set 6(e){this.columns[1].z=e}set 7(e){}set 8(e){this.columns[2].x=e}set 9(e){this.columns[2].y=e}set 10(e){this.columns[2].z=e}set 11(e){}"~resolve"(){return`${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`}},W=class extends F{kind="mat3x3f";makeColumn(e,n,r){return $(e,n,r)}},O=class{columns;constructor(...e){this.columns=[this.makeColumn(e[0],e[1],e[2],e[3]),this.makeColumn(e[4],e[5],e[6],e[7]),this.makeColumn(e[8],e[9],e[10],e[11]),this.makeColumn(e[12],e[13],e[14],e[15])]}length=16;get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return this.columns[0].w}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return this.columns[1].w}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return this.columns[2].w}get 12(){return this.columns[3].x}get 13(){return this.columns[3].y}get 14(){return this.columns[3].z}get 15(){return this.columns[3].w}set 0(e){this.columns[0].x=e}set 1(e){this.columns[0].y=e}set 2(e){this.columns[0].z=e}set 3(e){this.columns[0].w=e}set 4(e){this.columns[1].x=e}set 5(e){this.columns[1].y=e}set 6(e){this.columns[1].z=e}set 7(e){this.columns[1].w=e}set 8(e){this.columns[2].x=e}set 9(e){this.columns[2].y=e}set 10(e){this.columns[2].z=e}set 11(e){this.columns[2].w=e}set 12(e){this.columns[3].x=e}set 13(e){this.columns[3].y=e}set 14(e){this.columns[3].z=e}set 15(e){this.columns[3].w=e}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((e,n)=>this[n]).join(", ")})`}},R=class extends O{kind="mat4x4f";makeColumn(e,n,r,s){return D(e,n,r,s)}},Oe=j({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...t)=>new U(...t)}),Re=j({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...t)=>new W(...t)}),je=j({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...t)=>new R(...t)});function Le(t){return t.kind==="mat3x3f"?[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]]:Array.from({length:t.length}).map((e,n)=>t[n])}import k from"typed-binary";var Ke={type:"abstractInt"},qe={type:"abstractFloat"},He={type:"bool"},ue=y(t=>typeof t=="boolean"?t?1:0:Number.isInteger(t)?((t<0||t>4294967295)&&console.warn(`u32 value ${t} overflowed`),(t&4294967295)>>>0):Math.max(0,Math.min(4294967295,Math.floor(t))),t=>({value:`u32(${t.value})`,dataType:ae})),ae=Object.assign(ue,{type:"u32"}),oe=y(t=>{if(typeof t=="boolean")return t?1:0;if(Number.isInteger(t))return(t<-2147483648||t>2147483647)&&console.warn(`i32 value ${t} overflowed`),(t|0)&4294967295;let e=t<0?Math.ceil(t):Math.floor(t);return Math.max(-2147483648,Math.min(2147483647,e))},t=>({value:`i32(${t.value})`,dataType:ce})),ce=Object.assign(oe,{type:"i32"}),we=y(t=>{if(typeof t=="boolean")return t?1:0;let e=new Float32Array(1);return e[0]=t,e[0]},t=>({value:`f32(${t.value})`,dataType:xe})),xe=Object.assign(we,{type:"f32"}),le=y(t=>{if(typeof t=="boolean")return t?1:0;let e=new ArrayBuffer(2);return k.f16.write(new k.BufferWriter(e),t),k.f16.read(new k.BufferReader(e))},t=>({value:`f16(${t.value})`,dataType:ze})),ze=Object.assign(le,{type:"f16"});var me=["bool","f32","f16","i32","u32","vec2f","vec2h","vec2i","vec2u","vec3f","vec3h","vec3i","vec3u","vec4f","vec4h","vec4i","vec4u","mat2x2f","mat3x3f","mat4x4f","struct","array","ptr","atomic","decorated","abstractInt","abstractFloat"];function de(t){return t?.type.startsWith("vec2")}function Ve(t){return t?.type.startsWith("vec3")}function ge(t){return t?.type.startsWith("vec4")}function Qe(t){return de(t)||Ve(t)||ge(t)}function Te(t){return t?.type==="mat2x2f"}function pe(t){return t?.type==="mat3x3f"}function be(t){return t?.type==="mat4x4f"}function Xe(t){return Te(t)||pe(t)||be(t)}function Ye(t){return me.includes(t?.type)}function Ze(t){return t?.type==="array"}function et(t){return t?.type==="struct"}function tt(t){return t?.type==="ptr"}function nt(t){return t?.type==="atomic"}function st(t){return t?.type==="@align"}function rt(t){return t?.type==="@size"}function it(t){return t?.type==="@location"}function ht(t){return t?.type==="@interpolate"}function yt(t){return t?.type==="@builtin"}function ut(t){return t?.type==="decorated"}export{S as a,L as b,E as c,N as d,G as e,K as f,q as g,X as h,_e as i,Ae as j,Ie as k,ke as l,H as m,Se as n,y as o,P as p,Y as q,Z as r,ee as s,$ as t,te as u,ne as v,se as w,D as x,re as y,ie as z,he as A,Oe as B,Re as C,je as D,Le as E,Ke as F,qe as G,He as H,ae as I,ce as J,xe as K,ze as L,de as M,Ve as N,Qe as O,Te as P,pe as Q,Xe as R,Ye as S,Ze as T,et as U,tt as V,nt as W,st as X,rt as Y,it as Z,ht as _,yt as $,ut as aa};
|
4
|
+
//# sourceMappingURL=chunk-UHU5Z2IS.js.map
|