typegpu 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/builtin-ClEnM-Ye.js +818 -0
  3. package/builtin-ClEnM-Ye.js.map +1 -0
  4. package/chunk-BYypO7fO.js +18 -0
  5. package/common/index.d.ts +8 -23
  6. package/common/index.d.ts.map +1 -0
  7. package/common/index.js +7 -5
  8. package/common/index.js.map +1 -1
  9. package/data/index.d.ts +7 -400
  10. package/data/index.d.ts.map +1 -0
  11. package/data/index.js +164 -1
  12. package/data/index.js.map +1 -1
  13. package/deepEqual-yZXvaV2C.js +413 -0
  14. package/deepEqual-yZXvaV2C.js.map +1 -0
  15. package/extensions-0SFbU9FH.js +2032 -0
  16. package/extensions-0SFbU9FH.js.map +1 -0
  17. package/fullScreenTriangle-MdLGaAMR.js +543 -0
  18. package/fullScreenTriangle-MdLGaAMR.js.map +1 -0
  19. package/index.d.ts +167 -264
  20. package/index.d.ts.map +1 -0
  21. package/index.js +6294 -160
  22. package/index.js.map +1 -1
  23. package/indexNamedExports-Cdy7USiY.d.ts +5696 -0
  24. package/indexNamedExports-Cdy7USiY.d.ts.map +1 -0
  25. package/operators-HTxa_0k9.js +4156 -0
  26. package/operators-HTxa_0k9.js.map +1 -0
  27. package/package.json +3 -2
  28. package/std/index.d.ts +7 -637
  29. package/std/index.d.ts.map +1 -0
  30. package/std/index.js +165 -1
  31. package/std/index.js.map +1 -1
  32. package/texture-Dg5ybJro.js +205 -0
  33. package/texture-Dg5ybJro.js.map +1 -0
  34. package/chunk-6U5HPHCJ.js +0 -2
  35. package/chunk-6U5HPHCJ.js.map +0 -1
  36. package/chunk-CGQB3SER.js +0 -3
  37. package/chunk-CGQB3SER.js.map +0 -1
  38. package/chunk-CRZWTZM2.js +0 -10
  39. package/chunk-CRZWTZM2.js.map +0 -1
  40. package/chunk-ECR2EGZX.js +0 -7
  41. package/chunk-ECR2EGZX.js.map +0 -1
  42. package/chunk-PWBIFP67.js +0 -2
  43. package/chunk-PWBIFP67.js.map +0 -1
  44. package/matrix-DIfOiRyz.d.ts +0 -122
  45. package/tgpuConstant-BTQFNlQH.d.ts +0 -5201
