typegpu 0.9.0 → 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 (48) hide show
  1. package/README.md +1 -1
  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 -401
  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 +124 -310
  20. package/index.d.ts.map +1 -0
  21. package/index.js +6282 -153
  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 -621
  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-5ABKYSJD.js +0 -2
  35. package/chunk-5ABKYSJD.js.map +0 -1
  36. package/chunk-D5UYO3OX.js +0 -3
  37. package/chunk-D5UYO3OX.js.map +0 -1
  38. package/chunk-EHLRP4V2.js +0 -2
  39. package/chunk-EHLRP4V2.js.map +0 -1
  40. package/chunk-LMPPDGRD.js +0 -2
  41. package/chunk-LMPPDGRD.js.map +0 -1
  42. package/chunk-MBB2XFH6.js +0 -2
  43. package/chunk-MBB2XFH6.js.map +0 -1
  44. package/chunk-SHSILTWI.js +0 -10
  45. package/chunk-SHSILTWI.js.map +0 -1
  46. package/comptime-DKpw1IVu.d.ts +0 -28
  47. package/matrix-C4IFKU1R.d.ts +0 -123
  48. package/tgpuConstant-BOn7U_lv.d.ts +0 -4031
package/std/index.d.ts CHANGED
@@ -1,623 +1,9 @@
1
- import { dO as DualFn, dP as AnyNumericVecInstance, dQ as AnyFloatVecInstance, dR as AnyIntegerVecInstance, bN as v3f, dS as v3h, dT as AnyMatInstance, o as Infer, a_ as WgslStruct, aW as F32, aX as I32, aV as F16, dU as AbstractFloat, dV as AbstractInt, aT as Vec2f, b3 as Vec2i, b6 as Vec3f, b8 as Vec3i, bb as Vec4f, bd as Vec4i, b2 as Vec2h, b7 as Vec3h, bc as Vec4h, bJ as v2f, dW as v2h, bK as v2i, bO as v3i, bR as v4f, dX as v4h, bS as v4i, dY as AnyFloat32VecInstance, dZ as AnySignedVecInstance, d_ as vBaseForMat, d$ as mBaseForVec, bD as m4x4f, bv as AnyVecInstance, e0 as AnyVec2Instance, bI as v2b, e1 as AnyVec3Instance, bM as v3b, bQ as v4b, e2 as AnyBooleanVecInstance, e3 as atomicI32, e4 as atomicU32, cz as ref, bW as texture1d, c7 as textureStorage1d, bX as texture2d, bY as texture2dArray, b_ as textureCube, b$ as textureCubeArray, c8 as textureStorage2d, c9 as textureStorage2dArray, c5 as textureExternal, bL as v2u, bZ as texture3d, ca as textureStorage3d, bP as v3u, bT as v4u, $ as $internal, c6 as textureMultisampled2d, e5 as StorageTextureFormats, e6 as TextureFormats, e7 as $repr, cw as sampler, c0 as textureDepth2d, c1 as textureDepth2dArray, c2 as textureDepthCube, cv as comparisonSampler, W as WgslExtension } from '../tgpuConstant-BOn7U_lv.js';
2
- export { i as identity2, d as identity3, e as identity4, r as rotationX4, f as rotationY4, g as rotationZ4, s as scaling4, t as translation4 } from '../matrix-C4IFKU1R.js';
3
- import { T as TgpuComptime } from '../comptime-DKpw1IVu.js';
4
- import 'tinyest';
1
+ import { $ as dpdyFine, $t as countOneBits, A as subgroupShuffleUp, An as quantizeToF16, At as rotateY4, B as textureSampleCompareLevel, Bn as smoothstep, Bt as abs, C as subgroupInclusiveMul, Cn as log2, Ct as le, D as subgroupOr, Dn as modf, Dt as or, E as subgroupMul, En as mix, Et as not, F as textureLoad, Fn as round, Ft as div, G as unpack2x16float, Gn as transpose, Gt as atan, H as textureStore, Hn as step, Ht as acosh, I as textureSample, In as saturate, It as mod, J as dpdx, Jt as ceil, K as unpack4x8unorm, Kn as trunc, Kt as atan2, L as textureSampleBaseClampToEdge, Ln as sign, Lt as mul, M as subgroupXor, Mn as reflect, Mt as scale4, N as textureDimensions, Nn as refract, Nt as translate4, O as subgroupShuffle, On as normalize, Ot as select, P as textureGather, Pn as reverseBits, Pt as add, Q as dpdyCoarse, Qt as countLeadingZeros, R as textureSampleBias, Rn as sin, Rt as neg, S as subgroupInclusiveAdd, Sn as log, St as isCloseTo, T as subgroupMin, Tn as min, Tt as ne, U as pack2x16float, Un as tan, Ut as asin, V as textureSampleLevel, Vn as sqrt, Vt as acos, W as pack4x8unorm, Wn as tanh, Wt as asinh, X as dpdxFine, Xt as cos, Y as dpdxCoarse, Yt as clamp, Z as dpdy, Zt as cosh, _ as subgroupBroadcast, _n as frexp, _t as and, an as dot, at as atomicLoad, b as subgroupExclusiveAdd, bn as ldexp, bt as ge, cn as exp, cr as rotationY4, ct as atomicOr, d as extensionEnabled, dn as faceForward, dr as translation4, dt as atomicXor, en as countTrailingZeros, er as identity2, et as fwidth, f as subgroupAdd, fn as firstLeadingBit, ft as storageBarrier, g as subgroupBallot, gn as fract, gt as allEq, h as subgroupAny, hn as fma, ht as all, in as distance, it as atomicAnd, j as subgroupShuffleXor, jn as radians, jt as rotateZ4, k as subgroupShuffleDown, kn as pow, kt as rotateX4, l as bitcastU32toF32, ln as exp2, lr as rotationZ4, lt as atomicStore, m as subgroupAnd, mn as floor, mt as workgroupBarrier, nn as degrees, nr as identity4, nt as fwidthFine, on as dot4I8Packed, ot as atomicMax, p as subgroupAll, pn as firstTrailingBit, pt as textureBarrier, q as arrayLength, qn as discard, qt as atanh, rn as determinant, rt as atomicAdd, sn as dot4U8Packed, sr as rotationX4, st as atomicMin, tn as cross, tr as identity3, tt as fwidthCoarse, u as bitcastU32toI32, un as extractBits, ur as scaling4, ut as atomicSub, v as subgroupBroadcastFirst, vn as insertBits, vt as any, w as subgroupMax, wn as max, wt as lt, x as subgroupExclusiveMul, xn as length, xt as gt, y as subgroupElect, yn as inverseSqrt, yt as eq, z as textureSampleCompare, zn as sinh, zt as sub } from "../indexNamedExports-Cdy7USiY.js";
5
2
 
