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
package/std/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{g as W}from"../chunk-KVOFUY5A.js";import{A as o,B as u,C as d,D as h,E as F,F as N,G as J,K as C,L as ne,N as E,V as f,r as n,s as y,t as l,u as m,v as T,w as v,x,y as i,z as w}from"../chunk-DR55IHDD.js";var ye=n(()=>{throw new Error("discard() can only be used on the GPU.")},()=>({value:"discard;",dataType:W}));var K=e=>Math.sqrt(e.x**2+e.y**2),R=e=>Math.sqrt(e.x**2+e.y**2+e.z**2),U=e=>Math.sqrt(e.x**2+e.y**2+e.z**2+e.w**2),P=(e,t)=>e.x*t.x+e.y*t.y,_=(e,t)=>e.x*t.x+e.y*t.y+e.z*t.z,G=(e,t)=>e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,r=(e,t,a)=>Math.min(Math.max(t,e),a),g=e=>t=>y(e(t.x),e(t.y)),p=e=>t=>l(e(t.x),e(t.y)),z=e=>t=>m(e(t.x),e(t.y)),M=e=>t=>T(e(t.x),e(t.y)),B=e=>t=>v(e(t.x),e(t.y),e(t.z)),b=e=>t=>x(e(t.x),e(t.y),e(t.z)),$=e=>t=>i(e(t.x),e(t.y),e(t.z)),A=e=>t=>w(e(t.x),e(t.y),e(t.z)),V=e=>t=>o(e(t.x),e(t.y),e(t.z),e(t.w)),O=e=>t=>u(e(t.x),e(t.y),e(t.z),e(t.w)),k=e=>t=>d(e(t.x),e(t.y),e(t.z),e(t.w)),I=e=>t=>h(e(t.x),e(t.y),e(t.z),e(t.w)),L=e=>(t,a)=>y(e(t.x,a.x),e(t.y,a.y)),j=e=>(t,a)=>l(e(t.x,a.x),e(t.y,a.y)),q=e=>(t,a)=>m(e(t.x,a.x),e(t.y,a.y)),X=e=>(t,a)=>T(e(t.x,a.x),e(t.y,a.y)),Z=e=>(t,a)=>v(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),H=e=>(t,a)=>x(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),Q=e=>(t,a)=>i(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),Y=e=>(t,a)=>w(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),ee=e=>(t,a)=>o(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),te=e=>(t,a)=>u(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),ae=e=>(t,a)=>d(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),se=e=>(t,a)=>h(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),c={abs:{vec2f:g(Math.abs),vec2h:p(Math.abs),vec2i:z(Math.abs),vec2u:M(Math.abs),vec3f:B(Math.abs),vec3h:b(Math.abs),vec3i:$(Math.abs),vec3u:A(Math.abs),vec4f:V(Math.abs),vec4h:O(Math.abs),vec4i:k(Math.abs),vec4u:I(Math.abs)},atan2:{vec2f:L(Math.atan2),vec2h:j(Math.atan2),vec2i:q(Math.atan2),vec2u:X(Math.atan2),vec3f:Z(Math.atan2),vec3h:H(Math.atan2),vec3i:Q(Math.atan2),vec3u:Y(Math.atan2),vec4f:ee(Math.atan2),vec4h:te(Math.atan2),vec4i:ae(Math.atan2),vec4u:se(Math.atan2)},acos:{vec2f:g(Math.acos),vec2h:p(Math.acos),vec2i:z(Math.acos),vec2u:M(Math.acos),vec3f:B(Math.acos),vec3h:b(Math.acos),vec3i:$(Math.acos),vec3u:A(Math.acos),vec4f:V(Math.acos),vec4h:O(Math.acos),vec4i:k(Math.acos),vec4u:I(Math.acos)},asin:{vec2f:g(Math.asin),vec2h:p(Math.asin),vec2i:z(Math.asin),vec2u:M(Math.asin),vec3f:B(Math.asin),vec3h:b(Math.asin),vec3i:$(Math.asin),vec3u:A(Math.asin),vec4f:V(Math.asin),vec4h:O(Math.asin),vec4i:k(Math.asin),vec4u:I(Math.asin)},ceil:{vec2f:g(Math.ceil),vec2h:p(Math.ceil),vec2i:z(Math.ceil),vec2u:M(Math.ceil),vec3f:B(Math.ceil),vec3h:b(Math.ceil),vec3i:$(Math.ceil),vec3u:A(Math.ceil),vec4f:V(Math.ceil),vec4h:O(Math.ceil),vec4i:k(Math.ceil),vec4u:I(Math.ceil)},clamp:{vec2f:(e,t,a)=>y(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec2h:(e,t,a)=>l(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec2i:(e,t,a)=>m(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec2u:(e,t,a)=>T(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec3f:(e,t,a)=>v(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec3h:(e,t,a)=>x(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec3i:(e,t,a)=>i(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec3u:(e,t,a)=>w(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec4f:(e,t,a)=>o(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w)),vec4h:(e,t,a)=>u(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w)),vec4i:(e,t,a)=>d(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w)),vec4u:(e,t,a)=>h(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w))},length:{vec2f:K,vec2h:K,vec2i:K,vec2u:K,vec3f:R,vec3h:R,vec3i:R,vec3u:R,vec4f:U,vec4h:U,vec4i:U,vec4u:U},add:{vec2f:(e,t)=>y(e.x+t.x,e.y+t.y),vec2h:(e,t)=>l(e.x+t.x,e.y+t.y),vec2i:(e,t)=>m(e.x+t.x,e.y+t.y),vec2u:(e,t)=>T(e.x+t.x,e.y+t.y),vec3f:(e,t)=>v(e.x+t.x,e.y+t.y,e.z+t.z),vec3h:(e,t)=>x(e.x+t.x,e.y+t.y,e.z+t.z),vec3i:(e,t)=>i(e.x+t.x,e.y+t.y,e.z+t.z),vec3u:(e,t)=>w(e.x+t.x,e.y+t.y,e.z+t.z),vec4f:(e,t)=>o(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w),vec4h:(e,t)=>u(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w),vec4i:(e,t)=>d(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w),vec4u:(e,t)=>h(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w)},sub:{vec2f:(e,t)=>y(e.x-t.x,e.y-t.y),vec2h:(e,t)=>l(e.x-t.x,e.y-t.y),vec2i:(e,t)=>m(e.x-t.x,e.y-t.y),vec2u:(e,t)=>T(e.x-t.x,e.y-t.y),vec3f:(e,t)=>v(e.x-t.x,e.y-t.y,e.z-t.z),vec3h:(e,t)=>x(e.x-t.x,e.y-t.y,e.z-t.z),vec3i:(e,t)=>i(e.x-t.x,e.y-t.y,e.z-t.z),vec3u:(e,t)=>w(e.x-t.x,e.y-t.y,e.z-t.z),vec4f:(e,t)=>o(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w),vec4h:(e,t)=>u(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w),vec4i:(e,t)=>d(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w),vec4u:(e,t)=>h(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w)},mulSxV:{vec2f:(e,t)=>y(e*t.x,e*t.y),vec2h:(e,t)=>l(e*t.x,e*t.y),vec2i:(e,t)=>m(e*t.x,e*t.y),vec2u:(e,t)=>T(e*t.x,e*t.y),vec3f:(e,t)=>v(e*t.x,e*t.y,e*t.z),vec3h:(e,t)=>x(e*t.x,e*t.y,e*t.z),vec3i:(e,t)=>i(e*t.x,e*t.y,e*t.z),vec3u:(e,t)=>w(e*t.x,e*t.y,e*t.z),vec4f:(e,t)=>o(e*t.x,e*t.y,e*t.z,e*t.w),vec4h:(e,t)=>u(e*t.x,e*t.y,e*t.z,e*t.w),vec4i:(e,t)=>d(e*t.x,e*t.y,e*t.z,e*t.w),vec4u:(e,t)=>h(e*t.x,e*t.y,e*t.z,e*t.w),mat2x2f:(e,t)=>{let a=t.columns;return F(e*a[0].x,e*a[0].y,e*a[1].x,e*a[1].y)},mat3x3f:(e,t)=>{let a=t.columns;return N(e*a[0].x,e*a[0].y,e*a[0].z,e*a[1].x,e*a[1].y,e*a[1].z,e*a[2].x,e*a[2].y,e*a[2].z)},mat4x4f:(e,t)=>{let a=t.columns;return J(e*a[0].x,e*a[0].y,e*a[0].z,e*a[0].w,e*a[1].x,e*a[1].y,e*a[1].z,e*a[1].w,e*a[2].x,e*a[2].y,e*a[2].z,e*a[2].w,e*a[3].x,e*a[3].y,e*a[3].z,e*a[3].w)}},mulVxV:{vec2f:(e,t)=>y(e.x*t.x,e.y*t.y),vec2h:(e,t)=>l(e.x*t.x,e.y*t.y),vec2i:(e,t)=>m(e.x*t.x,e.y*t.y),vec2u:(e,t)=>T(e.x*t.x,e.y*t.y),vec3f:(e,t)=>v(e.x*t.x,e.y*t.y,e.z*t.z),vec3h:(e,t)=>x(e.x*t.x,e.y*t.y,e.z*t.z),vec3i:(e,t)=>i(e.x*t.x,e.y*t.y,e.z*t.z),vec3u:(e,t)=>w(e.x*t.x,e.y*t.y,e.z*t.z),vec4f:(e,t)=>o(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),vec4h:(e,t)=>u(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),vec4i:(e,t)=>d(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),vec4u:(e,t)=>h(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),mat2x2f:(e,t)=>{let a=e.columns,s=t.columns;return F(a[0].x*s[0].x+a[1].x*s[0].y,a[0].y*s[0].x+a[1].y*s[0].y,a[0].x*s[1].x+a[1].x*s[1].y,a[0].y*s[1].x+a[1].y*s[1].y)},mat3x3f:(e,t)=>{let a=e.columns,s=t.columns;return N(a[0].x*s[0].x+a[1].x*s[0].y+a[2].x*s[0].z,a[0].y*s[0].x+a[1].y*s[0].y+a[2].y*s[0].z,a[0].z*s[0].x+a[1].z*s[0].y+a[2].z*s[0].z,a[0].x*s[1].x+a[1].x*s[1].y+a[2].x*s[1].z,a[0].y*s[1].x+a[1].y*s[1].y+a[2].y*s[1].z,a[0].z*s[1].x+a[1].z*s[1].y+a[2].z*s[1].z,a[0].x*s[2].x+a[1].x*s[2].y+a[2].x*s[2].z,a[0].y*s[2].x+a[1].y*s[2].y+a[2].y*s[2].z,a[0].z*s[2].x+a[1].z*s[2].y+a[2].z*s[2].z)},mat4x4f:(e,t)=>{let a=e.columns,s=t.columns;return J(a[0].x*s[0].x+a[1].x*s[0].y+a[2].x*s[0].z+a[3].x*s[0].w,a[0].y*s[0].x+a[1].y*s[0].y+a[2].y*s[0].z+a[3].y*s[0].w,a[0].z*s[0].x+a[1].z*s[0].y+a[2].z*s[0].z+a[3].z*s[0].w,a[0].w*s[0].x+a[1].w*s[0].y+a[2].w*s[0].z+a[3].w*s[0].w,a[0].x*s[1].x+a[1].x*s[1].y+a[2].x*s[1].z+a[3].x*s[1].w,a[0].y*s[1].x+a[1].y*s[1].y+a[2].y*s[1].z+a[3].y*s[1].w,a[0].z*s[1].x+a[1].z*s[1].y+a[2].z*s[1].z+a[3].z*s[1].w,a[0].w*s[1].x+a[1].w*s[1].y+a[2].w*s[1].z+a[3].w*s[1].w,a[0].x*s[2].x+a[1].x*s[2].y+a[2].x*s[2].z+a[3].x*s[2].w,a[0].y*s[2].x+a[1].y*s[2].y+a[2].y*s[2].z+a[3].y*s[2].w,a[0].z*s[2].x+a[1].z*s[2].y+a[2].z*s[2].z+a[3].z*s[2].w,a[0].w*s[2].x+a[1].w*s[2].y+a[2].w*s[2].z+a[3].w*s[2].w,a[0].x*s[3].x+a[1].x*s[3].y+a[2].x*s[3].z+a[3].x*s[3].w,a[0].y*s[3].x+a[1].y*s[3].y+a[2].y*s[3].z+a[3].y*s[3].w,a[0].z*s[3].x+a[1].z*s[3].y+a[2].z*s[3].z+a[3].z*s[3].w,a[0].w*s[3].x+a[1].w*s[3].y+a[2].w*s[3].z+a[3].w*s[3].w)}},mulMxV:{mat2x2f:(e,t)=>{let a=e.columns;return y(a[0].x*t.x+a[1].x*t.y,a[0].y*t.x+a[1].y*t.y)},mat3x3f:(e,t)=>{let a=e.columns;return v(a[0].x*t.x+a[1].x*t.y+a[2].x*t.z,a[0].y*t.x+a[1].y*t.y+a[2].y*t.z,a[0].z*t.x+a[1].z*t.y+a[2].z*t.z)},mat4x4f:(e,t)=>{let a=e.columns;return o(a[0].x*t.x+a[1].x*t.y+a[2].x*t.z+a[3].x*t.w,a[0].y*t.x+a[1].y*t.y+a[2].y*t.z+a[3].y*t.w,a[0].z*t.x+a[1].z*t.y+a[2].z*t.z+a[3].z*t.w,a[0].w*t.x+a[1].w*t.y+a[2].w*t.z+a[3].w*t.w)}},mulVxM:{mat2x2f:(e,t)=>{let a=t.columns;return y(e.x*a[0].x+e.y*a[0].y,e.x*a[1].x+e.y*a[1].y)},mat3x3f:(e,t)=>{let a=t.columns;return v(e.x*a[0].x+e.y*a[0].y+e.z*a[0].z,e.x*a[1].x+e.y*a[1].y+e.z*a[1].z,e.x*a[2].x+e.y*a[2].y+e.z*a[2].z)},mat4x4f:(e,t)=>{let a=t.columns;return o(e.x*a[0].x+e.y*a[0].y+e.z*a[0].z+e.w*a[0].w,e.x*a[1].x+e.y*a[1].y+e.z*a[1].z+e.w*a[1].w,e.x*a[2].x+e.y*a[2].y+e.z*a[2].z+e.w*a[2].w,e.x*a[3].x+e.y*a[3].y+e.z*a[3].z+e.w*a[3].w)}},dot:{vec2f:P,vec2h:P,vec2i:P,vec2u:P,vec3f:_,vec3h:_,vec3i:_,vec3u:_,vec4f:G,vec4h:G,vec4i:G,vec4u:G},normalize:{vec2f:e=>{let t=K(e);return y(e.x/t,e.y/t)},vec2h:e=>{let t=K(e);return l(e.x/t,e.y/t)},vec2i:e=>{let t=K(e);return m(e.x/t,e.y/t)},vec2u:e=>{let t=K(e);return T(e.x/t,e.y/t)},vec3f:e=>{let t=R(e);return v(e.x/t,e.y/t,e.z/t)},vec3h:e=>{let t=R(e);return x(e.x/t,e.y/t,e.z/t)},vec3i:e=>{let t=R(e);return i(e.x/t,e.y/t,e.z/t)},vec3u:e=>{let t=R(e);return w(e.x/t,e.y/t,e.z/t)},vec4f:e=>{let t=U(e);return o(e.x/t,e.y/t,e.z/t,e.w/t)},vec4h:e=>{let t=U(e);return u(e.x/t,e.y/t,e.z/t,e.w/t)},vec4i:e=>{let t=U(e);return d(e.x/t,e.y/t,e.z/t,e.w/t)},vec4u:e=>{let t=U(e);return h(e.x/t,e.y/t,e.z/t,e.w/t)}},cross:{vec3f:(e,t)=>v(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3h:(e,t)=>x(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3i:(e,t)=>i(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3u:(e,t)=>w(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x)},floor:{vec2f:g(Math.floor),vec2h:p(Math.floor),vec2i:z(Math.floor),vec2u:M(Math.floor),vec3f:B(Math.floor),vec3h:b(Math.floor),vec3i:$(Math.floor),vec3u:A(Math.floor),vec4f:V(Math.floor),vec4h:O(Math.floor),vec4i:k(Math.floor),vec4u:I(Math.floor)},max:{vec2f:L(Math.max),vec2h:j(Math.max),vec2i:q(Math.max),vec2u:X(Math.max),vec3f:Z(Math.max),vec3h:H(Math.max),vec3i:Q(Math.max),vec3u:Y(Math.max),vec4f:ee(Math.max),vec4h:te(Math.max),vec4i:ae(Math.max),vec4u:se(Math.max)},min:{vec2f:L(Math.min),vec2h:j(Math.min),vec2i:q(Math.min),vec2u:X(Math.min),vec3f:Z(Math.min),vec3h:H(Math.min),vec3i:Q(Math.min),vec3u:Y(Math.min),vec4f:ee(Math.min),vec4h:te(Math.min),vec4i:ae(Math.min),vec4u:se(Math.min)},pow:{vec2f:(e,t)=>y(e.x**t.x,e.y**t.y),vec2h:(e,t)=>l(e.x**t.x,e.y**t.y),vec3f:(e,t)=>v(e.x**t.x,e.y**t.y,e.z**t.z),vec3h:(e,t)=>x(e.x**t.x,e.y**t.y,e.z**t.z),vec4f:(e,t)=>o(e.x**t.x,e.y**t.y,e.z**t.z,e.w**t.w),vec4h:(e,t)=>u(e.x**t.x,e.y**t.y,e.z**t.z,e.w**t.w)},mix:{vec2f:(e,t,a)=>typeof a=="number"?y(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a):y(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y),vec2h:(e,t,a)=>typeof a=="number"?l(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a):l(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y),vec3f:(e,t,a)=>typeof a=="number"?v(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a):v(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z),vec3h:(e,t,a)=>typeof a=="number"?x(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a):x(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z),vec4f:(e,t,a)=>typeof a=="number"?o(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a,e.w*(1-a)+t.w*a):o(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z,e.w*(1-a.w)+t.w*a.w),vec4h:(e,t,a)=>typeof a=="number"?u(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a,e.w*(1-a)+t.w*a):u(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z,e.w*(1-a.w)+t.w*a.w)},sin:{vec2f:g(Math.sin),vec2h:p(Math.sin),vec2i:z(Math.sin),vec2u:M(Math.sin),vec3f:B(Math.sin),vec3h:b(Math.sin),vec3i:$(Math.sin),vec3u:A(Math.sin),vec4f:V(Math.sin),vec4h:O(Math.sin),vec4i:k(Math.sin),vec4u:I(Math.sin)},cos:{vec2f:g(Math.cos),vec2h:p(Math.cos),vec2i:z(Math.cos),vec2u:M(Math.cos),vec3f:B(Math.cos),vec3h:b(Math.cos),vec3i:$(Math.cos),vec3u:A(Math.cos),vec4f:V(Math.cos),vec4h:O(Math.cos),vec4i:k(Math.cos),vec4u:I(Math.cos)},exp:{vec2f:g(Math.exp),vec2h:p(Math.exp),vec2i:z(Math.exp),vec2u:M(Math.exp),vec3f:B(Math.exp),vec3h:b(Math.exp),vec3i:$(Math.exp),vec3u:A(Math.exp),vec4f:V(Math.exp),vec4h:O(Math.exp),vec4i:k(Math.exp),vec4u:I(Math.exp)},fract:{vec2f:g(e=>e-Math.floor(e)),vec2h:p(e=>e-Math.floor(e)),vec2i:z(e=>e-Math.floor(e)),vec2u:M(e=>e-Math.floor(e)),vec3f:B(e=>e-Math.floor(e)),vec3h:b(e=>e-Math.floor(e)),vec3i:$(e=>e-Math.floor(e)),vec3u:A(e=>e-Math.floor(e)),vec4f:V(e=>e-Math.floor(e)),vec4h:O(e=>e-Math.floor(e)),vec4i:k(e=>e-Math.floor(e)),vec4u:I(e=>e-Math.floor(e))},isCloseToZero:{vec2f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t,vec2h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t,vec3f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t,vec3h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t,vec4f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t&&Math.abs(e.w)<=t,vec4h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t&&Math.abs(e.w)<=t}};function S(e){let t=e.dataType.type;return t==="abstractInt"||t==="abstractFloat"||t==="f32"||t==="f16"||t==="i32"||t==="u32"}var oe=n((e,t)=>c.add[e.kind](e,t),(e,t)=>({value:`(${e.value} + ${t.value})`,dataType:e.dataType})),D=n((e,t)=>c.sub[e.kind](e,t),(e,t)=>({value:`(${e.value} - ${t.value})`,dataType:e.dataType})),re=n((e,t)=>{if(typeof e=="number")return c.mulSxV[t.kind](e,t);if(typeof e=="object"&&typeof t=="object"&&"kind"in e&&"kind"in t){let a=!e.kind.startsWith("mat"),s=!t.kind.startsWith("mat");if(!a&&s)return c.mulMxV[e.kind](e,t);if(a&&!s)return c.mulVxM[t.kind](e,t)}return c.mulVxV[t.kind](e,t)},(e,t)=>{let a=S(e)?t.dataType:e.dataType.type.startsWith("mat")?t.dataType.type.startsWith("mat")?e.dataType:t.dataType:e.dataType;return{value:`(${e.value} * ${t.value})`,dataType:a}}),xe=n(e=>typeof e=="number"?Math.abs(e):c.abs[e.kind](e),e=>({value:`abs(${e.value})`,dataType:e.dataType})),le=n((e,t)=>typeof e=="number"&&typeof t=="number"?Math.atan2(e,t):c.atan2[e.kind](e,t),(e,t)=>({value:`atan2(${e.value}, ${t.value})`,dataType:e.dataType})),ue=n(e=>typeof e=="number"?Math.acos(e):c.acos[e.kind](e),e=>({value:`acos(${e.value})`,dataType:e.dataType})),ie=n(e=>typeof e=="number"?Math.asin(e):c.asin[e.kind](e),e=>({value:`asin(${e.value})`,dataType:e.dataType})),we=n(e=>typeof e=="number"?Math.ceil(e):c.ceil[e.kind](e),e=>({value:`ceil(${e.value})`,dataType:e.dataType})),fe=n((e,t,a)=>typeof e=="number"?Math.min(Math.max(t,e),a):c.clamp[e.kind](e,t,a),(e,t,a)=>({value:`clamp(${e.value}, ${t.value}, ${a.value})`,dataType:e.dataType})),me=n(e=>typeof e=="number"?Math.cos(e):c.cos[e.kind](e),e=>({value:`cos(${e.value})`,dataType:e.dataType})),Te=n((e,t)=>c.cross[e.kind](e,t),(e,t)=>({value:`cross(${e.value}, ${t.value})`,dataType:e.dataType})),ce=n((e,t)=>c.dot[e.kind](e,t),(e,t)=>({value:`dot(${e.value}, ${t.value})`,dataType:E})),de=n(e=>c.normalize[e.kind](e),e=>({value:`normalize(${e.value})`,dataType:e.dataType})),he=n(e=>typeof e=="number"?Math.floor(e):c.floor[e.kind](e),e=>({value:`floor(${e.value})`,dataType:e.dataType})),ge=n(e=>typeof e=="number"?e-Math.floor(e):c.fract[e.kind](e),e=>({value:`fract(${e.value})`,dataType:e.dataType})),ve=n(e=>typeof e=="number"?Math.abs(e):c.length[e.kind](e),e=>({value:`length(${e.value})`,dataType:E})),pe=n((e,t)=>typeof e=="number"?Math.max(e,t):c.max[e.kind](e,t),(e,t)=>({value:`max(${e.value}, ${t.value})`,dataType:e.dataType})),ze=n((e,t)=>typeof e=="number"?Math.min(e,t):c.min[e.kind](e,t),(e,t)=>({value:`min(${e.value}, ${t.value})`,dataType:e.dataType})),Me=n(e=>typeof e=="number"?Math.sin(e):c.sin[e.kind](e),e=>({value:`sin(${e.value})`,dataType:e.dataType})),Be=n(e=>typeof e=="number"?Math.exp(e):c.exp[e.kind](e),e=>({value:`exp(${e.value})`,dataType:e.dataType})),be=n((e,t)=>{if(typeof e=="number"&&typeof t=="number")return e**t;if(typeof e=="object"&&typeof t=="object"&&"kind"in e&&"kind"in t)return c.pow[e.kind](e,t);throw new Error("Invalid arguments to pow()")},(e,t)=>({value:`pow(${e.value}, ${t.value})`,dataType:e.dataType})),$e=n((e,t,a)=>{if(typeof e=="number"){if(typeof a!="number"||typeof t!="number")throw new Error("When e1 and e2 are numbers, the blend factor must be a number.");return e*(1-a)+t*a}if(typeof e=="number"||typeof t=="number")throw new Error("e1 and e2 need to both be vectors of the same kind.");return c.mix[e.kind](e,t,a)},(e,t,a)=>({value:`mix(${e.value}, ${t.value}, ${a.value})`,dataType:e.dataType})),Ae=n((e,t)=>D(e,re(2*ce(t,e),t)),(e,t)=>({value:`reflect(${e.value}, ${t.value})`,dataType:e.dataType})),Ve=n((e,t)=>typeof e=="number"&&typeof t=="number"?Math.abs(e-t):ve(D(e,t)),(e,t)=>({value:`distance(${e.value}, ${t.value})`,dataType:E})),Oe=n((e,t,a=.01)=>typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<a:typeof e!="number"&&typeof t!="number"?c.isCloseToZero[e.kind](D(e,t),a):!1,(e,t,a={value:.01,dataType:E})=>S(e)&&S(t)?{value:`abs(f32(${e.value})-f32(${t.value})) <= ${a.value}`,dataType:C}:!S(e)&&!S(t)?{value:`all(abs(${e.value}-${t.value}) <= (${e.value} - ${e.value})+${a.value})`,dataType:C}:{value:"false",dataType:C});var ke=n(()=>console.warn("workgroupBarrier is a no-op outside of GPU mode."),()=>({value:"workgroupBarrier()",dataType:W})),Ie=n(()=>console.warn("storageBarrier is a no-op outside of GPU mode."),()=>({value:"storageBarrier()",dataType:W})),Ke=n(()=>console.warn("textureBarrier is a no-op outside of GPU mode."),()=>({value:"textureBarrier()",dataType:W})),Re=n(e=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},e=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicLoad(&${e.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ue=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(!f(e.dataType)||e.dataType.type!=="atomic")throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`);return{value:`atomicStore(&${e.value}, ${t.value})`,dataType:W}}),We=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicAdd(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ee=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicSub(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Se=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicMax(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ce=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicMin(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Pe=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicAnd(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),_e=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicOr(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ge=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicXor(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)});var De=n(e=>e.length,e=>({value:`arrayLength(&${e.value})`,dataType:ne}));export{xe as abs,ue as acos,oe as add,De as arrayLength,ie as asin,le as atan2,We as atomicAdd,Pe as atomicAnd,Re as atomicLoad,Se as atomicMax,Ce as atomicMin,_e as atomicOr,Ue as atomicStore,Ee as atomicSub,Ge as atomicXor,we as ceil,fe as clamp,me as cos,Te as cross,ye as discard,Ve as distance,ce as dot,Be as exp,he as floor,ge as fract,Oe as isCloseTo,ve as length,pe as max,ze as min,$e as mix,re as mul,de as normalize,be as pow,Ae as reflect,Me as sin,Ie as storageBarrier,D as sub,Ke as textureBarrier,ke as workgroupBarrier};
|
1
|
+
import{g as W}from"../chunk-RMXVIINO.js";import{A as h,B as F,C as N,D as J,H as C,I as ne,K as E,S as f,o as n,p as y,q as l,r as m,s as T,t as v,u as x,v as i,w,x as o,y as u,z as d}from"../chunk-UHU5Z2IS.js";var ye=n(()=>{throw new Error("discard() can only be used on the GPU.")},()=>({value:"discard;",dataType:W}));var K=e=>Math.sqrt(e.x**2+e.y**2),R=e=>Math.sqrt(e.x**2+e.y**2+e.z**2),U=e=>Math.sqrt(e.x**2+e.y**2+e.z**2+e.w**2),P=(e,t)=>e.x*t.x+e.y*t.y,_=(e,t)=>e.x*t.x+e.y*t.y+e.z*t.z,G=(e,t)=>e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,r=(e,t,a)=>Math.min(Math.max(t,e),a),g=e=>t=>y(e(t.x),e(t.y)),p=e=>t=>l(e(t.x),e(t.y)),z=e=>t=>m(e(t.x),e(t.y)),M=e=>t=>T(e(t.x),e(t.y)),B=e=>t=>v(e(t.x),e(t.y),e(t.z)),b=e=>t=>x(e(t.x),e(t.y),e(t.z)),$=e=>t=>i(e(t.x),e(t.y),e(t.z)),A=e=>t=>w(e(t.x),e(t.y),e(t.z)),V=e=>t=>o(e(t.x),e(t.y),e(t.z),e(t.w)),O=e=>t=>u(e(t.x),e(t.y),e(t.z),e(t.w)),k=e=>t=>d(e(t.x),e(t.y),e(t.z),e(t.w)),I=e=>t=>h(e(t.x),e(t.y),e(t.z),e(t.w)),L=e=>(t,a)=>y(e(t.x,a.x),e(t.y,a.y)),j=e=>(t,a)=>l(e(t.x,a.x),e(t.y,a.y)),q=e=>(t,a)=>m(e(t.x,a.x),e(t.y,a.y)),X=e=>(t,a)=>T(e(t.x,a.x),e(t.y,a.y)),Z=e=>(t,a)=>v(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),H=e=>(t,a)=>x(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),Q=e=>(t,a)=>i(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),Y=e=>(t,a)=>w(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z)),ee=e=>(t,a)=>o(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),te=e=>(t,a)=>u(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),ae=e=>(t,a)=>d(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),se=e=>(t,a)=>h(e(t.x,a.x),e(t.y,a.y),e(t.z,a.z),e(t.w,a.w)),c={abs:{vec2f:g(Math.abs),vec2h:p(Math.abs),vec2i:z(Math.abs),vec2u:M(Math.abs),vec3f:B(Math.abs),vec3h:b(Math.abs),vec3i:$(Math.abs),vec3u:A(Math.abs),vec4f:V(Math.abs),vec4h:O(Math.abs),vec4i:k(Math.abs),vec4u:I(Math.abs)},atan2:{vec2f:L(Math.atan2),vec2h:j(Math.atan2),vec2i:q(Math.atan2),vec2u:X(Math.atan2),vec3f:Z(Math.atan2),vec3h:H(Math.atan2),vec3i:Q(Math.atan2),vec3u:Y(Math.atan2),vec4f:ee(Math.atan2),vec4h:te(Math.atan2),vec4i:ae(Math.atan2),vec4u:se(Math.atan2)},acos:{vec2f:g(Math.acos),vec2h:p(Math.acos),vec2i:z(Math.acos),vec2u:M(Math.acos),vec3f:B(Math.acos),vec3h:b(Math.acos),vec3i:$(Math.acos),vec3u:A(Math.acos),vec4f:V(Math.acos),vec4h:O(Math.acos),vec4i:k(Math.acos),vec4u:I(Math.acos)},asin:{vec2f:g(Math.asin),vec2h:p(Math.asin),vec2i:z(Math.asin),vec2u:M(Math.asin),vec3f:B(Math.asin),vec3h:b(Math.asin),vec3i:$(Math.asin),vec3u:A(Math.asin),vec4f:V(Math.asin),vec4h:O(Math.asin),vec4i:k(Math.asin),vec4u:I(Math.asin)},ceil:{vec2f:g(Math.ceil),vec2h:p(Math.ceil),vec2i:z(Math.ceil),vec2u:M(Math.ceil),vec3f:B(Math.ceil),vec3h:b(Math.ceil),vec3i:$(Math.ceil),vec3u:A(Math.ceil),vec4f:V(Math.ceil),vec4h:O(Math.ceil),vec4i:k(Math.ceil),vec4u:I(Math.ceil)},clamp:{vec2f:(e,t,a)=>y(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec2h:(e,t,a)=>l(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec2i:(e,t,a)=>m(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec2u:(e,t,a)=>T(r(e.x,t.x,a.x),r(e.y,t.y,a.y)),vec3f:(e,t,a)=>v(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec3h:(e,t,a)=>x(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec3i:(e,t,a)=>i(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec3u:(e,t,a)=>w(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z)),vec4f:(e,t,a)=>o(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w)),vec4h:(e,t,a)=>u(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w)),vec4i:(e,t,a)=>d(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w)),vec4u:(e,t,a)=>h(r(e.x,t.x,a.x),r(e.y,t.y,a.y),r(e.z,t.z,a.z),r(e.w,t.w,a.w))},length:{vec2f:K,vec2h:K,vec2i:K,vec2u:K,vec3f:R,vec3h:R,vec3i:R,vec3u:R,vec4f:U,vec4h:U,vec4i:U,vec4u:U},add:{vec2f:(e,t)=>y(e.x+t.x,e.y+t.y),vec2h:(e,t)=>l(e.x+t.x,e.y+t.y),vec2i:(e,t)=>m(e.x+t.x,e.y+t.y),vec2u:(e,t)=>T(e.x+t.x,e.y+t.y),vec3f:(e,t)=>v(e.x+t.x,e.y+t.y,e.z+t.z),vec3h:(e,t)=>x(e.x+t.x,e.y+t.y,e.z+t.z),vec3i:(e,t)=>i(e.x+t.x,e.y+t.y,e.z+t.z),vec3u:(e,t)=>w(e.x+t.x,e.y+t.y,e.z+t.z),vec4f:(e,t)=>o(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w),vec4h:(e,t)=>u(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w),vec4i:(e,t)=>d(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w),vec4u:(e,t)=>h(e.x+t.x,e.y+t.y,e.z+t.z,e.w+t.w)},sub:{vec2f:(e,t)=>y(e.x-t.x,e.y-t.y),vec2h:(e,t)=>l(e.x-t.x,e.y-t.y),vec2i:(e,t)=>m(e.x-t.x,e.y-t.y),vec2u:(e,t)=>T(e.x-t.x,e.y-t.y),vec3f:(e,t)=>v(e.x-t.x,e.y-t.y,e.z-t.z),vec3h:(e,t)=>x(e.x-t.x,e.y-t.y,e.z-t.z),vec3i:(e,t)=>i(e.x-t.x,e.y-t.y,e.z-t.z),vec3u:(e,t)=>w(e.x-t.x,e.y-t.y,e.z-t.z),vec4f:(e,t)=>o(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w),vec4h:(e,t)=>u(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w),vec4i:(e,t)=>d(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w),vec4u:(e,t)=>h(e.x-t.x,e.y-t.y,e.z-t.z,e.w-t.w)},mulSxV:{vec2f:(e,t)=>y(e*t.x,e*t.y),vec2h:(e,t)=>l(e*t.x,e*t.y),vec2i:(e,t)=>m(e*t.x,e*t.y),vec2u:(e,t)=>T(e*t.x,e*t.y),vec3f:(e,t)=>v(e*t.x,e*t.y,e*t.z),vec3h:(e,t)=>x(e*t.x,e*t.y,e*t.z),vec3i:(e,t)=>i(e*t.x,e*t.y,e*t.z),vec3u:(e,t)=>w(e*t.x,e*t.y,e*t.z),vec4f:(e,t)=>o(e*t.x,e*t.y,e*t.z,e*t.w),vec4h:(e,t)=>u(e*t.x,e*t.y,e*t.z,e*t.w),vec4i:(e,t)=>d(e*t.x,e*t.y,e*t.z,e*t.w),vec4u:(e,t)=>h(e*t.x,e*t.y,e*t.z,e*t.w),mat2x2f:(e,t)=>{let a=t.columns;return F(e*a[0].x,e*a[0].y,e*a[1].x,e*a[1].y)},mat3x3f:(e,t)=>{let a=t.columns;return N(e*a[0].x,e*a[0].y,e*a[0].z,e*a[1].x,e*a[1].y,e*a[1].z,e*a[2].x,e*a[2].y,e*a[2].z)},mat4x4f:(e,t)=>{let a=t.columns;return J(e*a[0].x,e*a[0].y,e*a[0].z,e*a[0].w,e*a[1].x,e*a[1].y,e*a[1].z,e*a[1].w,e*a[2].x,e*a[2].y,e*a[2].z,e*a[2].w,e*a[3].x,e*a[3].y,e*a[3].z,e*a[3].w)}},mulVxV:{vec2f:(e,t)=>y(e.x*t.x,e.y*t.y),vec2h:(e,t)=>l(e.x*t.x,e.y*t.y),vec2i:(e,t)=>m(e.x*t.x,e.y*t.y),vec2u:(e,t)=>T(e.x*t.x,e.y*t.y),vec3f:(e,t)=>v(e.x*t.x,e.y*t.y,e.z*t.z),vec3h:(e,t)=>x(e.x*t.x,e.y*t.y,e.z*t.z),vec3i:(e,t)=>i(e.x*t.x,e.y*t.y,e.z*t.z),vec3u:(e,t)=>w(e.x*t.x,e.y*t.y,e.z*t.z),vec4f:(e,t)=>o(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),vec4h:(e,t)=>u(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),vec4i:(e,t)=>d(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),vec4u:(e,t)=>h(e.x*t.x,e.y*t.y,e.z*t.z,e.w*t.w),mat2x2f:(e,t)=>{let a=e.columns,s=t.columns;return F(a[0].x*s[0].x+a[1].x*s[0].y,a[0].y*s[0].x+a[1].y*s[0].y,a[0].x*s[1].x+a[1].x*s[1].y,a[0].y*s[1].x+a[1].y*s[1].y)},mat3x3f:(e,t)=>{let a=e.columns,s=t.columns;return N(a[0].x*s[0].x+a[1].x*s[0].y+a[2].x*s[0].z,a[0].y*s[0].x+a[1].y*s[0].y+a[2].y*s[0].z,a[0].z*s[0].x+a[1].z*s[0].y+a[2].z*s[0].z,a[0].x*s[1].x+a[1].x*s[1].y+a[2].x*s[1].z,a[0].y*s[1].x+a[1].y*s[1].y+a[2].y*s[1].z,a[0].z*s[1].x+a[1].z*s[1].y+a[2].z*s[1].z,a[0].x*s[2].x+a[1].x*s[2].y+a[2].x*s[2].z,a[0].y*s[2].x+a[1].y*s[2].y+a[2].y*s[2].z,a[0].z*s[2].x+a[1].z*s[2].y+a[2].z*s[2].z)},mat4x4f:(e,t)=>{let a=e.columns,s=t.columns;return J(a[0].x*s[0].x+a[1].x*s[0].y+a[2].x*s[0].z+a[3].x*s[0].w,a[0].y*s[0].x+a[1].y*s[0].y+a[2].y*s[0].z+a[3].y*s[0].w,a[0].z*s[0].x+a[1].z*s[0].y+a[2].z*s[0].z+a[3].z*s[0].w,a[0].w*s[0].x+a[1].w*s[0].y+a[2].w*s[0].z+a[3].w*s[0].w,a[0].x*s[1].x+a[1].x*s[1].y+a[2].x*s[1].z+a[3].x*s[1].w,a[0].y*s[1].x+a[1].y*s[1].y+a[2].y*s[1].z+a[3].y*s[1].w,a[0].z*s[1].x+a[1].z*s[1].y+a[2].z*s[1].z+a[3].z*s[1].w,a[0].w*s[1].x+a[1].w*s[1].y+a[2].w*s[1].z+a[3].w*s[1].w,a[0].x*s[2].x+a[1].x*s[2].y+a[2].x*s[2].z+a[3].x*s[2].w,a[0].y*s[2].x+a[1].y*s[2].y+a[2].y*s[2].z+a[3].y*s[2].w,a[0].z*s[2].x+a[1].z*s[2].y+a[2].z*s[2].z+a[3].z*s[2].w,a[0].w*s[2].x+a[1].w*s[2].y+a[2].w*s[2].z+a[3].w*s[2].w,a[0].x*s[3].x+a[1].x*s[3].y+a[2].x*s[3].z+a[3].x*s[3].w,a[0].y*s[3].x+a[1].y*s[3].y+a[2].y*s[3].z+a[3].y*s[3].w,a[0].z*s[3].x+a[1].z*s[3].y+a[2].z*s[3].z+a[3].z*s[3].w,a[0].w*s[3].x+a[1].w*s[3].y+a[2].w*s[3].z+a[3].w*s[3].w)}},mulMxV:{mat2x2f:(e,t)=>{let a=e.columns;return y(a[0].x*t.x+a[1].x*t.y,a[0].y*t.x+a[1].y*t.y)},mat3x3f:(e,t)=>{let a=e.columns;return v(a[0].x*t.x+a[1].x*t.y+a[2].x*t.z,a[0].y*t.x+a[1].y*t.y+a[2].y*t.z,a[0].z*t.x+a[1].z*t.y+a[2].z*t.z)},mat4x4f:(e,t)=>{let a=e.columns;return o(a[0].x*t.x+a[1].x*t.y+a[2].x*t.z+a[3].x*t.w,a[0].y*t.x+a[1].y*t.y+a[2].y*t.z+a[3].y*t.w,a[0].z*t.x+a[1].z*t.y+a[2].z*t.z+a[3].z*t.w,a[0].w*t.x+a[1].w*t.y+a[2].w*t.z+a[3].w*t.w)}},mulVxM:{mat2x2f:(e,t)=>{let a=t.columns;return y(e.x*a[0].x+e.y*a[0].y,e.x*a[1].x+e.y*a[1].y)},mat3x3f:(e,t)=>{let a=t.columns;return v(e.x*a[0].x+e.y*a[0].y+e.z*a[0].z,e.x*a[1].x+e.y*a[1].y+e.z*a[1].z,e.x*a[2].x+e.y*a[2].y+e.z*a[2].z)},mat4x4f:(e,t)=>{let a=t.columns;return o(e.x*a[0].x+e.y*a[0].y+e.z*a[0].z+e.w*a[0].w,e.x*a[1].x+e.y*a[1].y+e.z*a[1].z+e.w*a[1].w,e.x*a[2].x+e.y*a[2].y+e.z*a[2].z+e.w*a[2].w,e.x*a[3].x+e.y*a[3].y+e.z*a[3].z+e.w*a[3].w)}},dot:{vec2f:P,vec2h:P,vec2i:P,vec2u:P,vec3f:_,vec3h:_,vec3i:_,vec3u:_,vec4f:G,vec4h:G,vec4i:G,vec4u:G},normalize:{vec2f:e=>{let t=K(e);return y(e.x/t,e.y/t)},vec2h:e=>{let t=K(e);return l(e.x/t,e.y/t)},vec2i:e=>{let t=K(e);return m(e.x/t,e.y/t)},vec2u:e=>{let t=K(e);return T(e.x/t,e.y/t)},vec3f:e=>{let t=R(e);return v(e.x/t,e.y/t,e.z/t)},vec3h:e=>{let t=R(e);return x(e.x/t,e.y/t,e.z/t)},vec3i:e=>{let t=R(e);return i(e.x/t,e.y/t,e.z/t)},vec3u:e=>{let t=R(e);return w(e.x/t,e.y/t,e.z/t)},vec4f:e=>{let t=U(e);return o(e.x/t,e.y/t,e.z/t,e.w/t)},vec4h:e=>{let t=U(e);return u(e.x/t,e.y/t,e.z/t,e.w/t)},vec4i:e=>{let t=U(e);return d(e.x/t,e.y/t,e.z/t,e.w/t)},vec4u:e=>{let t=U(e);return h(e.x/t,e.y/t,e.z/t,e.w/t)}},cross:{vec3f:(e,t)=>v(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3h:(e,t)=>x(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3i:(e,t)=>i(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x),vec3u:(e,t)=>w(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z,e.x*t.y-e.y*t.x)},floor:{vec2f:g(Math.floor),vec2h:p(Math.floor),vec2i:z(Math.floor),vec2u:M(Math.floor),vec3f:B(Math.floor),vec3h:b(Math.floor),vec3i:$(Math.floor),vec3u:A(Math.floor),vec4f:V(Math.floor),vec4h:O(Math.floor),vec4i:k(Math.floor),vec4u:I(Math.floor)},max:{vec2f:L(Math.max),vec2h:j(Math.max),vec2i:q(Math.max),vec2u:X(Math.max),vec3f:Z(Math.max),vec3h:H(Math.max),vec3i:Q(Math.max),vec3u:Y(Math.max),vec4f:ee(Math.max),vec4h:te(Math.max),vec4i:ae(Math.max),vec4u:se(Math.max)},min:{vec2f:L(Math.min),vec2h:j(Math.min),vec2i:q(Math.min),vec2u:X(Math.min),vec3f:Z(Math.min),vec3h:H(Math.min),vec3i:Q(Math.min),vec3u:Y(Math.min),vec4f:ee(Math.min),vec4h:te(Math.min),vec4i:ae(Math.min),vec4u:se(Math.min)},pow:{vec2f:(e,t)=>y(e.x**t.x,e.y**t.y),vec2h:(e,t)=>l(e.x**t.x,e.y**t.y),vec3f:(e,t)=>v(e.x**t.x,e.y**t.y,e.z**t.z),vec3h:(e,t)=>x(e.x**t.x,e.y**t.y,e.z**t.z),vec4f:(e,t)=>o(e.x**t.x,e.y**t.y,e.z**t.z,e.w**t.w),vec4h:(e,t)=>u(e.x**t.x,e.y**t.y,e.z**t.z,e.w**t.w)},mix:{vec2f:(e,t,a)=>typeof a=="number"?y(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a):y(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y),vec2h:(e,t,a)=>typeof a=="number"?l(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a):l(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y),vec3f:(e,t,a)=>typeof a=="number"?v(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a):v(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z),vec3h:(e,t,a)=>typeof a=="number"?x(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a):x(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z),vec4f:(e,t,a)=>typeof a=="number"?o(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a,e.w*(1-a)+t.w*a):o(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z,e.w*(1-a.w)+t.w*a.w),vec4h:(e,t,a)=>typeof a=="number"?u(e.x*(1-a)+t.x*a,e.y*(1-a)+t.y*a,e.z*(1-a)+t.z*a,e.w*(1-a)+t.w*a):u(e.x*(1-a.x)+t.x*a.x,e.y*(1-a.y)+t.y*a.y,e.z*(1-a.z)+t.z*a.z,e.w*(1-a.w)+t.w*a.w)},sin:{vec2f:g(Math.sin),vec2h:p(Math.sin),vec2i:z(Math.sin),vec2u:M(Math.sin),vec3f:B(Math.sin),vec3h:b(Math.sin),vec3i:$(Math.sin),vec3u:A(Math.sin),vec4f:V(Math.sin),vec4h:O(Math.sin),vec4i:k(Math.sin),vec4u:I(Math.sin)},cos:{vec2f:g(Math.cos),vec2h:p(Math.cos),vec2i:z(Math.cos),vec2u:M(Math.cos),vec3f:B(Math.cos),vec3h:b(Math.cos),vec3i:$(Math.cos),vec3u:A(Math.cos),vec4f:V(Math.cos),vec4h:O(Math.cos),vec4i:k(Math.cos),vec4u:I(Math.cos)},exp:{vec2f:g(Math.exp),vec2h:p(Math.exp),vec2i:z(Math.exp),vec2u:M(Math.exp),vec3f:B(Math.exp),vec3h:b(Math.exp),vec3i:$(Math.exp),vec3u:A(Math.exp),vec4f:V(Math.exp),vec4h:O(Math.exp),vec4i:k(Math.exp),vec4u:I(Math.exp)},fract:{vec2f:g(e=>e-Math.floor(e)),vec2h:p(e=>e-Math.floor(e)),vec2i:z(e=>e-Math.floor(e)),vec2u:M(e=>e-Math.floor(e)),vec3f:B(e=>e-Math.floor(e)),vec3h:b(e=>e-Math.floor(e)),vec3i:$(e=>e-Math.floor(e)),vec3u:A(e=>e-Math.floor(e)),vec4f:V(e=>e-Math.floor(e)),vec4h:O(e=>e-Math.floor(e)),vec4i:k(e=>e-Math.floor(e)),vec4u:I(e=>e-Math.floor(e))},isCloseToZero:{vec2f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t,vec2h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t,vec3f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t,vec3h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t,vec4f:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t&&Math.abs(e.w)<=t,vec4h:(e,t)=>Math.abs(e.x)<=t&&Math.abs(e.y)<=t&&Math.abs(e.z)<=t&&Math.abs(e.w)<=t}};function S(e){let t=e.dataType.type;return t==="abstractInt"||t==="abstractFloat"||t==="f32"||t==="f16"||t==="i32"||t==="u32"}var oe=n((e,t)=>c.add[e.kind](e,t),(e,t)=>({value:`(${e.value} + ${t.value})`,dataType:e.dataType})),D=n((e,t)=>c.sub[e.kind](e,t),(e,t)=>({value:`(${e.value} - ${t.value})`,dataType:e.dataType})),re=n((e,t)=>{if(typeof e=="number")return c.mulSxV[t.kind](e,t);if(typeof e=="object"&&typeof t=="object"&&"kind"in e&&"kind"in t){let a=!e.kind.startsWith("mat"),s=!t.kind.startsWith("mat");if(!a&&s)return c.mulMxV[e.kind](e,t);if(a&&!s)return c.mulVxM[t.kind](e,t)}return c.mulVxV[t.kind](e,t)},(e,t)=>{let a=S(e)?t.dataType:e.dataType.type.startsWith("mat")?t.dataType.type.startsWith("mat")?e.dataType:t.dataType:e.dataType;return{value:`(${e.value} * ${t.value})`,dataType:a}}),xe=n(e=>typeof e=="number"?Math.abs(e):c.abs[e.kind](e),e=>({value:`abs(${e.value})`,dataType:e.dataType})),le=n((e,t)=>typeof e=="number"&&typeof t=="number"?Math.atan2(e,t):c.atan2[e.kind](e,t),(e,t)=>({value:`atan2(${e.value}, ${t.value})`,dataType:e.dataType})),ue=n(e=>typeof e=="number"?Math.acos(e):c.acos[e.kind](e),e=>({value:`acos(${e.value})`,dataType:e.dataType})),ie=n(e=>typeof e=="number"?Math.asin(e):c.asin[e.kind](e),e=>({value:`asin(${e.value})`,dataType:e.dataType})),we=n(e=>typeof e=="number"?Math.ceil(e):c.ceil[e.kind](e),e=>({value:`ceil(${e.value})`,dataType:e.dataType})),fe=n((e,t,a)=>typeof e=="number"?Math.min(Math.max(t,e),a):c.clamp[e.kind](e,t,a),(e,t,a)=>({value:`clamp(${e.value}, ${t.value}, ${a.value})`,dataType:e.dataType})),me=n(e=>typeof e=="number"?Math.cos(e):c.cos[e.kind](e),e=>({value:`cos(${e.value})`,dataType:e.dataType})),Te=n((e,t)=>c.cross[e.kind](e,t),(e,t)=>({value:`cross(${e.value}, ${t.value})`,dataType:e.dataType})),ce=n((e,t)=>c.dot[e.kind](e,t),(e,t)=>({value:`dot(${e.value}, ${t.value})`,dataType:E})),de=n(e=>c.normalize[e.kind](e),e=>({value:`normalize(${e.value})`,dataType:e.dataType})),he=n(e=>typeof e=="number"?Math.floor(e):c.floor[e.kind](e),e=>({value:`floor(${e.value})`,dataType:e.dataType})),ge=n(e=>typeof e=="number"?e-Math.floor(e):c.fract[e.kind](e),e=>({value:`fract(${e.value})`,dataType:e.dataType})),ve=n(e=>typeof e=="number"?Math.abs(e):c.length[e.kind](e),e=>({value:`length(${e.value})`,dataType:E})),pe=n((e,t)=>typeof e=="number"?Math.max(e,t):c.max[e.kind](e,t),(e,t)=>({value:`max(${e.value}, ${t.value})`,dataType:e.dataType})),ze=n((e,t)=>typeof e=="number"?Math.min(e,t):c.min[e.kind](e,t),(e,t)=>({value:`min(${e.value}, ${t.value})`,dataType:e.dataType})),Me=n(e=>typeof e=="number"?Math.sin(e):c.sin[e.kind](e),e=>({value:`sin(${e.value})`,dataType:e.dataType})),Be=n(e=>typeof e=="number"?Math.exp(e):c.exp[e.kind](e),e=>({value:`exp(${e.value})`,dataType:e.dataType})),be=n((e,t)=>{if(typeof e=="number"&&typeof t=="number")return e**t;if(typeof e=="object"&&typeof t=="object"&&"kind"in e&&"kind"in t)return c.pow[e.kind](e,t);throw new Error("Invalid arguments to pow()")},(e,t)=>({value:`pow(${e.value}, ${t.value})`,dataType:e.dataType})),$e=n((e,t,a)=>{if(typeof e=="number"){if(typeof a!="number"||typeof t!="number")throw new Error("When e1 and e2 are numbers, the blend factor must be a number.");return e*(1-a)+t*a}if(typeof e=="number"||typeof t=="number")throw new Error("e1 and e2 need to both be vectors of the same kind.");return c.mix[e.kind](e,t,a)},(e,t,a)=>({value:`mix(${e.value}, ${t.value}, ${a.value})`,dataType:e.dataType})),Ae=n((e,t)=>D(e,re(2*ce(t,e),t)),(e,t)=>({value:`reflect(${e.value}, ${t.value})`,dataType:e.dataType})),Ve=n((e,t)=>typeof e=="number"&&typeof t=="number"?Math.abs(e-t):ve(D(e,t)),(e,t)=>({value:`distance(${e.value}, ${t.value})`,dataType:E})),Oe=n((e,t,a=.01)=>typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<a:typeof e!="number"&&typeof t!="number"?c.isCloseToZero[e.kind](D(e,t),a):!1,(e,t,a={value:.01,dataType:E})=>S(e)&&S(t)?{value:`abs(f32(${e.value})-f32(${t.value})) <= ${a.value}`,dataType:C}:!S(e)&&!S(t)?{value:`all(abs(${e.value}-${t.value}) <= (${e.value} - ${e.value})+${a.value})`,dataType:C}:{value:"false",dataType:C});var ke=n(()=>console.warn("workgroupBarrier is a no-op outside of GPU mode."),()=>({value:"workgroupBarrier()",dataType:W})),Ie=n(()=>console.warn("storageBarrier is a no-op outside of GPU mode."),()=>({value:"storageBarrier()",dataType:W})),Ke=n(()=>console.warn("textureBarrier is a no-op outside of GPU mode."),()=>({value:"textureBarrier()",dataType:W})),Re=n(e=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},e=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicLoad(&${e.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ue=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(!f(e.dataType)||e.dataType.type!=="atomic")throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`);return{value:`atomicStore(&${e.value}, ${t.value})`,dataType:W}}),We=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicAdd(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ee=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicSub(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Se=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicMax(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ce=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicMin(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Pe=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicAnd(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),_e=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicOr(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)}),Ge=n((e,t)=>{throw new Error("Atomic operations are not supported outside of GPU mode.")},(e,t)=>{if(f(e.dataType)&&e.dataType.type==="atomic")return{value:`atomicXor(&${e.value}, ${t.value})`,dataType:e.dataType.inner};throw new Error(`Invalid atomic type: ${JSON.stringify(e.dataType,null,2)}`)});var De=n(e=>e.length,e=>({value:`arrayLength(&${e.value})`,dataType:ne}));export{xe as abs,ue as acos,oe as add,De as arrayLength,ie as asin,le as atan2,We as atomicAdd,Pe as atomicAnd,Re as atomicLoad,Se as atomicMax,Ce as atomicMin,_e as atomicOr,Ue as atomicStore,Ee as atomicSub,Ge as atomicXor,we as ceil,fe as clamp,me as cos,Te as cross,ye as discard,Ve as distance,ce as dot,Be as exp,he as floor,ge as fract,Oe as isCloseTo,ve as length,pe as max,ze as min,$e as mix,re as mul,de as normalize,be as pow,Ae as reflect,Me as sin,Ie as storageBarrier,D as sub,Ke as textureBarrier,ke as workgroupBarrier};
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/chunk-3JTP2ATR.cjs
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQRLTUOBJcjs = require('./chunk-QRLTUOBJ.cjs');function r(e){return(e==null?void 0:e.resourceType)==="slot"}function o(e){return(e==null?void 0:e.resourceType)==="derived"}function p(e){return(e==null?void 0:e["~providing"])!==void 0}function u(e){return(e==null?void 0:e.resourceType)==="accessor"}var a=Symbol("internal");var f={type:"unknown"},c= exports.g ={type:"void"};function i(e){return typeof(e==null?void 0:e["~resolve"])=="function"}function d(e){return typeof e=="number"||typeof e=="boolean"||typeof e=="string"||i(e)||_chunkQRLTUOBJcjs.V.call(void 0, e)||r(e)||o(e)||p(e)}function m(e){return!!e&&typeof e=="object"&&"getMappedRange"in e&&"mapAsync"in e}function x(e){return(e==null?void 0:e.resourceType)==="buffer-usage"}function b(e){var t;return!!e&&typeof e=="object"&&!!((t=e==null?void 0:e[a])!=null&&t.dataType)}exports.a = a; exports.b = r; exports.c = o; exports.d = p; exports.e = u; exports.f = f; exports.g = c; exports.h = i; exports.i = d; exports.j = m; exports.k = x; exports.l = b;
|
2
|
-
//# sourceMappingURL=chunk-3JTP2ATR.cjs.map
|
package/chunk-3JTP2ATR.cjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["/Users/marcinhawryluk/Documents/wigsill/packages/typegpu/dist/chunk-3JTP2ATR.cjs","../src/core/slot/slotTypes.ts","../src/shared/symbols.ts","../src/types.ts"],"names":["isSlot","value","isDerived","isProviding","isAccessor","$internal","UnknownData","Void","isSelfResolvable","isWgsl","isWgslData","isGPUBuffer","isBufferUsage","hasInternalDataType","_a"],"mappings":"AAAA,iIAAwC,SCiExBA,CAAAA,CAAUC,CAAAA,CAAoD,CAC5E,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAuB,YAAA,CAAA,GAAiB,MAClD,CAEO,SAASC,CAAAA,CACdD,CAAAA,CACY,CACZ,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,YAAA,CAAA,GAAiB,SACxC,CAEO,SAASE,CAAAA,CACdF,CAAAA,CACsC,CACtC,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAwC,YAAA,CAAA,CAAA,GAAkB,KAAA,CACpE,CAEO,SAASG,CAAAA,CACdH,CAAAA,CAC0B,CAC1B,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAA2B,YAAA,CAAA,GAAiB,UACtD,CCrFO,IAAMI,CAAAA,CAAY,MAAA,CAAO,UAAU,CAAA,CCuEnC,IAAMC,CAAAA,CAAc,CACzB,IAAA,CAAM,SACR,CAAA,CAEaC,CAAAA,aAAO,CAClB,IAAA,CAAM,MACR,CAAA,CAgHO,SAASC,CAAAA,CAAiBP,CAAAA,CAAyC,CACxE,OAAO,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAA2B,UAAA,CAAA,CAAA,EAAgB,UAC5D,CAEO,SAASQ,CAAAA,CAAOR,CAAAA,CAA+B,CACpD,OACE,OAAOA,CAAAA,EAAU,QAAA,EACjB,OAAOA,CAAAA,EAAU,SAAA,EACjB,OAAOA,CAAAA,EAAU,QAAA,EACjBO,CAAAA,CAAiBP,CAAK,CAAA,EACtBS,iCAAAA,CAAgB,CAAA,EAChBV,CAAAA,CAAOC,CAAK,CAAA,EACZC,CAAAA,CAAUD,CAAK,CAAA,EACfE,CAAAA,CAAYF,CAAK,CAErB,CAKO,SAASU,CAAAA,CAAYV,CAAAA,CAAoC,CAC9D,MACE,CAAC,CAACA,CAAAA,EACF,OAAOA,CAAAA,EAAU,QAAA,EACjB,gBAAA,GAAoBA,CAAAA,EACpB,UAAA,GAAcA,CAElB,CAEO,SAASW,CAAAA,CAKdX,CAAAA,CAAgC,CAChC,MAAA,CAAQA,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAa,YAAA,CAAA,GAAiB,cACxC,CAEO,SAASY,CAAAA,CACdZ,CAAAA,CACkD,CArOpD,IAAAa,CAAAA,CAsOE,MACE,CAAC,CAACb,CAAAA,EACF,OAAOA,CAAAA,EAAU,QAAA,EACjB,CAAC,CAAA,CAAA,CAAEa,CAAAA,CAAAb,CAAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAAA,CAAAA,CAAoDI,CAAAA,CAAAA,CAAAA,EAApD,IAAA,EAAAS,CAAAA,CAAgE,QAAA,CAEvE,CAAA,mLAAA","file":"/Users/marcinhawryluk/Documents/wigsill/packages/typegpu/dist/chunk-3JTP2ATR.cjs","sourcesContent":[null,"import type { AnyWgslData } from '../../data';\nimport type { TgpuNamable } from '../../namable';\nimport type { Infer } from '../../shared/repr';\nimport type { Labelled } from '../../types';\nimport type { TgpuFn } from '../function/tgpuFn';\nimport type { TgpuBufferUsage } from './../buffer/bufferUsage';\n\nexport interface TgpuSlot<T> extends TgpuNamable, Labelled {\n readonly resourceType: 'slot';\n '~repr': Infer<T>;\n\n readonly defaultValue: T | undefined;\n\n /**\n * Used to determine if code generated using either value `a` or `b` in place\n * of the slot will be equivalent. Defaults to `Object.is`.\n */\n areEqual(a: T, b: T): boolean;\n\n readonly value: Infer<T>;\n}\n\nexport interface TgpuDerived<T> {\n readonly resourceType: 'derived';\n readonly value: Infer<T>;\n '~repr': Infer<T>;\n readonly '~providing'?: Providing | undefined;\n\n with<TValue>(slot: TgpuSlot<TValue>, value: Eventual<TValue>): TgpuDerived<T>;\n\n /**\n * @internal\n */\n '~compute'(): T;\n}\n\nexport interface TgpuAccessor<T extends AnyWgslData = AnyWgslData>\n extends TgpuNamable,\n Labelled {\n readonly resourceType: 'accessor';\n '~repr': Infer<T>;\n\n readonly schema: T;\n readonly defaultValue:\n | TgpuFn<[], T>\n | TgpuBufferUsage<T>\n | Infer<T>\n | undefined;\n readonly slot: TgpuSlot<TgpuFn<[], T> | TgpuBufferUsage<T> | Infer<T>>;\n\n readonly value: Infer<T>;\n}\n\n/**\n * Represents a value that is available at resolution time.\n */\nexport type Eventual<T> = T | TgpuSlot<T> | TgpuDerived<T>;\n\nexport type SlotValuePair<T = unknown> = [TgpuSlot<T>, T];\n\nexport type Providing = {\n inner: unknown;\n pairs: SlotValuePair[];\n};\n\nexport function isSlot<T>(value: unknown | TgpuSlot<T>): value is TgpuSlot<T> {\n return (value as TgpuSlot<T>)?.resourceType === 'slot';\n}\n\nexport function isDerived<T extends TgpuDerived<unknown>>(\n value: T | unknown,\n): value is T {\n return (value as T)?.resourceType === 'derived';\n}\n\nexport function isProviding(\n value: unknown,\n): value is { '~providing': Providing } {\n return (value as { '~providing': Providing })?.['~providing'] !== undefined;\n}\n\nexport function isAccessor<T extends AnyWgslData>(\n value: unknown | TgpuAccessor<T>,\n): value is TgpuAccessor<T> {\n return (value as TgpuAccessor<T>)?.resourceType === 'accessor';\n}\n","export const $internal = Symbol('internal');\n","import type { Block } from 'tinyest';\nimport type {\n TgpuBufferMutable,\n TgpuBufferReadonly,\n TgpuBufferUniform,\n TgpuBufferUsage,\n} from './core/buffer/bufferUsage';\nimport type { TgpuConst } from './core/constant/tgpuConstant';\nimport type { TgpuDeclare } from './core/declare/tgpuDeclare';\nimport type { TgpuComputeFn } from './core/function/tgpuComputeFn';\nimport type { TgpuFn } from './core/function/tgpuFn';\nimport type { TgpuFragmentFn } from './core/function/tgpuFragmentFn';\nimport type { TgpuVertexFn } from './core/function/tgpuVertexFn';\nimport type { TgpuComputePipeline } from './core/pipeline/computePipeline';\nimport type { TgpuRenderPipeline } from './core/pipeline/renderPipeline';\nimport type { TgpuSampler } from './core/sampler/sampler';\nimport {\n type Eventual,\n type SlotValuePair,\n type TgpuAccessor,\n type TgpuSlot,\n isDerived,\n isProviding,\n isSlot,\n} from './core/slot/slotTypes';\nimport type { TgpuExternalTexture } from './core/texture/externalTexture';\nimport type { TgpuAnyTextureView, TgpuTexture } from './core/texture/texture';\nimport type { TgpuVar } from './core/variable/tgpuVariable';\nimport type { AnyData } from './data';\nimport {\n type AbstractFloat,\n type AbstractInt,\n type AnyMatInstance,\n type AnyVecInstance,\n type AnyWgslData,\n type BaseData,\n isWgslData,\n} from './data/wgslTypes';\nimport type { NameRegistry } from './nameRegistry';\nimport type { Infer } from './shared/repr';\nimport { $internal } from './shared/symbols';\nimport type {\n TgpuBindGroupLayout,\n TgpuLayoutEntry,\n} from './tgpuBindGroupLayout';\n\nexport type ResolvableObject =\n | SelfResolvable\n | TgpuBufferUsage\n | TgpuConst\n | TgpuDeclare\n | TgpuFn\n | TgpuComputeFn\n | TgpuFragmentFn\n | TgpuComputePipeline\n | TgpuRenderPipeline\n | TgpuVertexFn\n | TgpuSampler\n | TgpuAccessor\n | TgpuExternalTexture\n | TgpuTexture\n | TgpuAnyTextureView\n | TgpuVar\n | AnyVecInstance\n | AnyMatInstance\n | AnyData\n // biome-ignore lint/suspicious/noExplicitAny: <has to be more permissive than unknown>\n | TgpuFn<any, any>;\n\nexport type Wgsl = Eventual<string | number | boolean | ResolvableObject>;\n\nexport const UnknownData = {\n type: 'unknown',\n};\nexport type UnknownData = typeof UnknownData;\nexport const Void = {\n type: 'void' as const,\n};\nexport type Void = typeof Void;\n\nexport type Resource = {\n value: unknown;\n dataType: AnyWgslData | UnknownData | AbstractInt | AbstractFloat | Void;\n};\n\nexport type TgpuShaderStage = 'compute' | 'vertex' | 'fragment';\n\nexport interface FnToWgslOptions {\n args: Resource[];\n returnType: AnyWgslData;\n body: Block;\n externalMap: Record<string, unknown>;\n}\n\nexport type ItemLayer = {\n type: 'item';\n usedSlots: Set<TgpuSlot<unknown>>;\n};\n\nexport interface ItemStateStack {\n readonly itemDepth: number;\n readonly topItem: ItemLayer;\n\n pushItem(): void;\n popItem(): void;\n pushSlotBindings(pairs: SlotValuePair<unknown>[]): void;\n popSlotBindings(): void;\n pushFunctionScope(\n args: Resource[],\n returnType: AnyWgslData | undefined,\n externalMap: Record<string, unknown>,\n ): void;\n popFunctionScope(): void;\n pushBlockScope(): void;\n popBlockScope(): void;\n pop(type?: 'functionScope' | 'blockScope' | 'slotBinding' | 'item'): void;\n readSlot<T>(slot: TgpuSlot<T>): T | undefined;\n getResourceById(id: string): Resource | undefined;\n defineBlockVariable(id: string, type: AnyWgslData | UnknownData): Resource;\n}\n\n/**\n * Passed into each resolvable item. All items in a tree share a resolution ctx,\n * but there can be layers added and removed from the item stack when going down\n * and up the tree.\n */\nexport interface ResolutionCtx {\n readonly names: NameRegistry;\n\n addDeclaration(declaration: string): void;\n\n /**\n * Reserves a bind group number, and returns a placeholder that will be replaced\n * with a concrete number at the end of the resolution process.\n */\n allocateLayoutEntry(layout: TgpuBindGroupLayout): string;\n\n /**\n * Reserves a spot in the catch-all bind group, without the indirection of a bind-group.\n * This means the resource is 'fixed', and cannot be swapped between code execution.\n */\n allocateFixedEntry(\n layoutEntry: TgpuLayoutEntry,\n resource: object,\n ): {\n group: string;\n binding: number;\n };\n\n withSlots<T>(pairs: SlotValuePair<unknown>[], callback: () => T): T;\n\n /**\n * Unwraps all layers of slot/derived indirection and returns the concrete value if available.\n * @throws {MissingSlotValueError}\n */\n unwrap<T>(eventual: Eventual<T>): T;\n\n resolve(item: unknown): string;\n resolveValue<T extends BaseData>(value: Infer<T>, schema: T): string;\n\n transpileFn(fn: string): {\n argNames: string[];\n body: Block;\n externalNames: string[];\n };\n fnToWgsl(options: FnToWgslOptions): {\n head: Wgsl;\n body: Wgsl;\n };\n\n [$internal]: {\n itemStateStack: ItemStateStack;\n };\n}\n\n/**\n * Houses a method '~resolve` that returns a code string\n * representing it, as opposed to offloading the resolution\n * to another mechanism.\n */\nexport interface SelfResolvable {\n '~resolve'(ctx: ResolutionCtx): string;\n toString(): string;\n}\n\nexport interface Labelled {\n readonly label?: string | undefined;\n}\n\nexport function isSelfResolvable(value: unknown): value is SelfResolvable {\n return typeof (value as SelfResolvable)?.['~resolve'] === 'function';\n}\n\nexport function isWgsl(value: unknown): value is Wgsl {\n return (\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'string' ||\n isSelfResolvable(value) ||\n isWgslData(value) ||\n isSlot(value) ||\n isDerived(value) ||\n isProviding(value)\n );\n}\n\nexport type BindableBufferUsage = 'uniform' | 'readonly' | 'mutable';\nexport type BufferUsage = 'uniform' | 'readonly' | 'mutable' | 'vertex';\n\nexport function isGPUBuffer(value: unknown): value is GPUBuffer {\n return (\n !!value &&\n typeof value === 'object' &&\n 'getMappedRange' in value &&\n 'mapAsync' in value\n );\n}\n\nexport function isBufferUsage<\n T extends\n | TgpuBufferUniform<BaseData>\n | TgpuBufferReadonly<BaseData>\n | TgpuBufferMutable<BaseData>,\n>(value: T | unknown): value is T {\n return (value as T)?.resourceType === 'buffer-usage';\n}\n\nexport function hasInternalDataType(\n value: unknown,\n): value is { [$internal]: { dataType: BaseData } } {\n return (\n !!value &&\n typeof value === 'object' &&\n !!(value as { [$internal]: { dataType: BaseData } })?.[$internal]?.dataType\n );\n}\n"]}
|
package/chunk-3QXCKMEJ.cjs
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQRLTUOBJcjs = require('./chunk-QRLTUOBJ.cjs');function tt(t){let e=n=>n;return Object.setPrototypeOf(e,et),e.propTypes=t,e}var et={type:"struct",_label:void 0,get label(){return this._label},$name(t){return this._label=t,this},toString(){var t;return`struct:${(t=this.label)!=null?t:"<unnamed>"}`}};var g=(t,e)=>{let n=e-1,i=~n;return(t&n)===0?t:(t&i)+e};var J=["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"],_t= exports.b ={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 rt=["unstruct","disarray","loose-decorated",...J];function W(t){return rt.includes(t==null?void 0:t.type)}function b(t){return(t==null?void 0:t.type)==="disarray"}function D(t){return(t==null?void 0:t.type)==="unstruct"}function c(t){return(t==null?void 0:t.type)==="loose-decorated"}function A(t){var e,n;return(n=(e=t.attribs)==null?void 0:e.find(_chunkQRLTUOBJcjs._))==null?void 0:n.value}function q(t){var e,n;return(n=(e=t.attribs)==null?void 0:e.find(_chunkQRLTUOBJcjs.$))==null?void 0:n.value}function Ut(t){var e,n;return(n=(e=t.attribs)==null?void 0:e.find(_chunkQRLTUOBJcjs.aa))==null?void 0:n.value}function nt(t){return _chunkQRLTUOBJcjs.V.call(void 0, t)||W(t)}var r=class{constructor(e){this.type=e;_chunkQRLTUOBJcjs.c.call(void 0, this,"~repr")}},ot= exports.k ={uint8:_chunkQRLTUOBJcjs.L,uint8x2:_chunkQRLTUOBJcjs.v,uint8x4:_chunkQRLTUOBJcjs.D,sint8:_chunkQRLTUOBJcjs.M,sint8x2:_chunkQRLTUOBJcjs.u,sint8x4:_chunkQRLTUOBJcjs.C,unorm8:_chunkQRLTUOBJcjs.N,unorm8x2:_chunkQRLTUOBJcjs.s,unorm8x4:_chunkQRLTUOBJcjs.A,snorm8:_chunkQRLTUOBJcjs.N,snorm8x2:_chunkQRLTUOBJcjs.s,snorm8x4:_chunkQRLTUOBJcjs.A,uint16:_chunkQRLTUOBJcjs.L,uint16x2:_chunkQRLTUOBJcjs.v,uint16x4:_chunkQRLTUOBJcjs.D,sint16:_chunkQRLTUOBJcjs.M,sint16x2:_chunkQRLTUOBJcjs.u,sint16x4:_chunkQRLTUOBJcjs.C,unorm16:_chunkQRLTUOBJcjs.N,unorm16x2:_chunkQRLTUOBJcjs.s,unorm16x4:_chunkQRLTUOBJcjs.A,snorm16:_chunkQRLTUOBJcjs.N,snorm16x2:_chunkQRLTUOBJcjs.s,snorm16x4:_chunkQRLTUOBJcjs.A,float16:_chunkQRLTUOBJcjs.N,float16x2:_chunkQRLTUOBJcjs.s,float16x4:_chunkQRLTUOBJcjs.A,float32:_chunkQRLTUOBJcjs.N,float32x2:_chunkQRLTUOBJcjs.s,float32x3:_chunkQRLTUOBJcjs.w,float32x4:_chunkQRLTUOBJcjs.A,uint32:_chunkQRLTUOBJcjs.L,uint32x2:_chunkQRLTUOBJcjs.v,uint32x3:_chunkQRLTUOBJcjs.z,uint32x4:_chunkQRLTUOBJcjs.D,sint32:_chunkQRLTUOBJcjs.M,sint32x2:_chunkQRLTUOBJcjs.u,sint32x3:_chunkQRLTUOBJcjs.y,sint32x4:_chunkQRLTUOBJcjs.C,"unorm10-10-10-2":_chunkQRLTUOBJcjs.A,"unorm8x4-bgra":_chunkQRLTUOBJcjs.A},Q= exports.l =Object.keys(ot),Ot= exports.m =new r("uint8"),Rt= exports.n =new r("uint8x2"),Mt= exports.o =new r("uint8x4"),Nt= exports.p =new r("sint8"),Gt= exports.q =new r("sint8x2"),$t= exports.r =new r("sint8x4"),jt= exports.s =new r("unorm8"),Kt= exports.t =new r("unorm8x2"),Ht= exports.u =new r("unorm8x4"),Jt= exports.v =new r("snorm8"),qt= exports.w =new r("snorm8x2"),Qt= exports.x =new r("snorm8x4"),Xt= exports.y =new r("uint16"),Yt= exports.z =new r("uint16x2"),Zt= exports.A =new r("uint16x4"),te= exports.B =new r("sint16"),ee= exports.C =new r("sint16x2"),re= exports.D =new r("sint16x4"),ne= exports.E =new r("unorm16"),oe= exports.F =new r("unorm16x2"),ie= exports.G =new r("unorm16x4"),ae= exports.H =new r("snorm16"),se= exports.I =new r("snorm16x2"),pe= exports.J =new r("snorm16x4"),ue= exports.K =new r("float16"),xe= exports.L =new r("float16x2"),le= exports.M =new r("float16x4"),me= exports.N =new r("float32"),ce= exports.O =new r("float32x2"),ye= exports.P =new r("float32x3"),fe= exports.Q =new r("float32x4"),de= exports.R =new r("uint32"),Te= exports.S =new r("uint32x2"),ge= exports.T =new r("uint32x3"),be= exports.U =new r("uint32x4"),De= exports.V =new r("sint32"),Ae= exports.W =new r("sint32x2"),Ie= exports.X =new r("sint32x3"),ve= exports.Y =new r("sint32x4"),we= exports.Z =new r("unorm10-10-10-2"),Be= exports._ =new r("unorm8x4-bgra");var it={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 at(t){var i,m,v;let e=t==null?void 0:t.type,n=it[e];if(n!==void 0)return n;if(_chunkQRLTUOBJcjs.X.call(void 0, t))return Object.values(t.propTypes).map(x).reduce((f,H)=>f>H?f:H);if(_chunkQRLTUOBJcjs.W.call(void 0, t))return x(t.elementType);if(D(t)){let f=Object.values(t.propTypes)[0];return f&&(i=A(f))!=null?i:1}if(b(t))return(m=A(t.elementType))!=null?m:1;if(_chunkQRLTUOBJcjs.da.call(void 0, t)||c(t))return(v=A(t))!=null?v:x(t.inner);if(Q.includes(e))return 1;throw new Error(`Cannot determine alignment of data: ${JSON.stringify(t)}`)}function st(t){var e,n;if(D(t)){let i=Object.values(t.propTypes)[0];return i?I(i):1}return b(t)?I(t.elementType):c(t)?(e=A(t))!=null?e:I(t.inner):(n=A(t))!=null?n:1}var X=new WeakMap,Y=new WeakMap;function x(t){let e=X.get(t);return e===void 0&&(e=at(t),X.set(t,e)),e}function I(t){let e=Y.get(t);return e===void 0&&(e=st(t),Y.set(t,e)),e}function pt(t){return x(t)}var ut={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 xt(t){let e=0;for(let n of Object.values(t.propTypes)){if(Number.isNaN(e))throw new Error("Only the last property of a struct can be unbounded");if(e=g(e,x(n)),e+=l(n),Number.isNaN(e)&&n.type!=="array")throw new Error("Cannot nest unbounded struct within another struct")}return g(e,x(t))}function lt(t){let e=0;for(let n of Object.values(t.propTypes)){let i=I(n);e=g(e,i),e+=l(n)}return e}function mt(t){var n;let e=ut[t==null?void 0:t.type];if(e!==void 0)return e;if(_chunkQRLTUOBJcjs.X.call(void 0, t))return xt(t);if(D(t))return lt(t);if(_chunkQRLTUOBJcjs.W.call(void 0, t)){if(t.elementCount===0)return Number.NaN;let i=x(t.elementType);return g(l(t.elementType),i)*t.elementCount}if(b(t)){let i=I(t.elementType);return g(l(t.elementType),i)*t.elementCount}if(_chunkQRLTUOBJcjs.da.call(void 0, t)||c(t))return(n=q(t))!=null?n:l(t.inner);throw new Error(`Cannot determine size of data: ${t}`)}var Z=new WeakMap;function l(t){let e=Z.get(t);return e===void 0&&(e=mt(t),Z.set(t,e)),e}function ct(t){return l(t)}function G(t,e){return new N(t,e)}var N=class{constructor(e,n){this.elementType=e;this.elementCount=n;_chunkQRLTUOBJcjs.c.call(void 0, this,"type","array");_chunkQRLTUOBJcjs.c.call(void 0, this,"~repr");_chunkQRLTUOBJcjs.c.call(void 0, this,"~gpuRepr");_chunkQRLTUOBJcjs.c.call(void 0, this,"~reprPartial");_chunkQRLTUOBJcjs.c.call(void 0, this,"~memIdent");if(Number.isNaN(l(e)))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 yt(t){return{type:"ptr",inner:t,addressSpace:"function",access:"read-write"}}function ft(t){return{type:"ptr",inner:t,addressSpace:"private",access:"read-write"}}function dt(t){return{type:"ptr",inner:t,addressSpace:"workgroup",access:"read-write"}}function Tt(t,e="read"){return{type:"ptr",inner:t,addressSpace:"storage",access:e}}function gt(t){return{type:"ptr",inner:t,addressSpace:"uniform",access:"read"}}function bt(t){return{type:"ptr",inner:t,addressSpace:"handle",access:"read"}}function Dt(t,e){return new $(t,e)}var $=class{constructor(e,n){this.elementType=e;this.elementCount=n;_chunkQRLTUOBJcjs.c.call(void 0, this,"type","disarray");_chunkQRLTUOBJcjs.c.call(void 0, this,"~repr");_chunkQRLTUOBJcjs.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 At(t){return new j(t)}var j=class{constructor(e){this.propTypes=e;_chunkQRLTUOBJcjs.c.call(void 0, this,"_label");_chunkQRLTUOBJcjs.c.call(void 0, this,"type","unstruct");_chunkQRLTUOBJcjs.c.call(void 0, this,"~repr");_chunkQRLTUOBJcjs.c.call(void 0, this,"~reprPartial")}get label(){return this._label}$name(e){return this._label=e,this}};function It(t){return new K(t)}var K=class{constructor(e){this.inner=e;_chunkQRLTUOBJcjs.c.call(void 0, this,"type","atomic");_chunkQRLTUOBJcjs.c.call(void 0, this,"~repr");_chunkQRLTUOBJcjs.c.call(void 0, this,"~memIdent");_chunkQRLTUOBJcjs.c.call(void 0, this,"~gpuRepr")}};function a(t,e){return _chunkQRLTUOBJcjs.da.call(void 0, t)?new C(t.inner,[e,...t.attribs]):c(t)?new z(t.inner,[e,...t.attribs]):W(t)?new z(t,[e]):new C(t,[e])}function vt(t,e){return a(e,{type:"@align",value:t})}function wt(t,e){return a(e,{type:"@size",value:t})}function Bt(t,e){return a(e,{type:"@location",value:t})}function Ft(t,e){return a(e,{type:"@interpolate",value:t})}function Vt(t){return(_chunkQRLTUOBJcjs.da.call(void 0, t)||c(t))&&t.attribs.find(_chunkQRLTUOBJcjs.ca)!==void 0}function Xe(t){return!_chunkQRLTUOBJcjs.da.call(void 0, t)&&!c(t)?"":t.attribs.map(e=>`${e.type}(${e.value}) `).join("")}var U=class{constructor(e,n){this.inner=e;this.attribs=n;_chunkQRLTUOBJcjs.c.call(void 0, this,"~repr");var v,f;let i=(v=n.find(_chunkQRLTUOBJcjs._))==null?void 0:v.value,m=(f=n.find(_chunkQRLTUOBJcjs.$))==null?void 0:f.value;if(i!==void 0){if(i<=0)throw new Error(`Custom data alignment must be a positive number, got: ${i}.`);if(Math.log2(i)%1!==0)throw new Error(`Alignment has to be a power of 2, got: ${i}.`);if(_chunkQRLTUOBJcjs.V.call(void 0, this.inner)&&i%x(this.inner)!==0)throw new Error(`Custom alignment has to be a multiple of the standard data alignment. Got: ${i}, expected multiple of: ${x(this.inner)}.`)}if(m!==void 0){if(m<l(this.inner))throw new Error(`Custom data size cannot be smaller then the standard data size. Got: ${m}, expected at least: ${l(this.inner)}.`);if(m<=0)throw new Error(`Custom data size must be a positive number. Got: ${m}.`)}}},C=class extends U{constructor(){super(...arguments);_chunkQRLTUOBJcjs.c.call(void 0, this,"type","decorated");_chunkQRLTUOBJcjs.c.call(void 0, this,"~gpuRepr");_chunkQRLTUOBJcjs.c.call(void 0, this,"~reprPartial");_chunkQRLTUOBJcjs.c.call(void 0, this,"~memIdent")}},z=class extends U{constructor(){super(...arguments);_chunkQRLTUOBJcjs.c.call(void 0, this,"type","loose-decorated")}};var Pt={vertexIndex:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"vertex_index"}),instanceIndex:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"instance_index"}),position:a(_chunkQRLTUOBJcjs.A,{type:"@builtin",value:"position"}),clipDistances:a(G(_chunkQRLTUOBJcjs.L,8),{type:"@builtin",value:"clip_distances"}),frontFacing:a(_chunkQRLTUOBJcjs.N,{type:"@builtin",value:"front_facing"}),fragDepth:a(_chunkQRLTUOBJcjs.N,{type:"@builtin",value:"frag_depth"}),sampleIndex:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"sample_index"}),sampleMask:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"sample_mask"}),localInvocationId:a(_chunkQRLTUOBJcjs.z,{type:"@builtin",value:"local_invocation_id"}),localInvocationIndex:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"local_invocation_index"}),globalInvocationId:a(_chunkQRLTUOBJcjs.z,{type:"@builtin",value:"global_invocation_id"}),workgroupId:a(_chunkQRLTUOBJcjs.z,{type:"@builtin",value:"workgroup_id"}),numWorkgroups:a(_chunkQRLTUOBJcjs.z,{type:"@builtin",value:"num_workgroups"}),subgroupInvocationId:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"subgroup_invocation_id"}),subgroupSize:a(_chunkQRLTUOBJcjs.L,{type:"@builtin",value:"subgroup_size"})};exports.a = J; exports.b = _t; exports.c = W; exports.d = b; exports.e = D; exports.f = c; exports.g = Ut; exports.h = nt; exports.i = tt; exports.j = g; exports.k = ot; exports.l = Q; exports.m = Ot; exports.n = Rt; exports.o = Mt; exports.p = Nt; exports.q = Gt; exports.r = $t; exports.s = jt; exports.t = Kt; exports.u = Ht; exports.v = Jt; exports.w = qt; exports.x = Qt; exports.y = Xt; exports.z = Yt; exports.A = Zt; exports.B = te; exports.C = ee; exports.D = re; exports.E = ne; exports.F = oe; exports.G = ie; exports.H = ae; exports.I = se; exports.J = pe; exports.K = ue; exports.L = xe; exports.M = le; exports.N = me; exports.O = ce; exports.P = ye; exports.Q = fe; exports.R = de; exports.S = Te; exports.T = ge; exports.U = be; exports.V = De; exports.W = Ae; exports.X = Ie; exports.Y = ve; exports.Z = we; exports._ = Be; exports.$ = x; exports.aa = I; exports.ba = pt; exports.ca = l; exports.da = ct; exports.ea = G; exports.fa = yt; exports.ga = ft; exports.ha = dt; exports.ia = Tt; exports.ja = gt; exports.ka = bt; exports.la = Dt; exports.ma = At; exports.na = It; exports.oa = a; exports.pa = vt; exports.qa = wt; exports.ra = Bt; exports.sa = Ft; exports.ta = Vt; exports.ua = Xe; exports.va = Pt;
|
2
|
-
//# sourceMappingURL=chunk-3QXCKMEJ.cjs.map
|
package/chunk-3QXCKMEJ.cjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["/Users/marcinhawryluk/Documents/wigsill/packages/typegpu/dist/chunk-3QXCKMEJ.cjs","../src/data/struct.ts"],"names":["struct","props","WgslStructImpl","label","_a"],"mappings":"AAAA,iIAAuL,SCoDvKA,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,CA/ErB,IAAAC,CAAAA,CAgFI,MAAO,CAAA,OAAA,EAAA,CAAUA,CAAAA,CAAA,IAAA,CAAK,KAAA,CAAA,EAAL,IAAA,CAAAA,CAAAA,CAAc,WAAW,CAAA,CAAA","file":"/Users/marcinhawryluk/Documents/wigsill/packages/typegpu/dist/chunk-3QXCKMEJ.cjs","sourcesContent":[null,"import type { TgpuNamable } from '../namable';\nimport type {\n InferGPURecord,\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 '~gpuRepr': InferGPURecord<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"]}
|
package/chunk-DR55IHDD.js
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
var Y=Object.defineProperty,Z=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var S=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t)=>{for(var n in t||(t={}))te.call(t,n)&&S(e,n,t[n]);if(N)for(var n of N(t))ne.call(t,n)&&S(e,n,t[n]);return e},Pe=(e,t)=>Z(e,ee(t));var h=(e,t,n)=>S(e,typeof t!="symbol"?t+"":t,n);var P="Invariant failed";function $(e,t){if(e)return;throw new Error(P)}var G=class e extends Error{constructor(n,s){let r=s.map(i=>`- ${i}`);r.length>20&&(r=[...r.slice(0,11),"...",...r.slice(-10)]);super(`Resolution of the following tree failed:
|
2
|
-
${r.join(`
|
3
|
-
`)}: ${n&&typeof n=="object"&&"message"in n?n.message:n}`);this.cause=n;this.trace=s;Object.setPrototypeOf(this,e.prototype)}appendToTrace(n){let s=[n,...this.trace];return new e(this.cause,s)}},K=class e extends Error{constructor(n){super(`Missing value for '${n}'`);this.slot=n;Object.setPrototypeOf(this,e.prototype)}},q=class e extends Error{constructor(t){var n;super(`Buffer '${(n=t.label)!=null?n:"<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,e.prototype)}},H=class e extends Error{constructor(t,n){super(`The function '${t!=null?t:"<unnamed>"}' is missing links to the following external values: ${n}.`),Object.setPrototypeOf(this,e.prototype)}},J=class e extends Error{constructor(t){super(`Missing bind groups for layouts: '${[...t].map(n=>{var s;return(s=n.label)!=null?s:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,e.prototype)}},Q=class e extends Error{constructor(t){super(`Missing vertex buffers for layouts: '${[...t].map(n=>{var s;return(s=n.label)!=null?s:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,e.prototype)}};var C=null,se=Symbol("CPU"),re=Symbol("GPU"),ie={CPU:se,GPU:re},I=[];function Ue(e,t){$(C===null,"Cannot nest context providers"),C=e;try{return t()}finally{C=null}}function Fe(){return C}function We(e){I.push(e)}function Oe(e){let t=I.pop();e!==void 0&&$(t===e,"Unexpected mode")}var X=()=>I.length>0&&I[I.length-1]===ie.GPU;function*Ee(e){let t=0;for(;;)e.has(t)||(yield t),t++}function o(e,t){return(...n)=>X()?t(...n):e(...n)}var k=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])}},w=class extends k{constructor(n,s){var r;super(2);h(this,0);h(this,1);this[0]=n!=null?n:0,this[1]=(r=s!=null?s:n)!=null?r:0}get x(){return this[0]}get y(){return this[1]}set x(n){this[0]=n}set y(n){this[1]=n}},x=class extends k{constructor(n,s,r){var i,y;super(3);h(this,0);h(this,1);h(this,2);this[0]=n!=null?n:0,this[1]=(i=s!=null?s:n)!=null?i:0,this[2]=(y=r!=null?r:n)!=null?y:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(n){this[0]=n}set y(n){this[1]=n}set z(n){this[2]=n}},l=class extends k{constructor(n,s,r,i){var y,a,c;super(4);h(this,0);h(this,1);h(this,2);h(this,3);this[0]=n!=null?n:0,this[1]=(y=s!=null?s:n)!=null?y:0,this[2]=(a=r!=null?r:n)!=null?a:0,this[3]=(c=i!=null?i:n)!=null?c:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(n){this[0]=n}set y(n){this[1]=n}set z(n){this[2]=n}set w(n){this[3]=n}},z=class e extends w{get kind(){return"vec2f"}get _Vec2(){return e}get _Vec3(){return g}get _Vec4(){return f}},d=class e extends w{get kind(){return"vec2h"}get _Vec2(){return e}get _Vec3(){return T}get _Vec4(){return _}},m=class e extends w{get kind(){return"vec2i"}get _Vec2(){return e}get _Vec3(){return p}get _Vec4(){return v}},V=class e extends w{get kind(){return"vec2u"}get _Vec2(){return e}get _Vec3(){return b}get _Vec4(){return A}},g=class e extends x{get kind(){return"vec3f"}get _Vec2(){return z}get _Vec3(){return e}get _Vec4(){return f}},T=class e extends x{get kind(){return"vec3h"}get _Vec2(){return d}get _Vec3(){return e}get _Vec4(){return _}},p=class e extends x{get kind(){return"vec3i"}get _Vec2(){return m}get _Vec3(){return e}get _Vec4(){return v}},b=class e extends x{get kind(){return"vec3u"}get _Vec2(){return V}get _Vec3(){return e}get _Vec4(){return A}},f=class e extends l{get kind(){return"vec4f"}get _Vec2(){return z}get _Vec3(){return g}get _Vec4(){return e}},_=class e extends l{get kind(){return"vec4h"}get _Vec2(){return d}get _Vec3(){return T}get _Vec4(){return e}},v=class e extends l{get kind(){return"vec4i"}get _Vec2(){return m}get _Vec3(){return p}get _Vec4(){return e}},A=class e extends l{get kind(){return"vec4u"}get _Vec2(){return V}get _Vec3(){return b}get _Vec4(){return e}};var D=u(z),he=u(d),ye=u(m),ue=u(V),B=u(g),oe=u(T),ae=u(p),ce=u(b),U=u(f),we=u(_),xe=u(v),le=u(A),ze={vec2f:D,vec2h:he,vec2i:ye,vec2u:ue,vec3f:B,vec3h:oe,vec3i:ae,vec3u:ce,vec4f:U,vec4h:we,vec4i:xe,vec4u:le};function u(e){let{kind:t,length:n}=new e,s=o((...r)=>{let i=new Array(r.length),y=0;for(let a of r)if(typeof a=="number")i[y++]=a;else for(let c=0;c<a.length;++c)i[y++]=a[c];if(i.length<=1||i.length===n)return new e(...i);throw new Error(`'${t}' constructor called with invalid number of arguments.`)},(...r)=>({value:`${t}(${r.map(i=>i.value).join(", ")})`,dataType:ze[t]}));return Object.assign(s,{type:t,"~repr":void 0})}function L(e){let t={"~repr":void 0,type:e.type,label:e.type},n=o((...s)=>{let r=[];for(let i of s)if(typeof i=="number")r.push(i);else for(let y=0;y<i.length;++y)r.push(i[y]);for(let i=r.length;i<e.columns*e.rows;++i)r.push(0);return e.makeFromElements(...r)},(...s)=>({value:`${t.type}(${s.map(r=>r.value).join(", ")})`,dataType:t}));return Object.assign(n,t)}var F=class{constructor(...t){h(this,"columns");h(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,n)=>this[n]).join(", ")})`}},W=class extends F{constructor(){super(...arguments);h(this,"kind","mat2x2f")}makeColumn(n,s){return D(n,s)}},O=class{constructor(...t){h(this,"columns");h(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]})`}},R=class extends O{constructor(){super(...arguments);h(this,"kind","mat3x3f")}makeColumn(n,s,r){return B(n,s,r)}},j=class{constructor(...t){h(this,"columns");h(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,n)=>this[n]).join(", ")})`}},E=class extends j{constructor(){super(...arguments);h(this,"kind","mat4x4f")}makeColumn(n,s,r,i){return U(n,s,r,i)}},Xe=L({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...e)=>new W(...e)}),Ye=L({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...e)=>new R(...e)}),Ze=L({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...e)=>new E(...e)});function et(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,n)=>e[n])}import M from"typed-binary";var it={type:"abstractInt"},ht={type:"abstractFloat"},yt={type:"bool"},de=o(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))),e=>({value:`u32(${e.value})`,dataType:me})),me=Object.assign(de,{type:"u32"}),Ve=o(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))},e=>({value:`i32(${e.value})`,dataType:ge})),ge=Object.assign(Ve,{type:"i32"}),Te=o(e=>{if(typeof e=="boolean")return e?1:0;let t=new Float32Array(1);return t[0]=e,t[0]},e=>({value:`f32(${e.value})`,dataType:pe})),pe=Object.assign(Te,{type:"f32"}),be=o(e=>{if(typeof e=="boolean")return e?1:0;let t=new ArrayBuffer(2);return M.f16.write(new M.BufferWriter(t),e),M.f16.read(new M.BufferReader(t))},e=>({value:`f16(${e.value})`,dataType:fe})),fe=Object.assign(be,{type:"f16"});var _e=["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 ve(e){return e==null?void 0:e.type.startsWith("vec2")}function Ae(e){return e==null?void 0:e.type.startsWith("vec3")}function Ie(e){return e==null?void 0:e.type.startsWith("vec4")}function ot(e){return ve(e)||Ae(e)||Ie(e)}function ke(e){return(e==null?void 0:e.type)==="mat2x2f"}function Ce(e){return(e==null?void 0:e.type)==="mat3x3f"}function Me(e){return(e==null?void 0:e.type)==="mat4x4f"}function at(e){return ke(e)||Ce(e)||Me(e)}function ct(e){return _e.includes(e==null?void 0:e.type)}function wt(e){return(e==null?void 0:e.type)==="array"}function xt(e){return(e==null?void 0:e.type)==="struct"}function lt(e){return(e==null?void 0:e.type)==="ptr"}function zt(e){return(e==null?void 0:e.type)==="atomic"}function dt(e){return(e==null?void 0:e.type)==="@align"}function mt(e){return(e==null?void 0:e.type)==="@size"}function Vt(e){return(e==null?void 0:e.type)==="@location"}function gt(e){return(e==null?void 0:e.type)==="@interpolate"}function Tt(e){return(e==null?void 0:e.type)==="@builtin"}function pt(e){return(e==null?void 0:e.type)==="decorated"}export{Se as a,Pe as b,h as c,$ as d,G as e,K as f,q as g,H as h,J as i,Q as j,ie as k,Ue as l,Fe as m,We as n,Oe as o,X as p,Ee as q,o as r,D as s,he as t,ye as u,ue as v,B as w,oe as x,ae as y,ce as z,U as A,we as B,xe as C,le as D,Xe as E,Ye as F,Ze as G,et as H,it as I,ht as J,yt as K,me as L,ge as M,pe as N,fe as O,ve as P,Ae as Q,ot as R,ke as S,Ce as T,at as U,ct as V,wt as W,xt as X,lt as Y,zt as Z,dt as _,mt as $,Vt as aa,gt as ba,Tt as ca,pt as da};
|
4
|
-
//# sourceMappingURL=chunk-DR55IHDD.js.map
|
package/chunk-KVOFUY5A.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
import{V as n}from"./chunk-DR55IHDD.js";function r(e){return(e==null?void 0:e.resourceType)==="slot"}function o(e){return(e==null?void 0:e.resourceType)==="derived"}function p(e){return(e==null?void 0:e["~providing"])!==void 0}function u(e){return(e==null?void 0:e.resourceType)==="accessor"}var a=Symbol("internal");var f={type:"unknown"},c={type:"void"};function i(e){return typeof(e==null?void 0:e["~resolve"])=="function"}function d(e){return typeof e=="number"||typeof e=="boolean"||typeof e=="string"||i(e)||n(e)||r(e)||o(e)||p(e)}function m(e){return!!e&&typeof e=="object"&&"getMappedRange"in e&&"mapAsync"in e}function x(e){return(e==null?void 0:e.resourceType)==="buffer-usage"}function b(e){var t;return!!e&&typeof e=="object"&&!!((t=e==null?void 0:e[a])!=null&&t.dataType)}export{a,r as b,o as c,p as d,u as e,f,c as g,i as h,d as i,m as j,x as k,b as l};
|
2
|
-
//# sourceMappingURL=chunk-KVOFUY5A.js.map
|
package/chunk-QRLTUOBJ.cjs
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var Y=Object.defineProperty,Z=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var S=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se= exports.a =(e,t)=>{for(var n in t||(t={}))te.call(t,n)&&S(e,n,t[n]);if(N)for(var n of N(t))ne.call(t,n)&&S(e,n,t[n]);return e},Pe= exports.b =(e,t)=>Z(e,ee(t));var h=(e,t,n)=>S(e,typeof t!="symbol"?t+"":t,n);var P="Invariant failed";function $(e,t){if(e)return;throw new Error(P)}var G=class e extends Error{constructor(n,s){let r=s.map(i=>`- ${i}`);r.length>20&&(r=[...r.slice(0,11),"...",...r.slice(-10)]);super(`Resolution of the following tree failed:
|
2
|
-
${r.join(`
|
3
|
-
`)}: ${n&&typeof n=="object"&&"message"in n?n.message:n}`);this.cause=n;this.trace=s;Object.setPrototypeOf(this,e.prototype)}appendToTrace(n){let s=[n,...this.trace];return new e(this.cause,s)}},K= exports.f =class e extends Error{constructor(n){super(`Missing value for '${n}'`);this.slot=n;Object.setPrototypeOf(this,e.prototype)}},q= exports.g =class e extends Error{constructor(t){var n;super(`Buffer '${(n=t.label)!=null?n:"<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,e.prototype)}},H= exports.h =class e extends Error{constructor(t,n){super(`The function '${t!=null?t:"<unnamed>"}' is missing links to the following external values: ${n}.`),Object.setPrototypeOf(this,e.prototype)}},J= exports.i =class e extends Error{constructor(t){super(`Missing bind groups for layouts: '${[...t].map(n=>{var s;return(s=n.label)!=null?s:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,e.prototype)}},Q= exports.j =class e extends Error{constructor(t){super(`Missing vertex buffers for layouts: '${[...t].map(n=>{var s;return(s=n.label)!=null?s:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,e.prototype)}};var C=null,se=Symbol("CPU"),re=Symbol("GPU"),ie= exports.k ={CPU:se,GPU:re},I=[];function Ue(e,t){$(C===null,"Cannot nest context providers"),C=e;try{return t()}finally{C=null}}function Fe(){return C}function We(e){I.push(e)}function Oe(e){let t=I.pop();e!==void 0&&$(t===e,"Unexpected mode")}var X=()=>I.length>0&&I[I.length-1]===ie.GPU;function*Ee(e){let t=0;for(;;)e.has(t)||(yield t),t++}function o(e,t){return(...n)=>X()?t(...n):e(...n)}var k=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])}},w=class extends k{constructor(n,s){var r;super(2);h(this,0);h(this,1);this[0]=n!=null?n:0,this[1]=(r=s!=null?s:n)!=null?r:0}get x(){return this[0]}get y(){return this[1]}set x(n){this[0]=n}set y(n){this[1]=n}},x=class extends k{constructor(n,s,r){var i,y;super(3);h(this,0);h(this,1);h(this,2);this[0]=n!=null?n:0,this[1]=(i=s!=null?s:n)!=null?i:0,this[2]=(y=r!=null?r:n)!=null?y:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(n){this[0]=n}set y(n){this[1]=n}set z(n){this[2]=n}},l=class extends k{constructor(n,s,r,i){var y,a,c;super(4);h(this,0);h(this,1);h(this,2);h(this,3);this[0]=n!=null?n:0,this[1]=(y=s!=null?s:n)!=null?y:0,this[2]=(a=r!=null?r:n)!=null?a:0,this[3]=(c=i!=null?i:n)!=null?c:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(n){this[0]=n}set y(n){this[1]=n}set z(n){this[2]=n}set w(n){this[3]=n}},z=class e extends w{get kind(){return"vec2f"}get _Vec2(){return e}get _Vec3(){return g}get _Vec4(){return f}},d=class e extends w{get kind(){return"vec2h"}get _Vec2(){return e}get _Vec3(){return T}get _Vec4(){return _}},m=class e extends w{get kind(){return"vec2i"}get _Vec2(){return e}get _Vec3(){return p}get _Vec4(){return v}},V=class e extends w{get kind(){return"vec2u"}get _Vec2(){return e}get _Vec3(){return b}get _Vec4(){return A}},g=class e extends x{get kind(){return"vec3f"}get _Vec2(){return z}get _Vec3(){return e}get _Vec4(){return f}},T=class e extends x{get kind(){return"vec3h"}get _Vec2(){return d}get _Vec3(){return e}get _Vec4(){return _}},p=class e extends x{get kind(){return"vec3i"}get _Vec2(){return m}get _Vec3(){return e}get _Vec4(){return v}},b=class e extends x{get kind(){return"vec3u"}get _Vec2(){return V}get _Vec3(){return e}get _Vec4(){return A}},f=class e extends l{get kind(){return"vec4f"}get _Vec2(){return z}get _Vec3(){return g}get _Vec4(){return e}},_=class e extends l{get kind(){return"vec4h"}get _Vec2(){return d}get _Vec3(){return T}get _Vec4(){return e}},v=class e extends l{get kind(){return"vec4i"}get _Vec2(){return m}get _Vec3(){return p}get _Vec4(){return e}},A=class e extends l{get kind(){return"vec4u"}get _Vec2(){return V}get _Vec3(){return b}get _Vec4(){return e}};var D=u(z),he= exports.t =u(d),ye= exports.u =u(m),ue= exports.v =u(V),B= exports.w =u(g),oe= exports.x =u(T),ae= exports.y =u(p),ce= exports.z =u(b),U= exports.A =u(f),we= exports.B =u(_),xe= exports.C =u(v),le= exports.D =u(A),ze={vec2f:D,vec2h:he,vec2i:ye,vec2u:ue,vec3f:B,vec3h:oe,vec3i:ae,vec3u:ce,vec4f:U,vec4h:we,vec4i:xe,vec4u:le};function u(e){let{kind:t,length:n}=new e,s=o((...r)=>{let i=new Array(r.length),y=0;for(let a of r)if(typeof a=="number")i[y++]=a;else for(let c=0;c<a.length;++c)i[y++]=a[c];if(i.length<=1||i.length===n)return new e(...i);throw new Error(`'${t}' constructor called with invalid number of arguments.`)},(...r)=>({value:`${t}(${r.map(i=>i.value).join(", ")})`,dataType:ze[t]}));return Object.assign(s,{type:t,"~repr":void 0})}function L(e){let t={"~repr":void 0,type:e.type,label:e.type},n=o((...s)=>{let r=[];for(let i of s)if(typeof i=="number")r.push(i);else for(let y=0;y<i.length;++y)r.push(i[y]);for(let i=r.length;i<e.columns*e.rows;++i)r.push(0);return e.makeFromElements(...r)},(...s)=>({value:`${t.type}(${s.map(r=>r.value).join(", ")})`,dataType:t}));return Object.assign(n,t)}var F=class{constructor(...t){h(this,"columns");h(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,n)=>this[n]).join(", ")})`}},W=class extends F{constructor(){super(...arguments);h(this,"kind","mat2x2f")}makeColumn(n,s){return D(n,s)}},O=class{constructor(...t){h(this,"columns");h(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]})`}},R=class extends O{constructor(){super(...arguments);h(this,"kind","mat3x3f")}makeColumn(n,s,r){return B(n,s,r)}},j=class{constructor(...t){h(this,"columns");h(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,n)=>this[n]).join(", ")})`}},E=class extends j{constructor(){super(...arguments);h(this,"kind","mat4x4f")}makeColumn(n,s,r,i){return U(n,s,r,i)}},Xe= exports.E =L({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...e)=>new W(...e)}),Ye= exports.F =L({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...e)=>new R(...e)}),Ze= exports.G =L({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...e)=>new E(...e)});function et(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,n)=>e[n])}var _typedbinary = require('typed-binary'); var _typedbinary2 = _interopRequireDefault(_typedbinary);var it={type:"abstractInt"},ht= exports.J ={type:"abstractFloat"},yt= exports.K ={type:"bool"},de=o(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))),e=>({value:`u32(${e.value})`,dataType:me})),me= exports.L =Object.assign(de,{type:"u32"}),Ve=o(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))},e=>({value:`i32(${e.value})`,dataType:ge})),ge= exports.M =Object.assign(Ve,{type:"i32"}),Te=o(e=>{if(typeof e=="boolean")return e?1:0;let t=new Float32Array(1);return t[0]=e,t[0]},e=>({value:`f32(${e.value})`,dataType:pe})),pe= exports.N =Object.assign(Te,{type:"f32"}),be=o(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))},e=>({value:`f16(${e.value})`,dataType:fe})),fe= exports.O =Object.assign(be,{type:"f16"});var _e=["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 ve(e){return e==null?void 0:e.type.startsWith("vec2")}function Ae(e){return e==null?void 0:e.type.startsWith("vec3")}function Ie(e){return e==null?void 0:e.type.startsWith("vec4")}function ot(e){return ve(e)||Ae(e)||Ie(e)}function ke(e){return(e==null?void 0:e.type)==="mat2x2f"}function Ce(e){return(e==null?void 0:e.type)==="mat3x3f"}function Me(e){return(e==null?void 0:e.type)==="mat4x4f"}function at(e){return ke(e)||Ce(e)||Me(e)}function ct(e){return _e.includes(e==null?void 0:e.type)}function wt(e){return(e==null?void 0:e.type)==="array"}function xt(e){return(e==null?void 0:e.type)==="struct"}function lt(e){return(e==null?void 0:e.type)==="ptr"}function zt(e){return(e==null?void 0:e.type)==="atomic"}function dt(e){return(e==null?void 0:e.type)==="@align"}function mt(e){return(e==null?void 0:e.type)==="@size"}function Vt(e){return(e==null?void 0:e.type)==="@location"}function gt(e){return(e==null?void 0:e.type)==="@interpolate"}function Tt(e){return(e==null?void 0:e.type)==="@builtin"}function pt(e){return(e==null?void 0:e.type)==="decorated"}exports.a = Se; exports.b = Pe; exports.c = h; exports.d = $; exports.e = G; exports.f = K; exports.g = q; exports.h = H; exports.i = J; exports.j = Q; exports.k = ie; exports.l = Ue; exports.m = Fe; exports.n = We; exports.o = Oe; exports.p = X; exports.q = Ee; exports.r = o; exports.s = D; exports.t = he; exports.u = ye; exports.v = ue; exports.w = B; exports.x = oe; exports.y = ae; exports.z = ce; exports.A = U; exports.B = we; exports.C = xe; exports.D = le; exports.E = Xe; exports.F = Ye; exports.G = Ze; exports.H = et; exports.I = it; exports.J = ht; exports.K = yt; exports.L = me; exports.M = ge; exports.N = pe; exports.O = fe; exports.P = ve; exports.Q = Ae; exports.R = ot; exports.S = ke; exports.T = Ce; exports.U = at; exports.V = ct; exports.W = wt; exports.X = xt; exports.Y = lt; exports.Z = zt; exports._ = dt; exports.$ = mt; exports.aa = Vt; exports.ba = gt; exports.ca = Tt; exports.da = pt;
|
4
|
-
//# sourceMappingURL=chunk-QRLTUOBJ.cjs.map
|
package/chunk-QRLTUOBJ.cjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["/Users/marcinhawryluk/Documents/wigsill/packages/typegpu/dist/chunk-QRLTUOBJ.cjs","../src/errors.ts"],"names":["prefix","invariant","condition","message","ResolutionError","_ResolutionError","cause","trace","entries","ancestor"],"mappings":"AAAA,6KAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,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,EAAE,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,EAAE,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,EAAE,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,CCOpe,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;AAQU;AA2CpB","file":"/Users/marcinhawryluk/Documents/wigsill/packages/typegpu/dist/chunk-QRLTUOBJ.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(\n `Resolution of the following tree failed: \\n${entries.join('\\n')}: ${cause && typeof cause === 'object' && 'message' in cause ? cause.message : cause}`,\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"]}
|
package/chunk-VOFHV4Z6.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
import{$ as k,A as p,C as F,D as V,L as s,M as P,N as u,V as S,W as h,X as _,_ as L,aa as R,c as o,ca as M,da as y,s as d,u as w,v as B,w as E,y as O,z as T}from"./chunk-DR55IHDD.js";function tt(t){let e=n=>n;return Object.setPrototypeOf(e,et),e.propTypes=t,e}var et={type:"struct",_label:void 0,get label(){return this._label},$name(t){return this._label=t,this},toString(){var t;return`struct:${(t=this.label)!=null?t:"<unnamed>"}`}};var g=(t,e)=>{let n=e-1,i=~n;return(t&n)===0?t:(t&i)+e};var J=["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"],_t={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 rt=["unstruct","disarray","loose-decorated",...J];function W(t){return rt.includes(t==null?void 0:t.type)}function b(t){return(t==null?void 0:t.type)==="disarray"}function D(t){return(t==null?void 0:t.type)==="unstruct"}function c(t){return(t==null?void 0:t.type)==="loose-decorated"}function A(t){var e,n;return(n=(e=t.attribs)==null?void 0:e.find(L))==null?void 0:n.value}function q(t){var e,n;return(n=(e=t.attribs)==null?void 0:e.find(k))==null?void 0:n.value}function Ut(t){var e,n;return(n=(e=t.attribs)==null?void 0:e.find(R))==null?void 0:n.value}function nt(t){return S(t)||W(t)}var r=class{constructor(e){this.type=e;o(this,"~repr")}},ot={uint8:s,uint8x2:B,uint8x4:V,sint8:P,sint8x2:w,sint8x4:F,unorm8:u,unorm8x2:d,unorm8x4:p,snorm8:u,snorm8x2:d,snorm8x4:p,uint16:s,uint16x2:B,uint16x4:V,sint16:P,sint16x2:w,sint16x4:F,unorm16:u,unorm16x2:d,unorm16x4:p,snorm16:u,snorm16x2:d,snorm16x4:p,float16:u,float16x2:d,float16x4:p,float32:u,float32x2:d,float32x3:E,float32x4:p,uint32:s,uint32x2:B,uint32x3:T,uint32x4:V,sint32:P,sint32x2:w,sint32x3:O,sint32x4:F,"unorm10-10-10-2":p,"unorm8x4-bgra":p},Q=Object.keys(ot),Ot=new r("uint8"),Rt=new r("uint8x2"),Mt=new r("uint8x4"),Nt=new r("sint8"),Gt=new r("sint8x2"),$t=new r("sint8x4"),jt=new r("unorm8"),Kt=new r("unorm8x2"),Ht=new r("unorm8x4"),Jt=new r("snorm8"),qt=new r("snorm8x2"),Qt=new r("snorm8x4"),Xt=new r("uint16"),Yt=new r("uint16x2"),Zt=new r("uint16x4"),te=new r("sint16"),ee=new r("sint16x2"),re=new r("sint16x4"),ne=new r("unorm16"),oe=new r("unorm16x2"),ie=new r("unorm16x4"),ae=new r("snorm16"),se=new r("snorm16x2"),pe=new r("snorm16x4"),ue=new r("float16"),xe=new r("float16x2"),le=new r("float16x4"),me=new r("float32"),ce=new r("float32x2"),ye=new r("float32x3"),fe=new r("float32x4"),de=new r("uint32"),Te=new r("uint32x2"),ge=new r("uint32x3"),be=new r("uint32x4"),De=new r("sint32"),Ae=new r("sint32x2"),Ie=new r("sint32x3"),ve=new r("sint32x4"),we=new r("unorm10-10-10-2"),Be=new r("unorm8x4-bgra");var it={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 at(t){var i,m,v;let e=t==null?void 0:t.type,n=it[e];if(n!==void 0)return n;if(_(t))return Object.values(t.propTypes).map(x).reduce((f,H)=>f>H?f:H);if(h(t))return x(t.elementType);if(D(t)){let f=Object.values(t.propTypes)[0];return f&&(i=A(f))!=null?i:1}if(b(t))return(m=A(t.elementType))!=null?m:1;if(y(t)||c(t))return(v=A(t))!=null?v:x(t.inner);if(Q.includes(e))return 1;throw new Error(`Cannot determine alignment of data: ${JSON.stringify(t)}`)}function st(t){var e,n;if(D(t)){let i=Object.values(t.propTypes)[0];return i?I(i):1}return b(t)?I(t.elementType):c(t)?(e=A(t))!=null?e:I(t.inner):(n=A(t))!=null?n:1}var X=new WeakMap,Y=new WeakMap;function x(t){let e=X.get(t);return e===void 0&&(e=at(t),X.set(t,e)),e}function I(t){let e=Y.get(t);return e===void 0&&(e=st(t),Y.set(t,e)),e}function pt(t){return x(t)}var ut={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 xt(t){let e=0;for(let n of Object.values(t.propTypes)){if(Number.isNaN(e))throw new Error("Only the last property of a struct can be unbounded");if(e=g(e,x(n)),e+=l(n),Number.isNaN(e)&&n.type!=="array")throw new Error("Cannot nest unbounded struct within another struct")}return g(e,x(t))}function lt(t){let e=0;for(let n of Object.values(t.propTypes)){let i=I(n);e=g(e,i),e+=l(n)}return e}function mt(t){var n;let e=ut[t==null?void 0:t.type];if(e!==void 0)return e;if(_(t))return xt(t);if(D(t))return lt(t);if(h(t)){if(t.elementCount===0)return Number.NaN;let i=x(t.elementType);return g(l(t.elementType),i)*t.elementCount}if(b(t)){let i=I(t.elementType);return g(l(t.elementType),i)*t.elementCount}if(y(t)||c(t))return(n=q(t))!=null?n:l(t.inner);throw new Error(`Cannot determine size of data: ${t}`)}var Z=new WeakMap;function l(t){let e=Z.get(t);return e===void 0&&(e=mt(t),Z.set(t,e)),e}function ct(t){return l(t)}function G(t,e){return new N(t,e)}var N=class{constructor(e,n){this.elementType=e;this.elementCount=n;o(this,"type","array");o(this,"~repr");o(this,"~gpuRepr");o(this,"~reprPartial");o(this,"~memIdent");if(Number.isNaN(l(e)))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 yt(t){return{type:"ptr",inner:t,addressSpace:"function",access:"read-write"}}function ft(t){return{type:"ptr",inner:t,addressSpace:"private",access:"read-write"}}function dt(t){return{type:"ptr",inner:t,addressSpace:"workgroup",access:"read-write"}}function Tt(t,e="read"){return{type:"ptr",inner:t,addressSpace:"storage",access:e}}function gt(t){return{type:"ptr",inner:t,addressSpace:"uniform",access:"read"}}function bt(t){return{type:"ptr",inner:t,addressSpace:"handle",access:"read"}}function Dt(t,e){return new $(t,e)}var $=class{constructor(e,n){this.elementType=e;this.elementCount=n;o(this,"type","disarray");o(this,"~repr");o(this,"~reprPartial");if(!Number.isInteger(n)||n<0)throw new Error(`Cannot create disarray schema with invalid element count: ${n}.`)}};function At(t){return new j(t)}var j=class{constructor(e){this.propTypes=e;o(this,"_label");o(this,"type","unstruct");o(this,"~repr");o(this,"~reprPartial")}get label(){return this._label}$name(e){return this._label=e,this}};function It(t){return new K(t)}var K=class{constructor(e){this.inner=e;o(this,"type","atomic");o(this,"~repr");o(this,"~memIdent");o(this,"~gpuRepr")}};function a(t,e){return y(t)?new C(t.inner,[e,...t.attribs]):c(t)?new z(t.inner,[e,...t.attribs]):W(t)?new z(t,[e]):new C(t,[e])}function vt(t,e){return a(e,{type:"@align",value:t})}function wt(t,e){return a(e,{type:"@size",value:t})}function Bt(t,e){return a(e,{type:"@location",value:t})}function Ft(t,e){return a(e,{type:"@interpolate",value:t})}function Vt(t){return(y(t)||c(t))&&t.attribs.find(M)!==void 0}function Xe(t){return!y(t)&&!c(t)?"":t.attribs.map(e=>`${e.type}(${e.value}) `).join("")}var U=class{constructor(e,n){this.inner=e;this.attribs=n;o(this,"~repr");var v,f;let i=(v=n.find(L))==null?void 0:v.value,m=(f=n.find(k))==null?void 0:f.value;if(i!==void 0){if(i<=0)throw new Error(`Custom data alignment must be a positive number, got: ${i}.`);if(Math.log2(i)%1!==0)throw new Error(`Alignment has to be a power of 2, got: ${i}.`);if(S(this.inner)&&i%x(this.inner)!==0)throw new Error(`Custom alignment has to be a multiple of the standard data alignment. Got: ${i}, expected multiple of: ${x(this.inner)}.`)}if(m!==void 0){if(m<l(this.inner))throw new Error(`Custom data size cannot be smaller then the standard data size. Got: ${m}, expected at least: ${l(this.inner)}.`);if(m<=0)throw new Error(`Custom data size must be a positive number. Got: ${m}.`)}}},C=class extends U{constructor(){super(...arguments);o(this,"type","decorated");o(this,"~gpuRepr");o(this,"~reprPartial");o(this,"~memIdent")}},z=class extends U{constructor(){super(...arguments);o(this,"type","loose-decorated")}};var Pt={vertexIndex:a(s,{type:"@builtin",value:"vertex_index"}),instanceIndex:a(s,{type:"@builtin",value:"instance_index"}),position:a(p,{type:"@builtin",value:"position"}),clipDistances:a(G(s,8),{type:"@builtin",value:"clip_distances"}),frontFacing:a(u,{type:"@builtin",value:"front_facing"}),fragDepth:a(u,{type:"@builtin",value:"frag_depth"}),sampleIndex:a(s,{type:"@builtin",value:"sample_index"}),sampleMask:a(s,{type:"@builtin",value:"sample_mask"}),localInvocationId:a(T,{type:"@builtin",value:"local_invocation_id"}),localInvocationIndex:a(s,{type:"@builtin",value:"local_invocation_index"}),globalInvocationId:a(T,{type:"@builtin",value:"global_invocation_id"}),workgroupId:a(T,{type:"@builtin",value:"workgroup_id"}),numWorkgroups:a(T,{type:"@builtin",value:"num_workgroups"}),subgroupInvocationId:a(s,{type:"@builtin",value:"subgroup_invocation_id"}),subgroupSize:a(s,{type:"@builtin",value:"subgroup_size"})};export{J as a,_t as b,W as c,b as d,D as e,c as f,Ut as g,nt as h,tt as i,g as j,ot as k,Q as l,Ot as m,Rt as n,Mt as o,Nt as p,Gt as q,$t as r,jt as s,Kt as t,Ht as u,Jt as v,qt as w,Qt as x,Xt as y,Yt as z,Zt as A,te as B,ee as C,re as D,ne as E,oe as F,ie as G,ae as H,se as I,pe as J,ue as K,xe as L,le as M,me as N,ce as O,ye as P,fe as Q,de as R,Te as S,ge as T,be as U,De as V,Ae as W,Ie as X,ve as Y,we as Z,Be as _,x as $,I as aa,pt as ba,l as ca,ct as da,G as ea,yt as fa,ft as ga,dt as ha,Tt as ia,gt as ja,bt as ka,Dt as la,At as ma,It as na,a as oa,vt as pa,wt as qa,Bt as ra,Ft as sa,Vt as ta,Xe as ua,Pt as va};
|
2
|
-
//# sourceMappingURL=chunk-VOFHV4Z6.js.map
|