package/data/index.d.ts CHANGED
@@ -1,402 +1,9 @@
1
- import { aQ as Vec2b, aP as Vec2f, aR as Vec2h, aS as Vec2i, aT as Vec2u, aU as Vec3b, aV as Vec3f, aW as Vec3h, aX as Vec3i, aY as Vec3u, aZ as Vec4b, a_ as Vec4f, a$ as Vec4h, b0 as Vec4i, b1 as Vec4u, b2 as Bool, b3 as F16, b4 as F32, b5 as I32, b6 as U16, b7 as U32, j as AnyWgslData, b8 as WgslStruct, b9 as DualFn, o as WgslArray, ba as StorableData, bb as Ptr, A as AnyData, D as Disarray, bc as BaseData, bd as Unstruct, be as Atomic } from '../tgpuConstant-BTQFNlQH.js';
2
- export { br as Align, cx as AnyAttribute, cL as AnyBuiltin, bR as AnyLooseData, bs as AnyVecInstance, bt as AnyWgslStruct, bu as Builtin, cM as BuiltinClipDistances, cN as BuiltinFragDepth, cO as BuiltinFrontFacing, cP as BuiltinGlobalInvocationId, cQ as BuiltinInstanceIndex, cR as BuiltinLocalInvocationId, cS as BuiltinLocalInvocationIndex, cT as BuiltinNumWorkgroups, cU as BuiltinPosition, cV as BuiltinSampleIndex, cW as BuiltinSampleMask, cX as BuiltinVertexIndex, cY as BuiltinWorkgroupId, bv as Decorated, c$ as FormatToWGSLType, cy as HasCustomLocation, I as Infer, cZ as InferGPU, c_ as InferPartial, bw as Interpolate, cB as IsBuiltin, bx as Location, bS as LooseDecorated, bB as Mat2x2f, bC as Mat3x3f, bD as Mat4x4f, dJ as PackedData, bE as Size, d0 as TgpuVertexFormatData, bq as Void, cu as WgslComparisonSampler, c8 as WgslExternalTexture, cv as WgslSampler, c9 as WgslStorageTexture, ca as WgslStorageTexture1d, cb as WgslStorageTexture2d, cc as WgslStorageTexture2dArray, cd as WgslStorageTexture3d, ce as WgslStorageTextureProps, cf as WgslTexture, cg as WgslTexture1d, ch as WgslTexture2d, ci as WgslTexture2dArray, cj as WgslTexture3d, ck as WgslTextureCube, cl as WgslTextureCubeArray, cm as WgslTextureDepth2d, cn as WgslTextureDepth2dArray, co as WgslTextureDepthCube, cp as WgslTextureDepthCubeArray, cq as WgslTextureDepthMultisampled2d, cr as WgslTextureMultisampled2d, cw as align, cK as builtin, cs as comparisonSampler, ds as float16, dt as float16x2, du as float16x4, dv as float32, dw as float32x2, dx as float32x3, dy as float32x4, d1 as formatToWGSLType, cz as interpolate, cA as invariant, bf as isAlignAttrib, bg as isAtomic, cC as isBuiltin, bh as isBuiltinAttrib, cF as isData, bi as isDecorated, cG as isDisarray, bj as isInterpolateAttrib, bk as isLocationAttrib, cH as isLooseData, cI as isLooseDecorated, dK as isPackedData, bl as isPtr, bm as isSizeAttrib, cJ as isUnstruct, bn as isWgslArray, bo as isWgslData, bp as isWgslStruct, cD as location, by as m2x2f, bz as m3x3f, bA as m4x4f, d2 as packedFormats, ct as sampler, di as sint16, dj as sint16x2, dk as sint16x4, dD as sint32, dE as sint32x2, dF as sint32x3, dG as sint32x4, d6 as sint8, d7 as sint8x2, d8 as sint8x4, cE as size, dp as snorm16, dq as snorm16x2, dr as snorm16x4, dc as snorm8, dd as snorm8x2, de as snorm8x4, bT as texture1d, bU as texture2d, bV as texture2dArray, bW as texture3d, bX as textureCube, bY as textureCubeArray, bZ as textureDepth2d, b_ as textureDepth2dArray, b$ as textureDepthCube, c0 as textureDepthCubeArray, c1 as textureDepthMultisampled2d, c2 as textureExternal, c3 as textureMultisampled2d, c4 as textureStorage1d, c5 as textureStorage2d, c6 as textureStorage2dArray, c7 as textureStorage3d, df as uint16, dg as uint16x2, dh as uint16x4, dz as uint32, dA as uint32x2, dB as uint32x3, dC as uint32x4, d3 as uint8, d4 as uint8x2, d5 as uint8x4, dH as unorm10_10_10_2, dl as unorm16, dm as unorm16x2, dn as unorm16x4, d9 as unorm8, da as unorm8x2, db as unorm8x4, dI as unorm8x4_bgra, bF as v2b, bG as v2f, bH as v2i, bI as v2u, bJ as v3b, bK as v3f, bL as v3i, bM as v3u, bN as v4b, bO as v4f, bP as v4i, bQ as v4u } from '../tgpuConstant-BTQFNlQH.js';
3
- export { m as mat2x2f, a as mat3x3f, b as mat4x4f, c as matToArray } from '../matrix-DIfOiRyz.js';
4
- import 'tinyest';
1
+ import { $a as m3x3f, $c as align, $i as textureStorage2dArray, $n as atomic, $s as uint32x2, Aa as Vec3h, Ai as WgslTextureCube, Ar as ptrHandle, As as formatToWGSLType, Ba as WgslStruct, Bi as texture2dArray, Br as i32, Bs as sint8, Ca as Vec2b, Ci as WgslStorageTexture3d, Cl as BuiltinNumWorkgroups, Cr as vec3u, Cs as float16, Da as Vec2u, Di as WgslTexture2d, Dl as BuiltinVertexIndex, Dr as vec4i, Ds as float32x2, Ea as Vec2i, Ei as WgslTexture1d, El as BuiltinSampleMask, Er as vec4h, Es as float32, Fa as Vec4h, Fi as WgslTextureDepthCubeArray, Fl as comparisonSampler, Fr as arrayOf, Fs as sint16x4, Ga as isInterpolateAttrib, Gi as textureDepth2dArray, Gs as snorm16x4, Ha as isAtomic, Hi as textureCube, Hr as u32, Hs as sint8x4, Ia as Vec4i, Ii as WgslTextureDepthMultisampled2d, Il as sampler, Ir as struct, Is as sint32, Ja as isSizeAttrib, Ji as textureDepthMultisampled2d, Jn as deepEqual, Js as snorm8x4, Ka as isLocationAttrib, Ki as textureDepthCube, Ks as snorm8, La as Vec4u, Li as WgslTextureMultisampled2d, Lr as bool, Ls as sint32x2, Ma as Vec3u, Mi as WgslTextureDepth2d, Mr as ptrStorage, Ms as packedFormats, Na as Vec4b, Ni as WgslTextureDepth2dArray, Nl as WgslComparisonSampler, Nr as ptrUniform, Ns as sint16, Oa as Vec3b, Oi as WgslTexture2dArray, Ol as BuiltinWorkgroupId, Or as vec4u, Os as float32x3, Pa as Vec4f, Pi as WgslTextureDepthCube, Pl as WgslSampler, Pr as ptrWorkgroup, Ps as sint16x2, Qa as m2x2f, Qc as IsBuiltin, Qi as textureStorage2d, Qn as PUBLIC_sizeOf, Qs as uint32, Ra as Void, Ri as texture1d, Rr as f16, Rs as sint32x3, Sa as U32, Si as WgslStorageTexture2dArray, Sl as BuiltinLocalInvocationIndex, Sr as vec3i, Ss as TgpuVertexFormatData, Ta as Vec2h, Ti as WgslTexture, Tl as BuiltinSampleIndex, Tr as vec4f, Ts as float16x4, Ua as isBuiltinAttrib, Ui as textureCubeArray, Us as snorm16, Va as isAlignAttrib, Vi as texture3d, Vr as u16, Vs as sint8x2, Wa as isDecorated, Wi as textureDepth2d, Ws as snorm16x2, Xa as isWgslData, Xc as AnyAttribute, Xi as textureMultisampled2d, Xn as PUBLIC_getLongestContiguousPrefix, Xs as uint16x2, Ya as isWgslArray, Yi as textureExternal, Yn as PUBLIC_alignmentOf, Ys as uint16, Za as isWgslStruct, Zc as HasCustomLocation, Zi as textureStorage1d, Zn as PUBLIC_isContiguous, Zs as uint16x4, _a as Mat4x4f, _l as BuiltinFragDepth, _r as vec2i, aa as Atomic, ac as unorm10_10_10_2, ai as LooseDecorated, ao as v2u, ar as mat4x4f, ba as StorableData, bi as WgslStorageTexture1d, bl as BuiltinInstanceIndex, br as vec3f, bs as FormatToWGSLType, ca as Builtin, cc as unorm16x4, ci as isDisarray, co as v3i, da as F32, dc as unorm8x4, di as isUnstruct, do as v4f, ea as textureStorage3d, ec as uint32x3, el as interpolate, eo as m4x4f, fa as I32, fc as unorm8x4_bgra, fi as Infer, fo as v4i, fr as unstruct, ga as Mat3x3f, gl as BuiltinClipDistances, gr as vec2h, ha as Mat2x2f, hl as AnyBuiltin, ho as _ref, hr as vec2f, ia as AnyWgslStruct, ic as uint8x4, ii as Disarray, il as size, io as v2i, ir as mat3x3f, ja as Vec3i, jc as memoryLayoutOf, ji as WgslTextureCubeArray, jr as ptrPrivate, js as isPackedData, ka as Vec3f, ki as WgslTexture3d, kl as builtin, kr as ptrFn, ks as float32x4, la as Decorated, lc as unorm8, li as isLooseData, lo as v3u, ma as Location, mi as InferPartial, mo as vecBase, mr as vec2b, na as AnyVecInstance, nc as uint8, ni as AnyData, nl as isBuiltin, no as v2b, oa as BaseData, oc as unorm16, oi as Unstruct, oo as v3b, or as matToArray, pa as Interpolate, pi as InferGPU, po as v4u, pr as disarrayOf, qa as isPtr, qi as textureDepthCubeArray, qs as snorm8x2, ra as AnyWgslData, rc as uint8x2, ri as AnyLooseData, rl as location, ro as v2f, rr as mat2x2f, sa as Bool, sc as unorm16x2, si as isData, so as v3f, ta as Align, tc as uint32x4, tl as invariant, to as matBase, ua as F16, uc as unorm8x2, ui as isLooseDecorated, uo as v4b, va as Ptr, vi as WgslExternalTexture, vl as BuiltinFrontFacing, vr as vec2u, wa as Vec2f, wi as WgslStorageTextureProps, wl as BuiltinPosition, wr as vec4b, ws as float16x2, xa as U16, xi as WgslStorageTexture2d, xl as BuiltinLocalInvocationId, xr as vec3h, xs as PackedData, ya as Size, yi as WgslStorageTexture, yl as BuiltinGlobalInvocationId, yr as vec3b, ys as FormatToAcceptedData, za as WgslArray, zi as texture2d, zr as f32, zs as sint32x4 } from "../indexNamedExports-Cdy7USiY.js";
5
2
 