6
- declare const discard: DualFn<() => never>;
7
-
8
- type NumVec$1 = AnyNumericVecInstance;
9
- declare function cpuAbs(value: number): number;
10
- declare function cpuAbs<T extends NumVec$1 | number>(value: T): T;
11
- declare const abs: DualFn<typeof cpuAbs>;
12
- declare function cpuAcos(value: number): number;
13
- declare function cpuAcos<T extends AnyFloatVecInstance>(value: T): T;
14
- declare const acos: DualFn<typeof cpuAcos>;
15
- declare function cpuAcosh(value: number): number;
16
- declare function cpuAcosh<T extends AnyFloatVecInstance>(value: T): T;
17
- declare const acosh: DualFn<typeof cpuAcosh>;
18
- declare function cpuAsin(value: number): number;
19
- declare function cpuAsin<T extends AnyFloatVecInstance>(value: T): T;
20
- declare const asin: DualFn<typeof cpuAsin>;
21
- declare function cpuAsinh(value: number): number;
22
- declare function cpuAsinh<T extends AnyFloatVecInstance>(value: T): T;
23
- declare const asinh: DualFn<typeof cpuAsinh>;
24
- declare function cpuAtan(value: number): number;
25
- declare function cpuAtan<T extends AnyFloatVecInstance>(value: T): T;
26
- declare const atan: DualFn<typeof cpuAtan>;
27
- declare function cpuAtanh(value: number): number;
28
- declare function cpuAtanh<T extends AnyFloatVecInstance>(value: T): T;
29
- declare const atanh: DualFn<typeof cpuAtanh>;
30
- declare function cpuAtan2(y: number, x: number): number;
31
- declare function cpuAtan2<T extends AnyFloatVecInstance>(y: T, x: T): T;
32
- declare const atan2: DualFn<typeof cpuAtan2>;
33
- declare function cpuCeil(value: number): number;
34
- declare function cpuCeil<T extends AnyFloatVecInstance>(value: T): T;
35
- declare const ceil: DualFn<typeof cpuCeil>;
36
- declare function cpuClamp(value: number, low: number, high: number): number;
37
- declare function cpuClamp<T extends NumVec$1 | number>(value: T, low: T, high: T): T;
38
- declare const clamp: DualFn<typeof cpuClamp>;
39
- declare function cpuCos(value: number): number;
40
- declare function cpuCos<T extends AnyFloatVecInstance>(value: T): T;
41
- declare const cos: DualFn<typeof cpuCos>;
42
- declare function cpuCosh(value: number): number;
43
- declare function cpuCosh<T extends AnyFloatVecInstance>(value: T): T;
44
- declare const cosh: DualFn<typeof cpuCosh>;
45
- declare function cpuCountLeadingZeros(value: number): number;
46
- declare function cpuCountLeadingZeros<T extends AnyIntegerVecInstance>(value: T): T;
47
- declare const countLeadingZeros: DualFn<typeof cpuCountLeadingZeros>;
48
- declare function cpuCountOneBits(value: number): number;
49
- declare function cpuCountOneBits<T extends AnyIntegerVecInstance>(value: T): T;
50
- declare const countOneBits: DualFn<typeof cpuCountOneBits>;
51
- declare function cpuCountTrailingZeros(value: number): number;
52
- declare function cpuCountTrailingZeros<T extends AnyIntegerVecInstance>(value: T): T;
53
- declare const countTrailingZeros: DualFn<typeof cpuCountTrailingZeros>;
54
- declare const cross: DualFn<(<T extends v3f | v3h>(a: T, b: T) => T)>;
55
- declare function cpuDegrees(value: number): number;
56
- declare function cpuDegrees<T extends AnyFloatVecInstance>(value: T): T;
57
- declare const degrees: DualFn<typeof cpuDegrees>;
58
- declare const determinant: DualFn<(value: AnyMatInstance) => number>;
59
- declare function cpuDistance(a: number, b: number): number;
60
- declare function cpuDistance<T extends AnyFloatVecInstance>(a: T, b: T): number;
61
- declare const distance: DualFn<typeof cpuDistance>;
62
- declare const dot: DualFn<(<T extends NumVec$1>(lhs: T, rhs: T) => number)>;
63
- declare const dot4U8Packed: DualFn<(e1: number, e2: number) => number>;
64
- declare const dot4I8Packed: DualFn<(e1: number, e2: number) => number>;
65
- declare function cpuExp(value: number): number;
66
- declare function cpuExp<T extends AnyFloatVecInstance>(value: T): T;
67
- declare const exp: DualFn<typeof cpuExp>;
68
- declare function cpuExp2(value: number): number;
69
- declare function cpuExp2<T extends AnyFloatVecInstance>(value: T): T;
70
- declare const exp2: DualFn<typeof cpuExp2>;
71
- declare function cpuExtractBits(e: number, offset: number, count: number): number;
72
- declare function cpuExtractBits<T extends AnyIntegerVecInstance>(e: T, offset: number, count: number): T;
73
- declare const extractBits: DualFn<typeof cpuExtractBits>;
74
- declare const faceForward: DualFn<(<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T) => T)>;
75
- declare function cpuFirstLeadingBit(value: number): number;
76
- declare function cpuFirstLeadingBit<T extends AnyIntegerVecInstance>(value: T): T;
77
- declare const firstLeadingBit: DualFn<typeof cpuFirstLeadingBit>;
78
- declare function cpuFirstTrailingBit(value: number): number;
79
- declare function cpuFirstTrailingBit<T extends AnyIntegerVecInstance>(value: T): T;
80
- declare const firstTrailingBit: DualFn<typeof cpuFirstTrailingBit>;
81
- declare function cpuFloor(value: number): number;
82
- declare function cpuFloor<T extends AnyFloatVecInstance>(value: T): T;
83
- declare const floor: DualFn<typeof cpuFloor>;
84
- declare function cpuFma(e1: number, e2: number, e3: number): number;
85
- declare function cpuFma<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T): T;
86
- declare const fma: DualFn<typeof cpuFma>;
87
- declare function cpuFract(value: number): number;
88
- declare function cpuFract<T extends AnyFloatVecInstance>(value: T): T;
89
- declare const fract: DualFn<typeof cpuFract>;
90
- declare const FrexpResults: {
91
- readonly f32: WgslStruct<{
92
- fract: F32;
93
- exp: I32;
94
- }>;
95
- readonly f16: WgslStruct<{
96
- fract: F16;
97
- exp: I32;
98
- }>;
99
- readonly abstractFloat: WgslStruct<{
100
- fract: AbstractFloat;
101
- exp: AbstractInt;
102
- }>;
103
- readonly vec2f: WgslStruct<{
104
- fract: Vec2f;
105
- exp: Vec2i;
106
- }>;
107
- readonly vec3f: WgslStruct<{
108
- fract: Vec3f;
109
- exp: Vec3i;
110
- }>;
111
- readonly vec4f: WgslStruct<{
112
- fract: Vec4f;
113
- exp: Vec4i;
114
- }>;
115
- readonly vec2h: WgslStruct<{
116
- fract: Vec2h;
117
- exp: Vec2i;
118
- }>;
119
- readonly vec3h: WgslStruct<{
120
- fract: Vec3h;
121
- exp: Vec3i;
122
- }>;
123
- readonly vec4h: WgslStruct<{
124
- fract: Vec4h;
125
- exp: Vec4i;
126
- }>;
127
- };
128
- type FrexpOverload = {
129
- (value: number): Infer<typeof FrexpResults['f32']>;
130
- <T extends AnyFloatVecInstance>(value: T): Infer<typeof FrexpResults[T['kind']]>;
131
- };
132
- declare const frexp: DualFn<FrexpOverload>;
133
- declare function cpuInsertBits(e: number, newbits: number, offset: number, count: number): number;
134
- declare function cpuInsertBits<T extends AnyIntegerVecInstance>(e: T, newbits: T, offset: number, count: number): T;
135
- declare const insertBits: DualFn<typeof cpuInsertBits>;
136
- declare function cpuInverseSqrt(value: number): number;
137
- declare function cpuInverseSqrt<T extends AnyFloatVecInstance>(value: T): T;
138
- declare const inverseSqrt: DualFn<typeof cpuInverseSqrt>;
139
- declare function cpuLdexp(e1: number, e2: number): number;
140
- declare function cpuLdexp<T extends v2f | v2h>(e1: T, e2: v2i): T;
141
- declare function cpuLdexp<T extends v3f | v3h>(e1: T, e2: v3i): T;
142
- declare function cpuLdexp<T extends v4f | v4h>(e1: T, e2: v4i): T;
143
- declare const ldexp: DualFn<typeof cpuLdexp>;
144
- declare function cpuLength(value: number): number;
145
- declare function cpuLength<T extends AnyFloatVecInstance>(value: T): number;
146
- declare const length: DualFn<typeof cpuLength>;
147
- declare function cpuLog(value: number): number;
148
- declare function cpuLog<T extends AnyFloatVecInstance>(value: T): T;
149
- declare const log: DualFn<typeof cpuLog>;
150
- declare function cpuLog2(value: number): number;
151
- declare function cpuLog2<T extends AnyFloatVecInstance>(value: T): T;
152
- declare const log2: DualFn<typeof cpuLog2>;
153
- type VariadicOverload = {
154
- (fst: number, ...rest: number[]): number;
155
- <T extends NumVec$1>(fst: T, ...rest: T[]): T;
156
- };
157
- declare const max: DualFn<VariadicOverload>;
158
- declare const min: DualFn<VariadicOverload>;
159
- declare function cpuMix(e1: number, e2: number, e3: number): number;
160
- declare function cpuMix<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: number): T;
161
- declare function cpuMix<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T): T;
162
- declare const mix: DualFn<typeof cpuMix>;
163
- declare const ModfResult: {
164
- readonly f32: WgslStruct<{
165
- fract: F32;
166
- whole: F32;
167
- }>;
168
- readonly f16: WgslStruct<{
169
- fract: F16;
170
- whole: F16;
171
- }>;
172
- readonly abstractFloat: WgslStruct<{
173
- fract: AbstractFloat;
174
- whole: AbstractFloat;
175
- }>;
176
- readonly vec2f: WgslStruct<{
177
- fract: Vec2f;
178
- whole: Vec2f;
179
- }>;
180
- readonly vec3f: WgslStruct<{
181
- fract: Vec3f;
182
- whole: Vec3f;
183
- }>;
184
- readonly vec4f: WgslStruct<{
185
- fract: Vec4f;
186
- whole: Vec4f;
187
- }>;
188
- readonly vec2h: WgslStruct<{
189
- fract: Vec2h;
190
- whole: Vec2h;
191
- }>;
192
- readonly vec3h: WgslStruct<{
193
- fract: Vec3h;
194
- whole: Vec3h;
195
- }>;
196
- readonly vec4h: WgslStruct<{
197
- fract: Vec4h;
198
- whole: Vec4h;
199
- }>;
200
- };
201
- type ModfOverload = {
202
- (value: number): Infer<typeof ModfResult['f32']>;
203
- <T extends AnyFloatVecInstance>(value: T): Infer<typeof ModfResult[T['kind']]>;
204
- };
205
- declare const modf: ModfOverload;
206
- declare const normalize: DualFn<(<T extends AnyFloatVecInstance>(v: T) => T)>;
207
- declare function powCpu(base: number, exponent: number): number;
208
- declare function powCpu<T extends AnyFloatVecInstance>(base: T, exponent: T): T;
209
- declare const pow: DualFn<typeof powCpu>;
210
- declare function cpuQuantizeToF16(value: number): number;
211
- declare function cpuQuantizeToF16<T extends AnyFloat32VecInstance>(value: T): T;
212
- declare const quantizeToF16: DualFn<typeof cpuQuantizeToF16>;
213
- declare function cpuRadians(value: number): number;
214
- declare function cpuRadians<T extends AnyFloatVecInstance | number>(value: T): T;
215
- declare const radians: DualFn<typeof cpuRadians>;
216
- declare const reflect: DualFn<(<T extends AnyFloatVecInstance>(e1: T, e2: T) => T)>;
217
- declare const refract: DualFn<(<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: number) => T)>;
218
- declare function cpuReverseBits(value: number): number;
219
- declare function cpuReverseBits<T extends AnyIntegerVecInstance>(value: T): T;
220
- declare const reverseBits: DualFn<typeof cpuReverseBits>;
221
- declare function cpuRound(value: number): number;
222
- declare function cpuRound<T extends AnyFloatVecInstance>(value: T): T;
223
- declare const round: DualFn<typeof cpuRound>;
224
- declare function cpuSaturate(value: number): number;
225
- declare function cpuSaturate<T extends AnyFloatVecInstance>(value: T): T;
226
- declare const saturate: DualFn<typeof cpuSaturate>;
227
- declare function cpuSign(e: number): number;
228
- declare function cpuSign<T extends AnySignedVecInstance>(e: T): T;
229
- declare const sign: DualFn<typeof cpuSign>;
230
- declare function cpuSin(value: number): number;
231
- declare function cpuSin<T extends AnyFloatVecInstance>(value: T): T;
232
- declare const sin: DualFn<typeof cpuSin>;
233
- declare function cpuSinh(value: number): number;
234
- declare function cpuSinh<T extends AnyFloatVecInstance>(value: T): T;
235
- declare const sinh: DualFn<typeof cpuSinh>;
236
- declare function cpuSmoothstep(edge0: number, edge1: number, x: number): number;
237
- declare function cpuSmoothstep<T extends AnyFloatVecInstance>(edge0: T, edge1: T, x: T): T;
238
- declare const smoothstep: DualFn<typeof cpuSmoothstep>;
239
- declare function cpuSqrt(value: number): number;
240
- declare function cpuSqrt<T extends AnyFloatVecInstance>(value: T): T;
241
- declare const sqrt: DualFn<typeof cpuSqrt>;
242
- declare function cpuStep(edge: number, x: number): number;
243
- declare function cpuStep<T extends AnyFloatVecInstance | number>(edge: T, x: T): T;
244
- declare const step: DualFn<typeof cpuStep>;
245
- declare function cpuTan(value: number): number;
246
- declare function cpuTan<T extends AnyFloatVecInstance>(value: T): T;
247
- declare const tan: DualFn<typeof cpuTan>;
248
- declare function cpuTanh(value: number): number;
249
- declare function cpuTanh<T extends AnyFloatVecInstance>(value: T): T;
250
- declare const tanh: DualFn<typeof cpuTanh>;
251
- declare const transpose: DualFn<(<T extends AnyMatInstance>(e: T) => T)>;
252
- declare function cpuTrunc(value: number): number;
253
- declare function cpuTrunc<T extends AnyFloatVecInstance>(value: T): T;
254
- declare const trunc: DualFn<typeof cpuTrunc>;
255
-
256
- type NumVec = AnyNumericVecInstance;
257
- type Mat = AnyMatInstance;
258
- declare function cpuAdd(lhs: number, rhs: number): number;
259
- declare function cpuAdd<T extends NumVec>(lhs: number, rhs: T): T;
260
- declare function cpuAdd<T extends NumVec>(lhs: T, rhs: number): T;
261
- declare function cpuAdd<T extends NumVec | Mat>(lhs: T, rhs: T): T;
262
- declare function cpuAdd<Lhs extends number | NumVec | Mat, Rhs extends Lhs extends number ? number | NumVec : Lhs extends NumVec ? number | Lhs : Lhs extends Mat ? Lhs : never>(lhs: Lhs, rhs: Rhs): Lhs | Rhs;
263
- declare const add: DualFn<typeof cpuAdd>;
264
- declare function cpuSub(lhs: number, rhs: number): number;
265
- declare function cpuSub<T extends NumVec>(lhs: number, rhs: T): T;
266
- declare function cpuSub<T extends NumVec>(lhs: T, rhs: number): T;
267
- declare function cpuSub<T extends NumVec | Mat>(lhs: T, rhs: T): T;
268
- declare function cpuSub<Lhs extends number | NumVec | Mat, Rhs extends Lhs extends number ? number | NumVec : Lhs extends NumVec ? number | Lhs : Lhs extends Mat ? Lhs : never>(lhs: Lhs, rhs: Rhs): Lhs | Rhs;
269
- declare const sub: DualFn<typeof cpuSub>;
270
- declare function cpuMul(lhs: number, rhs: number): number;
271
- declare function cpuMul<MV extends NumVec | Mat>(lhs: number, rhs: MV): MV;
272
- declare function cpuMul<MV extends NumVec | Mat>(lhs: MV, rhs: number): MV;
273
- declare function cpuMul<V extends NumVec>(lhs: V, rhs: V): V;
274
- declare function cpuMul<M extends Mat, V extends vBaseForMat<M>>(lhs: V, rhs: M): V;
275
- declare function cpuMul<M extends Mat, V extends vBaseForMat<M>>(lhs: M, rhs: V): V;
276
- declare function cpuMul<M extends Mat>(lhs: M, rhs: M): M;
277
- declare function cpuMul<Lhs extends number | NumVec | Mat, Rhs extends Lhs extends number ? number | NumVec | Mat : Lhs extends NumVec ? number | Lhs | mBaseForVec<Lhs> : Lhs extends Mat ? number | vBaseForMat<Lhs> | Lhs : never>(lhs: Lhs, rhs: Rhs): Lhs | Rhs;
278
- declare const mul: DualFn<typeof cpuMul>;
279
- declare function cpuDiv(lhs: number, rhs: number): number;
280
- declare function cpuDiv<T extends NumVec>(lhs: T, rhs: T): T;
281
- declare function cpuDiv<T extends NumVec>(lhs: number, rhs: T): T;
282
- declare function cpuDiv<T extends NumVec>(lhs: T, rhs: number): T;
283
- declare const div: DualFn<typeof cpuDiv>;
284
- type ModOverload = {
285
- (a: number, b: number): number;
286
- <T extends NumVec>(a: T, b: T): T;
287
- <T extends NumVec>(a: number, b: T): T;
288
- <T extends NumVec>(a: T, b: number): T;
289
- };
290
- /**
291
- * @privateRemarks
292
- * Both JS and WGSL implementations use truncated definition of modulo
293
- */
294
- declare const mod: ModOverload;
295
- declare function cpuNeg(value: number): number;
296
- declare function cpuNeg<T extends NumVec>(value: T): T;
297
- declare const neg: DualFn<typeof cpuNeg>;
298
-
299
- /**
300
- * Translates the given 4-by-4 matrix by the given vector.
301
- * @param {m4x4f} matrix - The matrix to be modified.
302
- * @param {v3f} vector - The vector by which to translate the matrix.
303
- * @returns {m4x4f} The translated matrix.
304
- */
305
- declare const translate4: DualFn<(matrix: m4x4f, vector: v3f) => m4x4f>;
306
- /**
307
- * Scales the given 4-by-4 matrix in each dimension by an amount given by the corresponding entry in the given vector.
308
- * @param {m4x4f} matrix - The matrix to be modified.
309
- * @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.
310
- * @returns {m4x4f} The scaled matrix.
311
- */
312
- declare const scale4: DualFn<(matrix: m4x4f, vector: v3f) => m4x4f>;
313
- /**
314
- * Rotates the given 4-by-4 matrix around the x-axis by the given angle.
315
- * @param {m4x4f} matrix - The matrix to be modified.
316
- * @param {number} angle - The angle by which to rotate (in radians).
317
- * @returns {m4x4f} The rotated matrix.
318
- */
319
- declare const rotateX4: DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
320
- /**
321
- * Rotates the given 4-by-4 matrix around the y-axis by the given angle.
322
- * @param {m4x4f} matrix - The matrix to be modified.
323
- * @param {number} angle - The angle by which to rotate (in radians).
324
- * @returns {m4x4f} The rotated matrix.
325
- */
326
- declare const rotateY4: DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
327
- /**
328
- * Rotates the given 4-by-4 matrix around the z-axis by the given angle.
329
- * @param {m4x4f} matrix - The matrix to be modified.
330
- * @param {number} angle - The angle by which to rotate (in radians).
331
- * @returns {m4x4f} The rotated matrix.
332
- */
333
- declare const rotateZ4: DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
334
-
335
- /**
336
- * Checks whether `lhs == rhs` on all components.
337
- * Equivalent to `all(eq(lhs, rhs))`.
338
- * @example
339
- * allEq(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns false
340
- * allEq(vec3u(0, 1, 2), vec3u(0, 1, 2)) // returns true
341
- */
342
- declare const allEq: DualFn<(<T extends AnyVecInstance>(lhs: T, rhs: T) => boolean)>;
343
- /**
344
- * Checks **component-wise** whether `lhs == rhs`.
345
- * This function does **not** return `bool`, for that use-case, wrap the result in `all`, or use `allEq`.
346
- * @example
347
- * eq(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns vec2b(true, false)
348
- * eq(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, true, false)
349
- * all(eq(vec4i(4, 3, 2, 1), vec4i(4, 3, 2, 1))) // returns true
350
- * allEq(vec4i(4, 3, 2, 1), vec4i(4, 3, 2, 1)) // returns true
351
- */
352
- declare const eq: DualFn<(<T extends AnyVecInstance>(lhs: T, rhs: T) => T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)>;
353
- /**
354
- * Checks **component-wise** whether `lhs != rhs`.
355
- * This function does **not** return `bool`, for that use-case, wrap the result in `any`.
356
- * @example
357
- * ne(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns vec2b(false, true)
358
- * ne(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, false, true)
359
- * any(ne(vec4i(4, 3, 2, 1), vec4i(4, 2, 2, 1))) // returns true
360
- */
361
- declare const ne: DualFn<(<T extends AnyVecInstance>(lhs: T, rhs: T) => T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)>;
362
- /**
363
- * Checks **component-wise** whether `lhs < rhs`.
364
- * This function does **not** return `bool`, for that use-case, wrap the result in `all`.
365
- * @example
366
- * lt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, true)
367
- * lt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, false, false)
368
- * all(lt(vec4i(1, 2, 3, 4), vec4i(2, 3, 4, 5))) // returns true
369
- */
370
- declare const lt: DualFn<(<T extends AnyNumericVecInstance>(lhs: T, rhs: T) => T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)>;
371
- /**
372
- * Checks **component-wise** whether `lhs <= rhs`.
373
- * This function does **not** return `bool`, for that use-case, wrap the result in `all`.
374
- * @example
375
- * le(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(true, true)
376
- * le(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, true, false)
377
- * all(le(vec4i(1, 2, 3, 4), vec4i(2, 3, 3, 5))) // returns true
378
- */
379
- declare const le: DualFn<(<T extends AnyNumericVecInstance>(lhs: T, rhs: T) => T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)>;
380
- /**
381
- * Checks **component-wise** whether `lhs > rhs`.
382
- * This function does **not** return `bool`, for that use-case, wrap the result in `all`.
383
- * @example
384
- * gt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, false)
385
- * gt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, false, true)
386
- * all(gt(vec4i(2, 3, 4, 5), vec4i(1, 2, 3, 4))) // returns true
387
- */
388
- declare const gt: DualFn<(<T extends AnyNumericVecInstance>(lhs: T, rhs: T) => T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)>;
389
- /**
390
- * Checks **component-wise** whether `lhs >= rhs`.
391
- * This function does **not** return `bool`, for that use-case, wrap the result in `all`.
392
- * @example
393
- * ge(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(true, false)
394
- * ge(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, true, true)
395
- * all(ge(vec4i(2, 2, 4, 5), vec4i(1, 2, 3, 4))) // returns true
396
- */
397
- declare const ge: DualFn<(<T extends AnyNumericVecInstance>(lhs: T, rhs: T) => T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)>;
398
- /**
399
- * Returns **component-wise** `!value`.
400
- * @example
401
- * not(vec2b(false, true)) // returns vec2b(true, false)
402
- * not(vec3b(true, true, false)) // returns vec3b(false, false, true)
403
- */
404
- declare const not: DualFn<(<T extends AnyBooleanVecInstance>(value: T) => T)>;
405
- /**
406
- * Returns **component-wise** logical `or` result.
407
- * @example
408
- * or(vec2b(false, true), vec2b(false, false)) // returns vec2b(false, true)
409
- * or(vec3b(true, true, false), vec3b(false, true, false)) // returns vec3b(true, true, false)
410
- */
411
- declare const or: DualFn<(<T extends AnyBooleanVecInstance>(lhs: T, rhs: T) => T)>;
412
- /**
413
- * Returns **component-wise** logical `and` result.
414
- * @example
415
- * and(vec2b(false, true), vec2b(true, true)) // returns vec2b(false, true)
416
- * and(vec3b(true, true, false), vec3b(false, true, false)) // returns vec3b(false, true, false)
417
- */
418
- declare const and: DualFn<(<T extends AnyBooleanVecInstance>(lhs: T, rhs: T) => T)>;
419
- /**
420
- * Returns `true` if each component of `value` is true.
421
- * @example
422
- * all(vec2b(false, true)) // returns false
423
- * all(vec3b(true, true, true)) // returns true
424
- */
425
- declare const all: DualFn<(value: AnyBooleanVecInstance) => boolean>;
426
- /**
427
- * Returns `true` if any component of `value` is true.
428
- * @example
429
- * any(vec2b(false, true)) // returns true
430
- * any(vec3b(false, false, false)) // returns false
431
- */
432
- declare const any: DualFn<(value: AnyBooleanVecInstance) => boolean>;
433
- /**
434
- * Checks whether the given elements differ by at most the `precision` value.
435
- * Checks all elements of `lhs` and `rhs` if arguments are vectors.
436
- * @example
437
- * isCloseTo(0, 0.1) // returns false
438
- * isCloseTo(vec3f(0, 0, 0), vec3f(0.002, -0.009, 0)) // returns true
439
- *
440
- * @param {number} precision argument that specifies the maximum allowed difference, 0.01 by default.
441
- */
442
- declare const isCloseTo: DualFn<(<T extends AnyFloatVecInstance | number>(lhs: T, rhs: T, precision?: number) => boolean)>;
443
- declare function cpuSelect(f: boolean, t: boolean, cond: boolean): boolean;
444
- declare function cpuSelect(f: number, t: number, cond: boolean): number;
445
- declare function cpuSelect<T extends AnyVecInstance>(f: T, t: T, cond: boolean | (T extends AnyVec2Instance ? v2b : T extends AnyVec3Instance ? v3b : v4b)): T;
446
- /**
447
- * Returns `t` if `cond` is `true`, and `f` otherwise.
448
- * Component-wise if `cond` is a vector.
449
- * @example
450
- * select(1, 2, false) // returns 1
451
- * select(1, 2, true) // returns 2
452
- * select(vec2i(1, 2), vec2i(3, 4), true) // returns vec2i(3, 4)
453
- * select(vec2i(1, 2), vec2i(3, 4), vec2b(false, true)) // returns vec2i(1, 4)
454
- */
455
- declare const select: DualFn<typeof cpuSelect>;
456
-
457
- type AnyAtomic = atomicI32 | atomicU32;
458
- declare const workgroupBarrier: DualFn<(...args: never[]) => unknown>;
459
- declare const storageBarrier: DualFn<(...args: never[]) => unknown>;
460
- declare const textureBarrier: DualFn<(...args: never[]) => unknown>;
461
- declare const atomicLoad: DualFn<(<T extends AnyAtomic>(a: T) => number)>;
462
- declare const atomicStore: DualFn<(<T extends AnyAtomic>(a: T, value: number) => void)>;
463
- declare const atomicAdd: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
464
- declare const atomicSub: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
465
- declare const atomicMax: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
466
- declare const atomicMin: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
467
- declare const atomicAnd: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
468
- declare const atomicOr: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
469
- declare const atomicXor: DualFn<(<T extends AnyAtomic>(a: T, value: number) => number)>;
470
-
471
- type DerivativeSignature = ((value: number) => number) & (<T extends AnyFloat32VecInstance>(value: T) => T);
472
- declare const dpdx: DualFn<DerivativeSignature>;
473
- declare const dpdxCoarse: DualFn<DerivativeSignature>;
474
- declare const dpdxFine: DualFn<DerivativeSignature>;
475
- declare const dpdy: DualFn<DerivativeSignature>;
476
- declare const dpdyCoarse: DualFn<DerivativeSignature>;
477
- declare const dpdyFine: DualFn<DerivativeSignature>;
478
- declare const fwidth: DualFn<DerivativeSignature>;
479
- declare const fwidthCoarse: DualFn<DerivativeSignature>;
480
- declare const fwidthFine: DualFn<DerivativeSignature>;
481
-
482
- declare const arrayLength: DualFn<(a: unknown[] | ref<unknown[]>) => number>;
483
-
484
- /**
485
- * @privateRemarks
486
- * https://gpuweb.github.io/gpuweb/wgsl/#unpack2x16float-builtin
487
- */
488
- declare const unpack2x16float: DualFn<(e: number) => v2f>;
489
- /**
490
- * @privateRemarks
491
- * https://gpuweb.github.io/gpuweb/wgsl/#pack2x16float-builtin
492
- */
493
- declare const pack2x16float: DualFn<(e: v2f) => number>;
494
- /**
495
- * @privateRemarks
496
- * https://gpuweb.github.io/gpuweb/wgsl/#unpack4x8unorm-builtin
497
- */
498
- declare const unpack4x8unorm: DualFn<(e: number) => v4f>;
499
- /**
500
- * @privateRemarks
501
- * https://gpuweb.github.io/gpuweb/wgsl/#pack4x8unorm-builtin
502
- */
503
- declare const pack4x8unorm: DualFn<(e: v4f) => number>;
504
-
505
- declare function sampleCpu<T extends texture1d>(texture: T, sampler: sampler, coords: number): v4f;
506
- declare function sampleCpu<T extends texture2d>(texture: T, sampler: sampler, coords: v2f, offset?: v2i): v4f;
507
- declare function sampleCpu<T extends texture2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, offset?: v2i): v4f;
508
- declare function sampleCpu<T extends texture3d | textureCube>(texture: T, sampler: sampler, coords: v3f): v4f;
509
- declare function sampleCpu<T extends texture3d>(texture: T, sampler: sampler, coords: v3f, offset: v3i): v4f;
510
- declare function sampleCpu<T extends textureCubeArray>(texture: T, sampler: sampler, coords: v3f, arrayIndex: number): v4f;
511
- declare function sampleCpu<T extends textureDepth2d>(texture: T, sampler: sampler, coords: v2f, offset?: v2i): number;
512
- declare function sampleCpu<T extends textureDepth2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, offset?: v2i): number;
513
- declare function sampleCpu<T extends textureDepthCube>(texture: T, sampler: sampler, coords: v3f, arrayIndex?: number): number;
514
- declare const textureSample: DualFn<typeof sampleCpu>;
515
- declare function sampleBiasCpu<T extends texture1d>(texture: T, sampler: sampler, coords: number, bias: number): v4f;
516
- declare function sampleBiasCpu<T extends texture2d>(texture: T, sampler: sampler, coords: v2f, bias: number, offset?: v2i): v4f;
517
- declare function sampleBiasCpu<T extends texture2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, bias: number, offset?: v2i): v4f;
518
- declare function sampleBiasCpu<T extends texture3d | textureCube>(texture: T, sampler: sampler, coords: v3f, bias: number, offset?: v3i): v4f;
519
- declare function sampleBiasCpu<T extends textureCubeArray>(texture: T, sampler: sampler, coords: v3f, arrayIndex: number, bias: number): v4f;
520
- declare const textureSampleBias: DualFn<typeof sampleBiasCpu>;
521
- declare function sampleLevelCpu<T extends texture1d>(texture: T, sampler: sampler, coords: number, level: number): v4f;
522
- declare function sampleLevelCpu<T extends texture2d>(texture: T, sampler: sampler, coords: v2f, level: number): v4f;
523
- declare function sampleLevelCpu<T extends texture2d>(texture: T, sampler: sampler, coords: v2f, level: number, offset: v2i): v4f;
524
- declare function sampleLevelCpu<T extends texture2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, level: number): v4f;
525
- declare function sampleLevelCpu<T extends texture2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, level: number, offset: v2i): v4f;
526
- declare function sampleLevelCpu<T extends texture3d | textureCube>(texture: T, sampler: sampler, coords: v3f, level: number): v4f;
527
- declare function sampleLevelCpu<T extends texture3d>(texture: T, sampler: sampler, coords: v3f, level: number, offset: v3i): v4f;
528
- declare function sampleLevelCpu<T extends textureCubeArray>(texture: T, sampler: sampler, coords: v3f, arrayIndex: number, level: number): v4f;
529
- declare function sampleLevelCpu<T extends textureDepth2d>(texture: T, sampler: sampler, coords: v2f, level: number): number;
530
- declare function sampleLevelCpu<T extends textureDepth2d>(texture: T, sampler: sampler, coords: v2f, level: number, offset: v2i): number;
531
- declare function sampleLevelCpu<T extends textureDepth2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, level: number): number;
532
- declare function sampleLevelCpu<T extends textureDepth2dArray>(texture: T, sampler: sampler, coords: v2f, arrayIndex: number, level: number, offset: v2i): number;
533
- declare function sampleLevelCpu<T extends textureDepthCube>(texture: T, sampler: sampler, coords: v3f, level: number): number;
534
- declare function sampleLevelCpu<T extends textureCubeArray>(texture: T, sampler: sampler, coords: v3f, arrayIndex: number, level: number): number;
535
- declare const textureSampleLevel: DualFn<typeof sampleLevelCpu>;
536
- type PrimitiveToLoadedType = {
537
- f32: v4f;
538
- i32: v4i;
539
- u32: v4u;
540
- };
541
- type TexelFormatToInstanceType<T extends StorageTextureFormats> = TextureFormats[T]['vectorType'][typeof $repr];
542
- declare function textureLoadCpu<T extends texture1d>(texture: T, coords: number, level: number): PrimitiveToLoadedType[T[typeof $internal]['type']];
543
- declare function textureLoadCpu<T extends texture2d>(texture: T, coords: v2i | v2u, level: number): PrimitiveToLoadedType[T[typeof $internal]['type']];
544
- declare function textureLoadCpu<T extends texture2dArray>(texture: T, coords: v2i | v2u, arrayIndex: number, level: number): PrimitiveToLoadedType[T[typeof $internal]['type']];
545
- declare function textureLoadCpu<T extends texture3d>(texture: T, coords: v3i | v3u, level: number): PrimitiveToLoadedType[T[typeof $internal]['type']];
546
- declare function textureLoadCpu<T extends textureMultisampled2d>(texture: T, coords: v2i | v2u, sampleIndex: number): PrimitiveToLoadedType[T[typeof $internal]['type']];
547
- declare function textureLoadCpu<T extends textureStorage1d>(texture: T, coords: number): TexelFormatToInstanceType<T[typeof $internal][0]>;
548
- declare function textureLoadCpu<T extends textureStorage2d>(texture: T, coords: v2i | v2u): TexelFormatToInstanceType<T[typeof $internal][0]>;
549
- declare function textureLoadCpu<T extends textureStorage2dArray>(texture: T, coords: v2i | v2u, arrayIndex: number): TexelFormatToInstanceType<T[typeof $internal][0]>;
550
- declare function textureLoadCpu<T extends textureStorage3d>(texture: T, coords: v3i | v3u): TexelFormatToInstanceType<T[typeof $internal][0]>;
551
- declare const textureLoad: DualFn<typeof textureLoadCpu>;
552
- declare function textureStoreCpu<T extends textureStorage1d>(texture: T, coords: number, value: TexelFormatToInstanceType<T[typeof $internal][0]>): void;
553
- declare function textureStoreCpu<T extends textureStorage2d>(texture: T, coords: v2i | v2u, value: TexelFormatToInstanceType<T[typeof $internal][0]>): void;
554
- declare function textureStoreCpu<T extends textureStorage2dArray>(texture: T, coords: v2i | v2u, arrayIndex: number, value: TexelFormatToInstanceType<T[typeof $internal][0]>): void;
555
- declare function textureStoreCpu<T extends textureStorage3d>(texture: T, coords: v3i | v3u, value: TexelFormatToInstanceType<T[typeof $internal][0]>): void;
556
- declare const textureStore: DualFn<typeof textureStoreCpu>;
557
- declare function textureDimensionsCpu<T extends texture1d | textureStorage1d>(texture: T): number;
558
- declare function textureDimensionsCpu<T extends texture1d>(texture: T, level: number): number;
559
- declare function textureDimensionsCpu<T extends texture2d | texture2dArray | textureCube | textureCubeArray | textureStorage2d | textureStorage2dArray | textureExternal>(texture: T): v2u;
560
- declare function textureDimensionsCpu<T extends texture2d | texture2dArray | textureCube | textureCubeArray>(texture: T, level: number): v2u;
561
- declare function textureDimensionsCpu<T extends texture3d | textureStorage3d>(texture: T): v3u;
562
- declare function textureDimensionsCpu<T extends texture3d>(texture: T, level: number): v3u;
563
- declare const textureDimensions: DualFn<typeof textureDimensionsCpu>;
564
- declare function textureSampleCompareCpu<T extends textureDepth2d>(texture: T, sampler: comparisonSampler, coords: v2f, depthRef: number): number;
565
- declare function textureSampleCompareCpu<T extends textureDepth2d>(texture: T, sampler: comparisonSampler, coords: v2f, depthRef: number, offset: v2i): number;
566
- declare function textureSampleCompareCpu<T extends textureDepth2dArray>(texture: T, sampler: comparisonSampler, coords: v2f, arrayIndex: number, depthRef: number): number;
567
- declare function textureSampleCompareCpu<T extends textureDepth2dArray>(texture: T, sampler: comparisonSampler, coords: v2f, arrayIndex: number, depthRef: number, offset: v2i): number;
568
- declare function textureSampleCompareCpu<T extends textureDepthCube>(texture: T, sampler: comparisonSampler, coords: v3f, depthRef: number): number;
569
- declare function textureSampleCompareCpu<T extends textureCubeArray>(texture: T, sampler: comparisonSampler, coords: v3f, arrayIndex: number, depthRef: number): number;
570
- declare const textureSampleCompare: DualFn<typeof textureSampleCompareCpu>;
571
- declare function textureSampleBaseClampToEdgeCpu<T extends texture2d | textureExternal>(texture: T, sampler: sampler, coords: v2f): v4f;
572
- declare const textureSampleBaseClampToEdge: DualFn<typeof textureSampleBaseClampToEdgeCpu>;
573
-
574
- interface IdentityNumOrVec {
575
- (e: number): number;
576
- <T extends AnyNumericVecInstance>(e: T): T;
577
- }
578
- interface IdentityIntNumOrVec {
579
- (e: number): number;
580
- <T extends AnyIntegerVecInstance>(e: T): T;
581
- }
582
- interface IdentityNumOrVecWithIdx {
583
- (e: number, index: number): number;
584
- <T extends AnyNumericVecInstance>(e: T, index: number): T;
585
- }
586
- interface IdentityNumOrVecWithDelta {
587
- (e: number, delta: number): number;
588
- <T extends AnyNumericVecInstance>(e: T, delta: number): T;
3
+ //#region src/std/index.d.ts
4
+ declare namespace index_d_exports {
5
+ export { abs, acos, acosh, add, all, allEq, and, any, arrayLength, asin, asinh, atan, atan2, atanh, atomicAdd, atomicAnd, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, bitcastU32toF32, bitcastU32toI32, ceil, clamp, cos, cosh, countLeadingZeros, countOneBits, countTrailingZeros, cross, degrees, determinant, discard, distance, div, dot, dot4I8Packed, dot4U8Packed, dpdx, dpdxCoarse, dpdxFine, dpdy, dpdyCoarse, dpdyFine, eq, exp, exp2, extensionEnabled, extractBits, faceForward, firstLeadingBit, firstTrailingBit, floor, fma, fract, frexp, fwidth, fwidthCoarse, fwidthFine, ge, gt, identity2, identity3, identity4, insertBits, inverseSqrt, isCloseTo, ldexp, le, length, log, log2, lt, max, min, mix, mod, modf, mul, ne, neg, normalize, not, or, pack2x16float, pack4x8unorm, pow, quantizeToF16, radians, reflect, refract, reverseBits, rotateX4, rotateY4, rotateZ4, rotationX4, rotationY4, rotationZ4, round, saturate, scale4, scaling4, select, sign, sin, sinh, smoothstep, sqrt, step, storageBarrier, sub, subgroupAdd, subgroupAll, subgroupAnd, subgroupAny, subgroupBallot, subgroupBroadcast, subgroupBroadcastFirst, subgroupElect, subgroupExclusiveAdd, subgroupExclusiveMul, subgroupInclusiveAdd, subgroupInclusiveMul, subgroupMax, subgroupMin, subgroupMul, subgroupOr, subgroupShuffle, subgroupShuffleDown, subgroupShuffleUp, subgroupShuffleXor, subgroupXor, tan, tanh, textureBarrier, textureDimensions, textureGather, textureLoad, textureSample, textureSampleBaseClampToEdge, textureSampleBias, textureSampleCompare, textureSampleCompareLevel, textureSampleLevel, textureStore, translate4, translation4, transpose, trunc, unpack2x16float, unpack4x8unorm, workgroupBarrier };
589
6
  }
590
- interface IdentityNumOrVecWithMask {
591
- (e: number, mask: number): number;
592
- <T extends AnyNumericVecInstance>(e: T, mask: number): T;
593
- }
594
- declare const subgroupAdd: DualFn<IdentityNumOrVec>;
595
- declare const subgroupExclusiveAdd: DualFn<IdentityNumOrVec>;
596
- declare const subgroupInclusiveAdd: DualFn<IdentityNumOrVec>;
597
- declare const subgroupAll: DualFn<(e: boolean) => boolean>;
598
- declare const subgroupAnd: DualFn<IdentityIntNumOrVec>;
599
- declare const subgroupAny: DualFn<(e: boolean) => boolean>;
600
- declare const subgroupBallot: DualFn<(e: boolean) => v4u>;
601
- declare const subgroupBroadcast: DualFn<IdentityNumOrVecWithIdx>;
602
- declare const subgroupBroadcastFirst: DualFn<IdentityNumOrVec>;
603
- declare const subgroupElect: DualFn<() => boolean>;
604
- declare const subgroupMax: DualFn<IdentityNumOrVec>;
605
- declare const subgroupMin: DualFn<IdentityNumOrVec>;
606
- declare const subgroupMul: DualFn<IdentityNumOrVec>;
607
- declare const subgroupExclusiveMul: DualFn<IdentityNumOrVec>;
608
- declare const subgroupInclusiveMul: DualFn<IdentityNumOrVec>;
609
- declare const subgroupOr: DualFn<IdentityIntNumOrVec>;
610
- declare const subgroupShuffle: DualFn<IdentityNumOrVecWithIdx>;
611
- declare const subgroupShuffleDown: DualFn<IdentityNumOrVecWithDelta>;
612
- declare const subgroupShuffleUp: DualFn<IdentityNumOrVecWithDelta>;
613
- declare const subgroupShuffleXor: DualFn<IdentityNumOrVecWithMask>;
614
- declare const subgroupXor: DualFn<IdentityIntNumOrVec>;
615
-
616
- declare const extensionEnabled: TgpuComptime<(extensionName: WgslExtension) => boolean>;
617
-
618
- type BitcastU32toF32Overload = ((value: number) => number) & ((value: v2u) => v2f) & ((value: v3u) => v3f) & ((value: v4u) => v4f);
619
- declare const bitcastU32toF32: DualFn<BitcastU32toF32Overload>;
620
- type BitcastU32toI32Overload = ((value: number) => number) & ((value: v2u) => v2i) & ((value: v3u) => v3i) & ((value: v4u) => v4i);
621
- declare const bitcastU32toI32: DualFn<BitcastU32toI32Overload>;
622
-
623
- export { abs, acos, acosh, add, all, allEq, and, any, arrayLength, asin, asinh, atan, atan2, atanh, atomicAdd, atomicAnd, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, bitcastU32toF32, bitcastU32toI32, ceil, clamp, cos, cosh, countLeadingZeros, countOneBits, countTrailingZeros, cross, degrees, determinant, discard, distance, div, dot, dot4I8Packed, dot4U8Packed, dpdx, dpdxCoarse, dpdxFine, dpdy, dpdyCoarse, dpdyFine, eq, exp, exp2, extensionEnabled, extractBits, faceForward, firstLeadingBit, firstTrailingBit, floor, fma, fract, frexp, fwidth, fwidthCoarse, fwidthFine, ge, gt, insertBits, inverseSqrt, isCloseTo, ldexp, le, length, log, log2, lt, max, min, mix, mod, modf, mul, ne, neg, normalize, not, or, pack2x16float, pack4x8unorm, pow, quantizeToF16, radians, reflect, refract, reverseBits, rotateX4, rotateY4, rotateZ4, round, saturate, scale4, select, sign, sin, sinh, smoothstep, sqrt, step, storageBarrier, sub, subgroupAdd, subgroupAll, subgroupAnd, subgroupAny, subgroupBallot, subgroupBroadcast, subgroupBroadcastFirst, subgroupElect, subgroupExclusiveAdd, subgroupExclusiveMul, subgroupInclusiveAdd, subgroupInclusiveMul, subgroupMax, subgroupMin, subgroupMul, subgroupOr, subgroupShuffle, subgroupShuffleDown, subgroupShuffleUp, subgroupShuffleXor, subgroupXor, tan, tanh, textureBarrier, textureDimensions, textureLoad, textureSample, textureSampleBaseClampToEdge, textureSampleBias, textureSampleCompare, textureSampleLevel, textureStore, translate4, transpose, trunc, unpack2x16float, unpack4x8unorm, workgroupBarrier };
7
+ //#endregion
8
+ export { abs, acos, acosh, add, all, allEq, and, any, arrayLength, asin, asinh, atan, atan2, atanh, atomicAdd, atomicAnd, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, bitcastU32toF32, bitcastU32toI32, ceil, clamp, cos, cosh, countLeadingZeros, countOneBits, countTrailingZeros, cross, degrees, determinant, discard, distance, div, dot, dot4I8Packed, dot4U8Packed, dpdx, dpdxCoarse, dpdxFine, dpdy, dpdyCoarse, dpdyFine, eq, exp, exp2, extensionEnabled, extractBits, faceForward, firstLeadingBit, firstTrailingBit, floor, fma, fract, frexp, fwidth, fwidthCoarse, fwidthFine, ge, gt, identity2, identity3, identity4, insertBits, inverseSqrt, isCloseTo, ldexp, le, length, log, log2, lt, max, min, mix, mod, modf, mul, ne, neg, normalize, not, or, pack2x16float, pack4x8unorm, pow, quantizeToF16, radians, reflect, refract, reverseBits, rotateX4, rotateY4, rotateZ4, rotationX4, rotationY4, rotationZ4, round, saturate, scale4, scaling4, select, sign, sin, sinh, smoothstep, sqrt, step, storageBarrier, sub, subgroupAdd, subgroupAll, subgroupAnd, subgroupAny, subgroupBallot, subgroupBroadcast, subgroupBroadcastFirst, subgroupElect, subgroupExclusiveAdd, subgroupExclusiveMul, subgroupInclusiveAdd, subgroupInclusiveMul, subgroupMax, subgroupMin, subgroupMul, subgroupOr, subgroupShuffle, subgroupShuffleDown, subgroupShuffleUp, subgroupShuffleXor, subgroupXor, index_d_exports as t, tan, tanh, textureBarrier, textureDimensions, textureGather, textureLoad, textureSample, textureSampleBaseClampToEdge, textureSampleBias, textureSampleCompare, textureSampleCompareLevel, textureSampleLevel, textureStore, translate4, translation4, transpose, trunc, unpack2x16float, unpack4x8unorm, workgroupBarrier };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/std/index.ts"],"mappings":""}