6
- /**
7
- * Schema representing vec2f - a vector with 2 elements of type f32.
8
- * Also a constructor function for this vector value.
9
- *
10
- * @example
11
- * const vector = d.vec2f(); // (0.0, 0.0)
12
- * const vector = d.vec2f(1); // (1.0, 1.0)
13
- * const vector = d.vec2f(0.5, 0.1); // (0.5, 0.1)
14
- *
15
- * @example
16
- * const buffer = root.createBuffer(d.vec2f, d.vec2f(0, 1)); // buffer holding a d.vec2f value, with an initial value of vec2f(0, 1);
17
- */
18
- declare const vec2f: Vec2f;
19
- /**
20
- * Schema representing vec2h - a vector with 2 elements of type f16.
21
- * Also a constructor function for this vector value.
22
- *
23
- * @example
24
- * const vector = d.vec2h(); // (0.0, 0.0)
25
- * const vector = d.vec2h(1); // (1.0, 1.0)
26
- * const vector = d.vec2h(0.5, 0.1); // (0.5, 0.1)
27
- *
28
- * @example
29
- * const buffer = root.createBuffer(d.vec2h, d.vec2h(0, 1)); // buffer holding a d.vec2h value, with an initial value of vec2h(0, 1);
30
- */
31
- declare const vec2h: Vec2h;
32
- /**
33
- * Schema representing vec2i - a vector with 2 elements of type i32.
34
- * Also a constructor function for this vector value.
35
- *
36
- * @example
37
- * const vector = d.vec2i(); // (0, 0)
38
- * const vector = d.vec2i(1); // (1, 1)
39
- * const vector = d.vec2i(-1, 1); // (-1, 1)
40
- *
41
- * @example
42
- * const buffer = root.createBuffer(d.vec2i, d.vec2i(0, 1)); // buffer holding a d.vec2i value, with an initial value of vec2i(0, 1);
43
- */
44
- declare const vec2i: Vec2i;
45
- /**
46
- * Schema representing vec2u - a vector with 2 elements of type u32.
47
- * Also a constructor function for this vector value.
48
- *
49
- * @example
50
- * const vector = d.vec2u(); // (0, 0)
51
- * const vector = d.vec2u(1); // (1, 1)
52
- * const vector = d.vec2u(1, 2); // (1, 2)
53
- *
54
- * @example
55
- * const buffer = root.createBuffer(d.vec2u, d.vec2u(0, 1)); // buffer holding a d.vec2u value, with an initial value of vec2u(0, 1);
56
- */
57
- declare const vec2u: Vec2u;
58
- /**
59
- * Schema representing `vec2<bool>` - a vector with 2 elements of type `bool`.
60
- * Also a constructor function for this vector value.
61
- *
62
- * @example
63
- * const vector = d.vec2b(); // (false, false)
64
- * const vector = d.vec2b(true); // (true, true)
65
- * const vector = d.vec2b(false, true); // (false, true)
66
- */
67
- declare const vec2b: Vec2b;
68
- /**
69
- * Schema representing vec3f - a vector with 3 elements of type f32.
70
- * Also a constructor function for this vector value.
71
- *
72
- * @example
73
- * const vector = d.vec3f(); // (0.0, 0.0, 0.0)
74
- * const vector = d.vec3f(1); // (1.0, 1.0, 1.0)
75
- * const vector = d.vec3f(1, 2, 3.5); // (1.0, 2.0, 3.5)
76
- *
77
- * @example
78
- * const buffer = root.createBuffer(d.vec3f, d.vec3f(0, 1, 2)); // buffer holding a d.vec3f value, with an initial value of vec3f(0, 1, 2);
79
- */
80
- declare const vec3f: Vec3f;
81
- /**
82
- * Schema representing vec3h - a vector with 3 elements of type f16.
83
- * Also a constructor function for this vector value.
84
- *
85
- * @example
86
- * const vector = d.vec3h(); // (0.0, 0.0, 0.0)
87
- * const vector = d.vec3h(1); // (1.0, 1.0, 1.0)
88
- * const vector = d.vec3h(1, 2, 3.5); // (1.0, 2.0, 3.5)
89
- *
90
- * @example
91
- * const buffer = root.createBuffer(d.vec3h, d.vec3h(0, 1, 2)); // buffer holding a d.vec3h value, with an initial value of vec3h(0, 1, 2);
92
- */
93
- declare const vec3h: Vec3h;
94
- /**
95
- * Schema representing vec3i - a vector with 3 elements of type i32.
96
- * Also a constructor function for this vector value.
97
- *
98
- * @example
99
- * const vector = d.vec3i(); // (0, 0, 0)
100
- * const vector = d.vec3i(1); // (1, 1, 1)
101
- * const vector = d.vec3i(1, 2, -3); // (1, 2, -3)
102
- *
103
- * @example
104
- * const buffer = root.createBuffer(d.vec3i, d.vec3i(0, 1, 2)); // buffer holding a d.vec3i value, with an initial value of vec3i(0, 1, 2);
105
- */
106
- declare const vec3i: Vec3i;
107
- /**
108
- * Schema representing vec3u - a vector with 3 elements of type u32.
109
- * Also a constructor function for this vector value.
110
- *
111
- * @example
112
- * const vector = d.vec3u(); // (0, 0, 0)
113
- * const vector = d.vec3u(1); // (1, 1, 1)
114
- * const vector = d.vec3u(1, 2, 3); // (1, 2, 3)
115
- *
116
- * @example
117
- * const buffer = root.createBuffer(d.vec3u, d.vec3u(0, 1, 2)); // buffer holding a d.vec3u value, with an initial value of vec3u(0, 1, 2);
118
- */
119
- declare const vec3u: Vec3u;
120
- /**
121
- * Schema representing `vec3<bool>` - a vector with 3 elements of type `bool`.
122
- * Also a constructor function for this vector value.
123
- *
124
- * @example
125
- * const vector = d.vec3b(); // (false, false, false)
126
- * const vector = d.vec3b(true); // (true, true, true)
127
- * const vector = d.vec3b(false, true, false); // (false, true, false)
128
- */
129
- declare const vec3b: Vec3b;
130
- /**
131
- * Schema representing vec4f - a vector with 4 elements of type f32.
132
- * Also a constructor function for this vector value.
133
- *
134
- * @example
135
- * const vector = d.vec4f(); // (0.0, 0.0, 0.0, 0.0)
136
- * const vector = d.vec4f(1); // (1.0, 1.0, 1.0, 1.0)
137
- * const vector = d.vec4f(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)
138
- *
139
- * @example
140
- * const buffer = root.createBuffer(d.vec4f, d.vec4f(0, 1, 2, 3)); // buffer holding a d.vec4f value, with an initial value of vec4f(0, 1, 2, 3);
141
- */
142
- declare const vec4f: Vec4f;
143
- /**
144
- * Schema representing vec4h - a vector with 4 elements of type f16.
145
- * Also a constructor function for this vector value.
146
- *
147
- * @example
148
- * const vector = d.vec4h(); // (0.0, 0.0, 0.0, 0.0)
149
- * const vector = d.vec4h(1); // (1.0, 1.0, 1.0, 1.0)
150
- * const vector = d.vec4h(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)
151
- *
152
- * @example
153
- * const buffer = root.createBuffer(d.vec4h, d.vec4h(0, 1, 2, 3)); // buffer holding a d.vec4h value, with an initial value of vec4h(0, 1, 2, 3);
154
- */
155
- declare const vec4h: Vec4h;
156
- /**
157
- * Schema representing vec4i - a vector with 4 elements of type i32.
158
- * Also a constructor function for this vector value.
159
- *
160
- * @example
161
- * const vector = d.vec4i(); // (0, 0, 0, 0)
162
- * const vector = d.vec4i(1); // (1, 1, 1, 1)
163
- * const vector = d.vec4i(1, 2, 3, -4); // (1, 2, 3, -4)
164
- *
165
- * @example
166
- * const buffer = root.createBuffer(d.vec4i, d.vec4i(0, 1, 2, 3)); // buffer holding a d.vec4i value, with an initial value of vec4i(0, 1, 2, 3);
167
- */
168
- declare const vec4i: Vec4i;
169
- /**
170
- * Schema representing vec4u - a vector with 4 elements of type u32.
171
- * Also a constructor function for this vector value.
172
- *
173
- * @example
174
- * const vector = d.vec4u(); // (0, 0, 0, 0)
175
- * const vector = d.vec4u(1); // (1, 1, 1, 1)
176
- * const vector = d.vec4u(1, 2, 3, 4); // (1, 2, 3, 4)
177
- *
178
- * @example
179
- * const buffer = root.createBuffer(d.vec4u, d.vec4u(0, 1, 2, 3)); // buffer holding a d.vec4u value, with an initial value of vec4u(0, 1, 2, 3);
180
- */
181
- declare const vec4u: Vec4u;
182
- /**
183
- * Schema representing `vec4<bool>` - a vector with 4 elements of type `bool`.
184
- * Also a constructor function for this vector value.
185
- *
186
- * @example
187
- * const vector = d.vec4b(); // (false, false, false, false)
188
- * const vector = d.vec4b(true); // (true, true, true, true)
189
- * const vector = d.vec4b(false, true, false, true); // (false, true, false, true)
190
- */
191
- declare const vec4b: Vec4b;
192
-
193
- /**
194
- * A schema that represents a boolean value. (equivalent to `bool` in WGSL)
195
- *
196
- * Can also be called to cast a value to a bool in accordance with WGSL casting rules.
197
- *
198
- * @example
199
- * const value = bool(); // false
200
- * @example
201
- * const value = bool(0); // false
202
- * @example
203
- * const value = bool(-0); // false
204
- * @example
205
- * const value = bool(21.37); // true
206
- */
207
- declare const bool: Bool;
208
- /**
209
- * A schema that represents an unsigned 32-bit integer value. (equivalent to `u32` in WGSL)
210
- *
211
- * Can also be called to cast a value to an u32 in accordance with WGSL casting rules.
212
- *
213
- * @example
214
- * const value = u32(); // 0
215
- * @example
216
- * const value = u32(7); // 7
217
- * @example
218
- * const value = u32(3.14); // 3
219
- * @example
220
- * const value = u32(-1); // 4294967295
221
- * @example
222
- * const value = u32(-3.1); // 0
223
- */
224
- declare const u32: U32;
225
- declare const u16: U16;
226
- /**
227
- * A schema that represents a signed 32-bit integer value. (equivalent to `i32` in WGSL)
228
- *
229
- * Can also be called to cast a value to an i32 in accordance with WGSL casting rules.
230
- *
231
- * @example
232
- * const value = i32(); // 0
233
- * @example
234
- * const value = i32(3.14); // 3
235
- * @example
236
- * const value = i32(-3.9); // -3
237
- * @example
238
- * const value = i32(10000000000) // 1410065408
239
- */
240
- declare const i32: I32;
241
- /**
242
- * A schema that represents a 32-bit float value. (equivalent to `f32` in WGSL)
243
- *
244
- * Can also be called to cast a value to an f32.
245
- *
246
- * @example
247
- * const value = f32(); // 0
248
- * @example
249
- * const value = f32(1.23); // 1.23
250
- * @example
251
- * const value = f32(true); // 1
252
- */
253
- declare const f32: F32;
254
- /**
255
- * A schema that represents a 16-bit float value. (equivalent to `f16` in WGSL)
256
- *
257
- * Can also be called to cast a value to an f16.
258
- *
259
- * @example
260
- * const value = f16(); // 0
261
- * @example
262
- * const value = f32(1.23); // 1.23
263
- * @example
264
- * const value = f16(true); // 1
265
- * @example
266
- * const value = f16(21877.5); // 21872
267
- */
268
- declare const f16: F16;
269
-
270
- /**
271
- * Creates a struct schema that can be used to construct GPU buffers.
272
- * Ensures proper alignment and padding of properties (as opposed to a `d.unstruct` schema).
273
- * The order of members matches the passed in properties object.
274
- *
275
- * @example
276
- * const CircleStruct = d.struct({ radius: d.f32, pos: d.vec3f });
277
- *
278
- * @param props Record with `string` keys and `TgpuData` values,
279
- * each entry describing one struct member.
280
- */
281
- declare function struct<TProps extends Record<string, AnyWgslData>>(props: TProps): WgslStruct<TProps>;
282
-
283
- interface WgslArrayConstructor {
284
- <TElement extends AnyWgslData>(elementType: TElement): (elementCount: number) => WgslArray<TElement>;
285
- <TElement extends AnyWgslData>(elementType: TElement, elementCount: number): WgslArray<TElement>;
286
- }
287
- /**
288
- * Creates an array schema that can be used to construct gpu buffers.
289
- * Describes arrays with fixed-size length, storing elements of the same type.
290
- *
291
- * @example
292
- * const LENGTH = 3;
293
- * const array = d.arrayOf(d.u32, LENGTH);
294
- *
295
- * If `elementCount` is not specified, a partially applied function is returned.
296
- * @example
297
- * const array = d.arrayOf(d.vec3f);
298
- * // ^? (n: number) => WgslArray<d.Vec3f>
299
- *
300
- * @param elementType The type of elements in the array.
301
- * @param elementCount The number of elements in the array.
302
- */
303
- declare const arrayOf: DualFn<WgslArrayConstructor>;
304
-
305
- declare function ptrFn<T extends StorableData>(inner: T): Ptr<'function', T, 'read-write'>;
306
- declare function ptrPrivate<T extends StorableData>(inner: T): Ptr<'private', T, 'read-write'>;
307
- declare function ptrWorkgroup<T extends StorableData>(inner: T): Ptr<'workgroup', T, 'read-write'>;
308
- declare function ptrStorage<T extends StorableData, TAccess extends 'read' | 'read-write' = 'read'>(inner: T, access?: TAccess): Ptr<'storage', T, TAccess>;
309
- declare function ptrUniform<T extends StorableData>(inner: T): Ptr<'uniform', T, 'read'>;
310
- declare function ptrHandle<T extends StorableData>(inner: T): Ptr<'handle', T, 'read'>;
311
-
312
- interface DisarrayConstructor {
313
- <TElement extends AnyData>(elementType: TElement): (elementCount: number) => Disarray<TElement>;
314
- <TElement extends AnyData>(elementType: TElement, elementCount: number): Disarray<TElement>;
3
+ //#region src/data/index.d.ts
4
+ declare namespace index_d_exports {
5
+ export { Align, AnyAttribute, AnyBuiltin, AnyData, AnyLooseData, AnyVecInstance, AnyWgslData, AnyWgslStruct, Atomic, BaseData, BaseData as BaseWgslData, Bool, Builtin, BuiltinClipDistances, BuiltinFragDepth, BuiltinFrontFacing, BuiltinGlobalInvocationId, BuiltinInstanceIndex, BuiltinLocalInvocationId, BuiltinLocalInvocationIndex, BuiltinNumWorkgroups, BuiltinPosition, BuiltinSampleIndex, BuiltinSampleMask, BuiltinVertexIndex, BuiltinWorkgroupId, Decorated, Disarray, F16, F32, FormatToAcceptedData, FormatToWGSLType, HasCustomLocation, I32, Infer, InferGPU, InferPartial, Interpolate, IsBuiltin, Location, LooseDecorated, Mat2x2f, Mat3x3f, Mat4x4f, PackedData, Ptr, Size, StorableData, TgpuVertexFormatData, U16, U32, Unstruct, Vec2b, Vec2f, Vec2h, Vec2i, Vec2u, Vec3b, Vec3f, Vec3h, Vec3i, Vec3u, Vec4b, Vec4f, Vec4h, Vec4i, Vec4u, Void, WgslArray, WgslComparisonSampler, WgslExternalTexture, WgslSampler, WgslStorageTexture, WgslStorageTexture1d, WgslStorageTexture2d, WgslStorageTexture2dArray, WgslStorageTexture3d, WgslStorageTextureProps, WgslStruct, WgslTexture, WgslTexture1d, WgslTexture2d, WgslTexture2dArray, WgslTexture3d, WgslTextureCube, WgslTextureCubeArray, WgslTextureDepth2d, WgslTextureDepth2dArray, WgslTextureDepthCube, WgslTextureDepthCubeArray, WgslTextureDepthMultisampled2d, WgslTextureMultisampled2d, align, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, builtin, comparisonSampler, deepEqual, disarrayOf, f16, f32, float16, float16x2, float16x4, float32, float32x2, float32x3, float32x4, formatToWGSLType, PUBLIC_getLongestContiguousPrefix as getLongestContiguousPrefix, i32, interpolate, invariant, isAlignAttrib, isAtomic, isBuiltin, isBuiltinAttrib, PUBLIC_isContiguous as isContiguous, isData, isDecorated, isDisarray, isInterpolateAttrib, isLocationAttrib, isLooseData, isLooseDecorated, isPackedData, isPtr, isSizeAttrib, isUnstruct, isWgslArray, isWgslData, isWgslStruct, location, m2x2f, m3x3f, m4x4f, mat2x2f, mat3x3f, mat4x4f, matBase, matToArray, memoryLayoutOf, packedFormats, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, _ref as ref, sampler, sint16, sint16x2, sint16x4, sint32, sint32x2, sint32x3, sint32x4, sint8, sint8x2, sint8x4, size, PUBLIC_sizeOf as sizeOf, snorm16, snorm16x2, snorm16x4, snorm8, snorm8x2, snorm8x4, struct, texture1d, texture2d, texture2dArray, texture3d, textureCube, textureCubeArray, textureDepth2d, textureDepth2dArray, textureDepthCube, textureDepthCubeArray, textureDepthMultisampled2d, textureExternal, textureMultisampled2d, textureStorage1d, textureStorage2d, textureStorage2dArray, textureStorage3d, u16, u32, uint16, uint16x2, uint16x4, uint32, uint32x2, uint32x3, uint32x4, uint8, uint8x2, uint8x4, unorm10_10_10_2, unorm16, unorm16x2, unorm16x4, unorm8, unorm8x2, unorm8x4, unorm8x4_bgra, unstruct, v2b, v2f, v2i, v2u, v3b, v3f, v3i, v3u, v4b, v4f, v4i, v4u, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u, vecBase };
315
6
  }
316
- /**
317
- * Creates an array schema that can be used to construct vertex buffers.
318
- * Describes arrays with fixed-size length, storing elements of the same type.
319
- *
320
- * Elements in the schema are not aligned in respect to their `byteAlignment`,
321
- * unless they are explicitly decorated with the custom align attribute
322
- * via `d.align` function.
323
- *
324
- * @example
325
- * const disarray = d.disarrayOf(d.vec3f, 3); // packed array of vec3f
326
- *
327
- * @example
328
- * const disarray = d.disarrayOf(d.align(16, d.vec3f), 3);
329
- *
330
- * If `elementCount` is not specified, a partially applied function is returned.
331
- * @example
332
- * const disarray = d.disarrayOf(d.vec3f);
333
- * // ^? (n: number) => Disarray<d.Vec3f>
334
- *
335
- * @param elementType The type of elements in the array.
336
- * @param elementCount The number of elements in the array.
337
- */
338
- declare const disarrayOf: DualFn<DisarrayConstructor>;
339
-
340
- /**
341
- * Creates a loose struct schema that can be used to construct vertex buffers.
342
- * Describes structs with members of both loose and non-loose types.
343
- *
344
- * The order of members matches the passed in properties object.
345
- * Members are not aligned in respect to their `byteAlignment`,
346
- * unless they are explicitly decorated with the custom align attribute
347
- * via `d.align` function.
348
- *
349
- * @example
350
- * const CircleStruct = d.unstruct({ radius: d.f32, pos: d.vec3f }); // packed struct with no padding
351
- *
352
- * @example
353
- * const CircleStruct = d.unstruct({ radius: d.f32, pos: d.align(16, d.vec3f) });
354
- *
355
- * @param properties Record with `string` keys and `TgpuData` or `TgpuLooseData` values,
356
- * each entry describing one struct member.
357
- */
358
- declare function unstruct<TProps extends Record<string, BaseData>>(properties: TProps): Unstruct<TProps>;
359
-
360
- /**
361
- * Marks a concrete integer scalar type schema (u32 or i32) as a WGSL atomic.
362
- *
363
- * @example
364
- * const atomicU32 = d.atomic(d.u32);
365
- * const atomicI32 = d.atomic(d.i32);
366
- *
367
- * @param data Underlying type schema.
368
- */
369
- declare function atomic<TSchema extends U32 | I32>(data: TSchema): Atomic<TSchema>;
370
-
371
- /**
372
- * Returns the size (in bytes) of data represented by the `schema`.
373
- */
374
- declare function PUBLIC_sizeOf(schema: AnyData): number;
375
-
376
- /**
377
- * Returns the alignment (in bytes) of data represented by the `schema`.
378
- */
379
- declare function PUBLIC_alignmentOf(schema: AnyData): number;
380
-
381
- /**
382
- * Performs a deep comparison of two TypeGPU data schemas.
383
- *
384
- * @param a The first data schema to compare.
385
- * @param b The second data schema to compare.
386
- * @returns `true` if the schemas are deeply equal, `false` otherwise.
387
- *
388
- * @example
389
- * ```ts
390
- * import { vec3f, struct, deepEqual } from 'typegpu/data';
391
- *
392
- * const schema1 = struct({ a: vec3f });
393
- * const schema2 = struct({ a: vec3f });
394
- * const schema3 = struct({ b: vec3f });
395
- *
396
- * console.log(deepEqual(schema1, schema2)); // true
397
- * console.log(deepEqual(schema1, schema3)); // false
398
- * ```
399
- */
400
- declare function deepEqual(a: AnyData, b: AnyData): boolean;
401
-
402
- export { AnyData, AnyWgslData, Atomic, BaseData, BaseData as BaseWgslData, Bool, Disarray, F16, F32, I32, Ptr, StorableData, U16, U32, Unstruct, Vec2b, Vec2f, Vec2h, Vec2i, Vec2u, Vec3b, Vec3f, Vec3h, Vec3i, Vec3u, Vec4b, Vec4f, Vec4h, Vec4i, Vec4u, WgslArray, WgslStruct, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, deepEqual, disarrayOf, f16, f32, i32, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, PUBLIC_sizeOf as sizeOf, struct, u16, u32, unstruct, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u };
7
+ //#endregion
8
+ export { type Align, type AnyAttribute, type AnyBuiltin, type AnyData, type AnyLooseData, type AnyVecInstance, type AnyWgslData, type AnyWgslStruct, type Atomic, type BaseData, type BaseData as BaseWgslData, type Bool, type Builtin, type BuiltinClipDistances, type BuiltinFragDepth, type BuiltinFrontFacing, type BuiltinGlobalInvocationId, type BuiltinInstanceIndex, type BuiltinLocalInvocationId, type BuiltinLocalInvocationIndex, type BuiltinNumWorkgroups, type BuiltinPosition, type BuiltinSampleIndex, type BuiltinSampleMask, type BuiltinVertexIndex, type BuiltinWorkgroupId, type Decorated, type Disarray, type F16, type F32, FormatToAcceptedData, FormatToWGSLType, type HasCustomLocation, type I32, type Infer, type InferGPU, type InferPartial, type Interpolate, type IsBuiltin, type Location, type LooseDecorated, type Mat2x2f, type Mat3x3f, type Mat4x4f, PackedData, type Ptr, type Size, type StorableData, TgpuVertexFormatData, type U16, type U32, type Unstruct, type Vec2b, type Vec2f, type Vec2h, type Vec2i, type Vec2u, type Vec3b, type Vec3f, type Vec3h, type Vec3i, type Vec3u, type Vec4b, type Vec4f, type Vec4h, type Vec4i, type Vec4u, Void, type WgslArray, type WgslComparisonSampler, type WgslExternalTexture, type WgslSampler, type WgslStorageTexture, type WgslStorageTexture1d, type WgslStorageTexture2d, type WgslStorageTexture2dArray, type WgslStorageTexture3d, type WgslStorageTextureProps, type WgslStruct, type WgslTexture, type WgslTexture1d, type WgslTexture2d, type WgslTexture2dArray, type WgslTexture3d, type WgslTextureCube, type WgslTextureCubeArray, type WgslTextureDepth2d, type WgslTextureDepth2dArray, type WgslTextureDepthCube, type WgslTextureDepthCubeArray, type WgslTextureDepthMultisampled2d, type WgslTextureMultisampled2d, align, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, builtin, comparisonSampler, deepEqual, disarrayOf, f16, f32, float16, float16x2, float16x4, float32, float32x2, float32x3, float32x4, formatToWGSLType, PUBLIC_getLongestContiguousPrefix as getLongestContiguousPrefix, i32, interpolate, invariant, isAlignAttrib, isAtomic, isBuiltin, isBuiltinAttrib, PUBLIC_isContiguous as isContiguous, isData, isDecorated, isDisarray, isInterpolateAttrib, isLocationAttrib, isLooseData, isLooseDecorated, isPackedData, isPtr, isSizeAttrib, isUnstruct, isWgslArray, isWgslData, isWgslStruct, location, type m2x2f, type m3x3f, type m4x4f, mat2x2f, mat3x3f, mat4x4f, type matBase, matToArray, memoryLayoutOf, packedFormats, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, _ref as ref, sampler, sint16, sint16x2, sint16x4, sint32, sint32x2, sint32x3, sint32x4, sint8, sint8x2, sint8x4, size, PUBLIC_sizeOf as sizeOf, snorm16, snorm16x2, snorm16x4, snorm8, snorm8x2, snorm8x4, struct, index_d_exports as t, texture1d, texture2d, texture2dArray, texture3d, textureCube, textureCubeArray, textureDepth2d, textureDepth2dArray, textureDepthCube, textureDepthCubeArray, textureDepthMultisampled2d, textureExternal, textureMultisampled2d, textureStorage1d, textureStorage2d, textureStorage2dArray, textureStorage3d, u16, u32, uint16, uint16x2, uint16x4, uint32, uint32x2, uint32x3, uint32x4, uint8, uint8x2, uint8x4, unorm10_10_10_2, unorm16, unorm16x2, unorm16x4, unorm8, unorm8x2, unorm8x4, unorm8x4_bgra, unstruct, type v2b, type v2f, type v2i, type v2u, type v3b, type v3f, type v3i, type v3u, type v4b, type v4f, type v4i, type v4u, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u, type vecBase };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/data/index.ts"],"mappings":""}
package/data/index.js CHANGED
@@ -1,2 +1,165 @@
1
- import{a as jb,b as kb,c as lb,d as mb,e as nb,f as ob,g as pb,h as qb,i as rb}from"../chunk-6U5HPHCJ.js";import{A as Ra,B as Sa,C as Ta,D as Ua,E as Va,F as Wa,G as Xa,H as Ya,I as Za,J as _a,K as $a,L as ab,M as bb,N as cb,O as db,P as eb,Q as fb,T as hb,j as M,k as N,l as O,m as P,u as Pa,v as Qa}from"../chunk-ECR2EGZX.js";import{$a as B,$b as Ca,Ab as ba,B as b,Bb as ca,C as c,Cb as da,D as d,Db as ea,E as e,Eb as fa,F as f,Fb as ga,G as g,Gb as ha,H as h,Hb as ia,I as i,Ib as ja,J as j,Jb as ka,K as k,Kb as la,L as l,Lb as ma,Mb as na,Nb as oa,Ob as pa,Pb as qa,Q as m,Qa as r,Qb as ra,R as n,Ra as s,Rb as sa,S as o,Sa as t,Sb as ta,T as p,Ta as u,Tb as ua,Ua as v,Ub as va,V as q,Va as w,Vb as wa,Wb as xa,Xa as x,Xb as ya,Ya as y,Yb as za,Za as z,Zb as Aa,_a as A,_b as Ba,ab as C,ac as Da,bb as D,bc as Ea,cb as E,cc as Fa,db as F,eb as G,fb as H,fc as Ga,gb as I,hb as J,ib as K,ic as Ha,jb as L,jc as Ia,kc as Ja,lc as Ka,mc as La,nb as Q,nc as Ma,ob as R,oc as Na,pb as S,q as a,qb as T,rb as U,rc as Oa,sb as V,tb as W,tc as gb,ub as X,uc as ib,vb as Y,wb as Z,xb as _,yb as $,zb as aa}from"../chunk-CRZWTZM2.js";export{a as Void,Ia as align,Ga as alignmentOf,gb as arrayOf,hb as atomic,r as bool,ib as builtin,Qa as comparisonSampler,rb as deepEqual,pb as disarrayOf,w as f16,v as f32,oa as float16,pa as float16x2,qa as float16x4,ra as float32,sa as float32x2,ta as float32x3,ua as float32x4,Q as formatToWGSLType,u as i32,La as interpolate,Ma as invariant,g as isAlignAttrib,f as isAtomic,Na as isBuiltin,k as isBuiltinAttrib,q as isData,l as isDecorated,n as isDisarray,j as isInterpolateAttrib,i as isLocationAttrib,m as isLooseData,p as isLooseDecorated,Fa as isPackedData,e as isPtr,h as isSizeAttrib,o as isUnstruct,c as isWgslArray,b as isWgslData,d as isWgslStruct,Ka as location,M as mat2x2f,N as mat3x3f,O as mat4x4f,P as matToArray,R as packedFormats,jb as ptrFn,ob as ptrHandle,kb as ptrPrivate,mb as ptrStorage,nb as ptrUniform,lb as ptrWorkgroup,Pa as sampler,fa as sint16,ga as sint16x2,ha as sint16x4,za as sint32,Aa as sint32x2,Ba as sint32x3,Ca as sint32x4,V as sint8,W as sint8x2,X as sint8x4,Ja as size,Ha as sizeOf,la as snorm16,ma as snorm16x2,na as snorm16x4,$ as snorm8,aa as snorm8x2,ba as snorm8x4,Oa as struct,Ra as texture1d,Sa as texture2d,Ua as texture2dArray,Xa as texture3d,Va as textureCube,Wa as textureCubeArray,ab as textureDepth2d,cb as textureDepth2dArray,db as textureDepthCube,eb as textureDepthCubeArray,bb as textureDepthMultisampled2d,fb as textureExternal,Ta as textureMultisampled2d,Ya as textureStorage1d,Za as textureStorage2d,_a as textureStorage2dArray,$a as textureStorage3d,t as u16,s as u32,ca as uint16,da as uint16x2,ea as uint16x4,va as uint32,wa as uint32x2,xa as uint32x3,ya as uint32x4,S as uint8,T as uint8x2,U as uint8x4,Da as unorm10_10_10_2,ia as unorm16,ja as unorm16x2,ka as unorm16x4,Y as unorm8,Z as unorm8x2,_ as unorm8x4,Ea as unorm8x4_bgra,qb as unstruct,B as vec2b,x as vec2f,y as vec2h,z as vec2i,A as vec2u,G as vec3b,C as vec3f,D as vec3h,E as vec3i,F as vec3u,L as vec4b,H as vec4f,I as vec4h,J as vec4i,K as vec4u};
1
+ import { t as __exportAll } from "../chunk-BYypO7fO.js";
2
+ import { $ as VecBase, An as isAlignAttrib, B as vec2h, Cn as isDisarray, Dt as ptrStorage, En as isUnstruct, Et as ptrPrivate, Fn as isInterpolateAttrib, G as vec3h, H as vec2u, Hn as isSizeAttrib, In as isLocationAttrib, J as vec4b, Jn as isWgslData, K as vec3i, Mn as isBuiltinAttrib, Nn as isDecorated, Ot as ptrUniform, P as struct, Q as vec4u, R as vec2b, Sn as isData, Tn as isLooseDecorated, Tt as ptrHandle, U as vec3b, V as vec2i, Vn as isPtr, W as vec3f, X as vec4h, Y as vec4f, Yn as isWgslStruct, Z as vec4i, _ as mat4x4f, at as i32, d as MatBase, g as mat3x3f, h as mat2x2f, it as f32, jn as isAtomic, kn as Void, kt as ptrWorkgroup, nt as bool, ot as u16, q as vec3u, qn as isWgslArray, rt as f16, st as u32, v as matToArray, wn as isLooseData, wt as ptrFn, yt as _ref, z as vec2f } from "../operators-HTxa_0k9.js";
3
+ import { $ as uint32x4, A as packedFormats, B as sint8x4, C as float16x4, D as float32x4, E as float32x3, F as sint32x2, G as snorm8x2, H as snorm16x2, I as sint32x3, J as uint16x2, K as snorm8x4, L as sint32x4, M as sint16x2, N as sint16x4, O as formatToWGSLType, P as sint32, Q as uint32x3, R as sint8, S as float16x2, T as float32x2, U as snorm16x4, V as snorm16, W as snorm8, X as uint32, Y as uint16x4, Z as uint32x2, at as unorm16x2, ct as unorm8x2, d as isBuiltin, et as uint8, f as location, i as infixOperators, it as unorm16, j as sint16, k as isPackedData, l as interpolate, lt as unorm8x4, m as PUBLIC_sizeOf, n as arrayOf, nt as uint8x4, ot as unorm16x4, p as size, q as uint16, rt as unorm10_10_10_2, s as align, st as unorm8, t as builtin, tt as uint8x2, u as invariant, ut as unorm8x4_bgra, v as PUBLIC_alignmentOf, w as float32, x as float16, z as sint8x2 } from "../builtin-ClEnM-Ye.js";
4
+ import { a as PUBLIC_getLongestContiguousPrefix, i as memoryLayoutOf, n as unstruct, o as PUBLIC_isContiguous, p as sampler, r as disarrayOf, s as atomic, t as deepEqual, u as comparisonSampler } from "../deepEqual-yZXvaV2C.js";
5
+ import { _ as textureMultisampled2d, a as texture2d, b as textureStorage2dArray, c as textureCube, d as textureDepth2dArray, f as textureDepthCube, g as textureExternal, i as texture1d, l as textureCubeArray, m as textureDepthMultisampled2d, o as texture2dArray, p as textureDepthCubeArray, s as texture3d, u as textureDepth2d, v as textureStorage1d, x as textureStorage3d, y as textureStorage2d } from "../texture-Dg5ybJro.js";
6
+ import { Operator } from "tsover-runtime";
7
+
8
+ //#region src/data/index.ts
9
+ /**
10
+ * @module typegpu/data
11
+ */
12
+ var data_exports = /* @__PURE__ */ __exportAll({
13
+ Void: () => Void,
14
+ align: () => align,
15
+ alignmentOf: () => PUBLIC_alignmentOf,
16
+ arrayOf: () => arrayOf,
17
+ atomic: () => atomic,
18
+ bool: () => bool,
19
+ builtin: () => builtin,
20
+ comparisonSampler: () => comparisonSampler,
21
+ deepEqual: () => deepEqual,
22
+ disarrayOf: () => disarrayOf,
23
+ f16: () => f16,
24
+ f32: () => f32,
25
+ float16: () => float16,
26
+ float16x2: () => float16x2,
27
+ float16x4: () => float16x4,
28
+ float32: () => float32,
29
+ float32x2: () => float32x2,
30
+ float32x3: () => float32x3,
31
+ float32x4: () => float32x4,
32
+ formatToWGSLType: () => formatToWGSLType,
33
+ getLongestContiguousPrefix: () => PUBLIC_getLongestContiguousPrefix,
34
+ i32: () => i32,
35
+ interpolate: () => interpolate,
36
+ invariant: () => invariant,
37
+ isAlignAttrib: () => isAlignAttrib,
38
+ isAtomic: () => isAtomic,
39
+ isBuiltin: () => isBuiltin,
40
+ isBuiltinAttrib: () => isBuiltinAttrib,
41
+ isContiguous: () => PUBLIC_isContiguous,
42
+ isData: () => isData,
43
+ isDecorated: () => isDecorated,
44
+ isDisarray: () => isDisarray,
45
+ isInterpolateAttrib: () => isInterpolateAttrib,
46
+ isLocationAttrib: () => isLocationAttrib,
47
+ isLooseData: () => isLooseData,
48
+ isLooseDecorated: () => isLooseDecorated,
49
+ isPackedData: () => isPackedData,
50
+ isPtr: () => isPtr,
51
+ isSizeAttrib: () => isSizeAttrib,
52
+ isUnstruct: () => isUnstruct,
53
+ isWgslArray: () => isWgslArray,
54
+ isWgslData: () => isWgslData,
55
+ isWgslStruct: () => isWgslStruct,
56
+ location: () => location,
57
+ mat2x2f: () => mat2x2f,
58
+ mat3x3f: () => mat3x3f,
59
+ mat4x4f: () => mat4x4f,
60
+ matToArray: () => matToArray,
61
+ memoryLayoutOf: () => memoryLayoutOf,
62
+ packedFormats: () => packedFormats,
63
+ ptrFn: () => ptrFn,
64
+ ptrHandle: () => ptrHandle,
65
+ ptrPrivate: () => ptrPrivate,
66
+ ptrStorage: () => ptrStorage,
67
+ ptrUniform: () => ptrUniform,
68
+ ptrWorkgroup: () => ptrWorkgroup,
69
+ ref: () => _ref,
70
+ sampler: () => sampler,
71
+ sint16: () => sint16,
72
+ sint16x2: () => sint16x2,
73
+ sint16x4: () => sint16x4,
74
+ sint32: () => sint32,
75
+ sint32x2: () => sint32x2,
76
+ sint32x3: () => sint32x3,
77
+ sint32x4: () => sint32x4,
78
+ sint8: () => sint8,
79
+ sint8x2: () => sint8x2,
80
+ sint8x4: () => sint8x4,
81
+ size: () => size,
82
+ sizeOf: () => PUBLIC_sizeOf,
83
+ snorm16: () => snorm16,
84
+ snorm16x2: () => snorm16x2,
85
+ snorm16x4: () => snorm16x4,
86
+ snorm8: () => snorm8,
87
+ snorm8x2: () => snorm8x2,
88
+ snorm8x4: () => snorm8x4,
89
+ struct: () => struct,
90
+ texture1d: () => texture1d,
91
+ texture2d: () => texture2d,
92
+ texture2dArray: () => texture2dArray,
93
+ texture3d: () => texture3d,
94
+ textureCube: () => textureCube,
95
+ textureCubeArray: () => textureCubeArray,
96
+ textureDepth2d: () => textureDepth2d,
97
+ textureDepth2dArray: () => textureDepth2dArray,
98
+ textureDepthCube: () => textureDepthCube,
99
+ textureDepthCubeArray: () => textureDepthCubeArray,
100
+ textureDepthMultisampled2d: () => textureDepthMultisampled2d,
101
+ textureExternal: () => textureExternal,
102
+ textureMultisampled2d: () => textureMultisampled2d,
103
+ textureStorage1d: () => textureStorage1d,
104
+ textureStorage2d: () => textureStorage2d,
105
+ textureStorage2dArray: () => textureStorage2dArray,
106
+ textureStorage3d: () => textureStorage3d,
107
+ u16: () => u16,
108
+ u32: () => u32,
109
+ uint16: () => uint16,
110
+ uint16x2: () => uint16x2,
111
+ uint16x4: () => uint16x4,
112
+ uint32: () => uint32,
113
+ uint32x2: () => uint32x2,
114
+ uint32x3: () => uint32x3,
115
+ uint32x4: () => uint32x4,
116
+ uint8: () => uint8,
117
+ uint8x2: () => uint8x2,
118
+ uint8x4: () => uint8x4,
119
+ unorm10_10_10_2: () => unorm10_10_10_2,
120
+ unorm16: () => unorm16,
121
+ unorm16x2: () => unorm16x2,
122
+ unorm16x4: () => unorm16x4,
123
+ unorm8: () => unorm8,
124
+ unorm8x2: () => unorm8x2,
125
+ unorm8x4: () => unorm8x4,
126
+ unorm8x4_bgra: () => unorm8x4_bgra,
127
+ unstruct: () => unstruct,
128
+ vec2b: () => vec2b,
129
+ vec2f: () => vec2f,
130
+ vec2h: () => vec2h,
131
+ vec2i: () => vec2i,
132
+ vec2u: () => vec2u,
133
+ vec3b: () => vec3b,
134
+ vec3f: () => vec3f,
135
+ vec3h: () => vec3h,
136
+ vec3i: () => vec3i,
137
+ vec3u: () => vec3u,
138
+ vec4b: () => vec4b,
139
+ vec4f: () => vec4f,
140
+ vec4h: () => vec4h,
141
+ vec4i: () => vec4i,
142
+ vec4u: () => vec4u
143
+ });
144
+ function assignInfixOperator(object, operator, operatorSymbol) {
145
+ const proto = object.prototype;
146
+ const opImpl = infixOperators[operator];
147
+ proto[operator] = function(other) {
148
+ return opImpl(this, other);
149
+ };
150
+ proto[operatorSymbol] = (lhs, rhs) => {
151
+ return opImpl(lhs, rhs);
152
+ };
153
+ }
154
+ assignInfixOperator(VecBase, "add", Operator.plus);
155
+ assignInfixOperator(VecBase, "sub", Operator.minus);
156
+ assignInfixOperator(VecBase, "mul", Operator.star);
157
+ assignInfixOperator(VecBase, "div", Operator.slash);
158
+ assignInfixOperator(VecBase, "mod", Operator.percent);
159
+ assignInfixOperator(MatBase, "add", Operator.plus);
160
+ assignInfixOperator(MatBase, "sub", Operator.minus);
161
+ assignInfixOperator(MatBase, "mul", Operator.star);
162
+
163
+ //#endregion
164
+ export { Void, align, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, builtin, comparisonSampler, deepEqual, disarrayOf, f16, f32, float16, float16x2, float16x4, float32, float32x2, float32x3, float32x4, formatToWGSLType, PUBLIC_getLongestContiguousPrefix as getLongestContiguousPrefix, i32, interpolate, invariant, isAlignAttrib, isAtomic, isBuiltin, isBuiltinAttrib, PUBLIC_isContiguous as isContiguous, isData, isDecorated, isDisarray, isInterpolateAttrib, isLocationAttrib, isLooseData, isLooseDecorated, isPackedData, isPtr, isSizeAttrib, isUnstruct, isWgslArray, isWgslData, isWgslStruct, location, mat2x2f, mat3x3f, mat4x4f, matToArray, memoryLayoutOf, packedFormats, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, _ref as ref, sampler, sint16, sint16x2, sint16x4, sint32, sint32x2, sint32x3, sint32x4, sint8, sint8x2, sint8x4, size, PUBLIC_sizeOf as sizeOf, snorm16, snorm16x2, snorm16x4, snorm8, snorm8x2, snorm8x4, struct, data_exports as t, texture1d, texture2d, texture2dArray, texture3d, textureCube, textureCubeArray, textureDepth2d, textureDepth2dArray, textureDepthCube, textureDepthCubeArray, textureDepthMultisampled2d, textureExternal, textureMultisampled2d, textureStorage1d, textureStorage2d, textureStorage2dArray, textureStorage3d, u16, u32, uint16, uint16x2, uint16x4, uint32, uint32x2, uint32x3, uint32x4, uint8, uint8x2, uint8x4, unorm10_10_10_2, unorm16, unorm16x2, unorm16x4, unorm8, unorm8x2, unorm8x4, unorm8x4_bgra, unstruct, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u };
2
165
  //# sourceMappingURL=index.js.map
package/data/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/data/index.ts"],"sourcesContent":["/**\n * @module typegpu/data\n */\n\n// NOTE: This is a barrel file, internal files should not import things from this file\n\nimport { Operator } from 'tsover-runtime';\nimport { type InfixOperator, infixOperators } from '../tgsl/accessProp.ts';\nimport { MatBase } from './matrix.ts';\nimport { VecBase } from './vectorImpl.ts';\n\nfunction assignInfixOperator<T extends typeof VecBase | typeof MatBase>(\n object: T,\n operator: InfixOperator,\n operatorSymbol: symbol,\n) {\n // oxlint-disable-next-line typescript/no-explicit-any anything is possible\n const proto = object.prototype as any;\n const opImpl = infixOperators[operator] as (\n lhs: unknown,\n rhs: unknown,\n ) => unknown;\n\n proto[operator] = function (this: unknown, other: unknown): unknown {\n return opImpl(this, other);\n };\n\n proto[operatorSymbol] = (lhs: unknown, rhs: unknown): unknown => {\n return opImpl(lhs, rhs);\n };\n}\n\nassignInfixOperator(VecBase, 'add', Operator.plus);\nassignInfixOperator(VecBase, 'sub', Operator.minus);\nassignInfixOperator(VecBase, 'mul', Operator.star);\nassignInfixOperator(VecBase, 'div', Operator.slash);\nassignInfixOperator(VecBase, 'mod', Operator.percent);\nassignInfixOperator(MatBase, 'add', Operator.plus);\nassignInfixOperator(MatBase, 'sub', Operator.minus);\nassignInfixOperator(MatBase, 'mul', Operator.star);\n\nexport { bool, f16, f32, i32, u16, u32 } from './numeric.ts';\nexport {\n isAlignAttrib,\n isAtomic,\n isBuiltinAttrib,\n isDecorated,\n isInterpolateAttrib,\n isLocationAttrib,\n isPtr,\n isSizeAttrib,\n isWgslArray,\n isWgslData,\n isWgslStruct,\n Void,\n} from './wgslTypes.ts';\nexport type {\n Align,\n AnyVecInstance,\n AnyWgslData,\n AnyWgslStruct,\n Atomic,\n BaseData,\n BaseData as BaseWgslData,\n Bool,\n Builtin,\n Decorated,\n F16,\n F32,\n I32,\n Interpolate,\n Location,\n m2x2f,\n m3x3f,\n m4x4f,\n Mat2x2f,\n Mat3x3f,\n Mat4x4f,\n matBase,\n Ptr,\n Size,\n StorableData,\n U16,\n U32,\n v2b,\n v2f,\n v2i,\n v2u,\n v3b,\n v3f,\n v3i,\n v3u,\n v4b,\n v4f,\n v4i,\n v4u,\n Vec2b,\n Vec2f,\n Vec2h,\n Vec2i,\n Vec2u,\n Vec3b,\n Vec3f,\n Vec3h,\n Vec3i,\n Vec3u,\n Vec4b,\n Vec4f,\n Vec4h,\n Vec4i,\n Vec4u,\n vecBase,\n WgslArray,\n WgslStruct,\n} from './wgslTypes.ts';\nexport { struct } from './struct.ts';\nexport { arrayOf } from './array.ts';\nexport {\n ptrFn,\n ptrHandle,\n ptrPrivate,\n ptrStorage,\n ptrUniform,\n ptrWorkgroup,\n} from './ptr.ts';\nexport type {\n AnyData,\n AnyLooseData,\n Disarray,\n LooseDecorated,\n Unstruct,\n} from './dataTypes.ts';\nexport {\n texture1d,\n texture2d,\n texture2dArray,\n texture3d,\n textureCube,\n textureCubeArray,\n textureDepth2d,\n textureDepth2dArray,\n textureDepthCube,\n textureDepthCubeArray,\n textureDepthMultisampled2d,\n textureExternal,\n textureMultisampled2d,\n textureStorage1d,\n textureStorage2d,\n textureStorage2dArray,\n textureStorage3d,\n type WgslExternalTexture,\n type WgslStorageTexture,\n type WgslStorageTexture1d,\n type WgslStorageTexture2d,\n type WgslStorageTexture2dArray,\n type WgslStorageTexture3d,\n type WgslStorageTextureProps,\n type WgslTexture,\n type WgslTexture1d,\n type WgslTexture2d,\n type WgslTexture2dArray,\n type WgslTexture3d,\n type WgslTextureCube,\n type WgslTextureCubeArray,\n type WgslTextureDepth2d,\n type WgslTextureDepth2dArray,\n type WgslTextureDepthCube,\n type WgslTextureDepthCubeArray,\n type WgslTextureDepthMultisampled2d,\n type WgslTextureMultisampled2d,\n} from './texture.ts';\nexport {\n comparisonSampler,\n sampler,\n type WgslComparisonSampler,\n type WgslSampler,\n} from './sampler.ts';\nexport {\n vec2b,\n vec2f,\n vec2h,\n vec2i,\n vec2u,\n vec3b,\n vec3f,\n vec3h,\n vec3i,\n vec3u,\n vec4b,\n vec4f,\n vec4h,\n vec4i,\n vec4u,\n} from './vector.ts';\nexport { disarrayOf } from './disarray.ts';\nexport { unstruct } from './unstruct.ts';\nexport { mat2x2f, mat3x3f, mat4x4f, matToArray } from './matrix.ts';\nexport * from './vertexFormatData.ts';\nexport { atomic } from './atomic.ts';\nexport { _ref as ref } from './ref.ts';\nexport {\n align,\n type AnyAttribute,\n type HasCustomLocation,\n interpolate,\n invariant,\n type IsBuiltin,\n isBuiltin,\n location,\n size,\n} from './attributes.ts';\nexport {\n isData,\n isDisarray,\n isLooseData,\n isLooseDecorated,\n isUnstruct,\n} from './dataTypes.ts';\nexport { PUBLIC_sizeOf as sizeOf } from './sizeOf.ts';\nexport { PUBLIC_isContiguous as isContiguous } from './isContiguous.ts';\nexport {\n PUBLIC_getLongestContiguousPrefix as getLongestContiguousPrefix,\n} from './getLongestContiguousPrefix.ts';\nexport { memoryLayoutOf } from './offsetUtils.ts';\nexport { PUBLIC_alignmentOf as alignmentOf } from './alignmentOf.ts';\nexport { builtin } from '../builtin.ts';\nexport { deepEqual } from './deepEqual.ts';\nexport type {\n AnyBuiltin,\n BuiltinClipDistances,\n BuiltinFragDepth,\n BuiltinFrontFacing,\n BuiltinGlobalInvocationId,\n BuiltinInstanceIndex,\n BuiltinLocalInvocationId,\n BuiltinLocalInvocationIndex,\n BuiltinNumWorkgroups,\n BuiltinPosition,\n BuiltinSampleIndex,\n BuiltinSampleMask,\n BuiltinVertexIndex,\n BuiltinWorkgroupId,\n} from '../builtin.ts';\nexport type { Infer, InferGPU, InferPartial } from '../shared/repr.ts';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,oBACP,QACA,UACA,gBACA;CAEA,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,eAAe;AAK9B,OAAM,YAAY,SAAyB,OAAyB;AAClE,SAAO,OAAO,MAAM,MAAM;;AAG5B,OAAM,mBAAmB,KAAc,QAA0B;AAC/D,SAAO,OAAO,KAAK,IAAI;;;AAI3B,oBAAoB,SAAS,OAAO,SAAS,KAAK;AAClD,oBAAoB,SAAS,OAAO,SAAS,MAAM;AACnD,oBAAoB,SAAS,OAAO,SAAS,KAAK;AAClD,oBAAoB,SAAS,OAAO,SAAS,MAAM;AACnD,oBAAoB,SAAS,OAAO,SAAS,QAAQ;AACrD,oBAAoB,SAAS,OAAO,SAAS,KAAK;AAClD,oBAAoB,SAAS,OAAO,SAAS,MAAM;AACnD,oBAAoB,SAAS,OAAO,SAAS,KAAK"}