typegpu 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/chunk-47YH5LQ7.cjs +4 -0
- package/chunk-47YH5LQ7.cjs.map +1 -0
- package/chunk-BGPVBIFN.js +4 -0
- package/chunk-BGPVBIFN.js.map +1 -0
- package/chunk-MCUGRE3S.js +2 -0
- package/chunk-MCUGRE3S.js.map +1 -0
- package/chunk-OHFPIYFY.cjs +2 -0
- package/chunk-OHFPIYFY.cjs.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.d.cts +2 -329
- package/data/index.d.ts +2 -329
- package/data/index.js +1 -1
- package/index-BM7ZTN7E.d.ts +749 -0
- package/index-CopjPGJg.d.cts +749 -0
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +1147 -10
- package/index.d.ts +1147 -10
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/package.json +1 -7
- package/std/index.cjs +2 -0
- package/std/index.cjs.map +1 -0
- package/std/index.d.cts +59 -0
- package/std/index.d.ts +59 -0
- package/std/index.js +2 -0
- package/std/index.js.map +1 -0
- package/vector-BSez01sn.d.cts +961 -0
- package/vector-BSez01sn.d.ts +961 -0
- package/chunk-5DF7EEAZ.cjs +0 -4
- package/chunk-5DF7EEAZ.cjs.map +0 -1
- package/chunk-PN2EAL4B.js +0 -4
- package/chunk-PN2EAL4B.js.map +0 -1
- package/wgslTypes-BsqIvRBG.d.cts +0 -1814
- package/wgslTypes-BsqIvRBG.d.ts +0 -1814
@@ -0,0 +1,961 @@
|
|
1
|
+
/**
|
2
|
+
* Extracts the inferred representation of a resource.
|
3
|
+
* @example
|
4
|
+
* type A = Infer<F32> // => number
|
5
|
+
* type B = Infer<TgpuArray<F32>> // => number[]
|
6
|
+
*/
|
7
|
+
type Infer<T> = T extends {
|
8
|
+
readonly '~repr': infer TRepr;
|
9
|
+
} ? TRepr : T;
|
10
|
+
type InferRecord<T extends Record<string | number | symbol, unknown>> = {
|
11
|
+
[Key in keyof T]: Infer<T[Key]>;
|
12
|
+
};
|
13
|
+
|
14
|
+
interface NumberArrayView {
|
15
|
+
readonly length: number;
|
16
|
+
[n: number]: number;
|
17
|
+
}
|
18
|
+
interface BaseWgslData {
|
19
|
+
type: string;
|
20
|
+
/** Type-token, not available at runtime */
|
21
|
+
readonly '~repr': unknown;
|
22
|
+
}
|
23
|
+
interface Swizzle2<T2, T3, T4> {
|
24
|
+
readonly xx: T2;
|
25
|
+
readonly xy: T2;
|
26
|
+
readonly yx: T2;
|
27
|
+
readonly yy: T2;
|
28
|
+
readonly xxx: T3;
|
29
|
+
readonly xxy: T3;
|
30
|
+
readonly xyx: T3;
|
31
|
+
readonly xyy: T3;
|
32
|
+
readonly yxx: T3;
|
33
|
+
readonly yxy: T3;
|
34
|
+
readonly yyx: T3;
|
35
|
+
readonly yyy: T3;
|
36
|
+
readonly xxxx: T4;
|
37
|
+
readonly xxxy: T4;
|
38
|
+
readonly xxyx: T4;
|
39
|
+
readonly xxyy: T4;
|
40
|
+
readonly xyxx: T4;
|
41
|
+
readonly xyxy: T4;
|
42
|
+
readonly xyyx: T4;
|
43
|
+
readonly xyyy: T4;
|
44
|
+
readonly yxxx: T4;
|
45
|
+
readonly yxxy: T4;
|
46
|
+
readonly yxyx: T4;
|
47
|
+
readonly yxyy: T4;
|
48
|
+
readonly yyxx: T4;
|
49
|
+
readonly yyxy: T4;
|
50
|
+
readonly yyyx: T4;
|
51
|
+
readonly yyyy: T4;
|
52
|
+
}
|
53
|
+
interface Swizzle3<T2, T3, T4> extends Swizzle2<T2, T3, T4> {
|
54
|
+
readonly xz: T2;
|
55
|
+
readonly yz: T2;
|
56
|
+
readonly zx: T2;
|
57
|
+
readonly zy: T2;
|
58
|
+
readonly zz: T2;
|
59
|
+
readonly xxz: T3;
|
60
|
+
readonly xyz: T3;
|
61
|
+
readonly xzx: T3;
|
62
|
+
readonly xzy: T3;
|
63
|
+
readonly xzz: T3;
|
64
|
+
readonly yxz: T3;
|
65
|
+
readonly yyz: T3;
|
66
|
+
readonly yzx: T3;
|
67
|
+
readonly yzy: T3;
|
68
|
+
readonly yzz: T3;
|
69
|
+
readonly zxx: T3;
|
70
|
+
readonly zxy: T3;
|
71
|
+
readonly zxz: T3;
|
72
|
+
readonly zyx: T3;
|
73
|
+
readonly zyy: T3;
|
74
|
+
readonly zyz: T3;
|
75
|
+
readonly zzx: T3;
|
76
|
+
readonly zzy: T3;
|
77
|
+
readonly zzz: T3;
|
78
|
+
readonly xxxz: T4;
|
79
|
+
readonly xxyz: T4;
|
80
|
+
readonly xxzx: T4;
|
81
|
+
readonly xxzy: T4;
|
82
|
+
readonly xxzz: T4;
|
83
|
+
readonly xyxz: T4;
|
84
|
+
readonly xyyz: T4;
|
85
|
+
readonly xyzx: T4;
|
86
|
+
readonly xyzy: T4;
|
87
|
+
readonly xyzz: T4;
|
88
|
+
readonly xzxx: T4;
|
89
|
+
readonly xzxy: T4;
|
90
|
+
readonly xzxz: T4;
|
91
|
+
readonly xzyx: T4;
|
92
|
+
readonly xzyy: T4;
|
93
|
+
readonly xzyz: T4;
|
94
|
+
readonly xzzx: T4;
|
95
|
+
readonly xzzy: T4;
|
96
|
+
readonly xzzz: T4;
|
97
|
+
readonly yxxz: T4;
|
98
|
+
readonly yxyz: T4;
|
99
|
+
readonly yxzx: T4;
|
100
|
+
readonly yxzy: T4;
|
101
|
+
readonly yxzz: T4;
|
102
|
+
readonly yyxz: T4;
|
103
|
+
readonly yyyz: T4;
|
104
|
+
readonly yyzx: T4;
|
105
|
+
readonly yyzy: T4;
|
106
|
+
readonly yyzz: T4;
|
107
|
+
readonly yzxx: T4;
|
108
|
+
readonly yzxy: T4;
|
109
|
+
readonly yzxz: T4;
|
110
|
+
readonly yzyx: T4;
|
111
|
+
readonly yzyy: T4;
|
112
|
+
readonly yzyz: T4;
|
113
|
+
readonly yzzx: T4;
|
114
|
+
readonly yzzy: T4;
|
115
|
+
readonly yzzz: T4;
|
116
|
+
readonly zxxx: T4;
|
117
|
+
readonly zxxy: T4;
|
118
|
+
readonly zxxz: T4;
|
119
|
+
readonly zxyx: T4;
|
120
|
+
readonly zxyy: T4;
|
121
|
+
readonly zxyz: T4;
|
122
|
+
readonly zxzx: T4;
|
123
|
+
readonly zxzy: T4;
|
124
|
+
readonly zxzz: T4;
|
125
|
+
readonly zyxx: T4;
|
126
|
+
readonly zyxy: T4;
|
127
|
+
readonly zyxz: T4;
|
128
|
+
readonly zyyx: T4;
|
129
|
+
readonly zyyy: T4;
|
130
|
+
readonly zyyz: T4;
|
131
|
+
readonly zyzx: T4;
|
132
|
+
readonly zyzy: T4;
|
133
|
+
readonly zyzz: T4;
|
134
|
+
readonly zzxx: T4;
|
135
|
+
readonly zzxy: T4;
|
136
|
+
readonly zzxz: T4;
|
137
|
+
readonly zzyx: T4;
|
138
|
+
readonly zzyy: T4;
|
139
|
+
readonly zzyz: T4;
|
140
|
+
readonly zzzx: T4;
|
141
|
+
readonly zzzy: T4;
|
142
|
+
readonly zzzz: T4;
|
143
|
+
}
|
144
|
+
interface Swizzle4<T2, T3, T4> extends Swizzle3<T2, T3, T4> {
|
145
|
+
readonly yw: T2;
|
146
|
+
readonly zw: T2;
|
147
|
+
readonly wx: T2;
|
148
|
+
readonly wy: T2;
|
149
|
+
readonly wz: T2;
|
150
|
+
readonly ww: T2;
|
151
|
+
readonly xxw: T3;
|
152
|
+
readonly xyw: T3;
|
153
|
+
readonly xzw: T3;
|
154
|
+
readonly xwx: T3;
|
155
|
+
readonly xwy: T3;
|
156
|
+
readonly xwz: T3;
|
157
|
+
readonly xww: T3;
|
158
|
+
readonly yxw: T3;
|
159
|
+
readonly yyw: T3;
|
160
|
+
readonly yzw: T3;
|
161
|
+
readonly ywx: T3;
|
162
|
+
readonly ywy: T3;
|
163
|
+
readonly ywz: T3;
|
164
|
+
readonly yww: T3;
|
165
|
+
readonly zxw: T3;
|
166
|
+
readonly zyw: T3;
|
167
|
+
readonly zzw: T3;
|
168
|
+
readonly zwx: T3;
|
169
|
+
readonly zwy: T3;
|
170
|
+
readonly zwz: T3;
|
171
|
+
readonly zww: T3;
|
172
|
+
readonly wxx: T3;
|
173
|
+
readonly wxz: T3;
|
174
|
+
readonly wxy: T3;
|
175
|
+
readonly wyy: T3;
|
176
|
+
readonly wyz: T3;
|
177
|
+
readonly wzz: T3;
|
178
|
+
readonly wwx: T3;
|
179
|
+
readonly wwy: T3;
|
180
|
+
readonly wwz: T3;
|
181
|
+
readonly www: T3;
|
182
|
+
readonly xxxw: T4;
|
183
|
+
readonly xxyw: T4;
|
184
|
+
readonly xxzw: T4;
|
185
|
+
readonly xxwx: T4;
|
186
|
+
readonly xxwy: T4;
|
187
|
+
readonly xxwz: T4;
|
188
|
+
readonly xxww: T4;
|
189
|
+
readonly xyxw: T4;
|
190
|
+
readonly xyyw: T4;
|
191
|
+
readonly xyzw: T4;
|
192
|
+
readonly xywx: T4;
|
193
|
+
readonly xywy: T4;
|
194
|
+
readonly xywz: T4;
|
195
|
+
readonly xyww: T4;
|
196
|
+
readonly xzxw: T4;
|
197
|
+
readonly xzyw: T4;
|
198
|
+
readonly xzzw: T4;
|
199
|
+
readonly xzwx: T4;
|
200
|
+
readonly xzwy: T4;
|
201
|
+
readonly xzwz: T4;
|
202
|
+
readonly xzww: T4;
|
203
|
+
readonly xwxx: T4;
|
204
|
+
readonly xwxy: T4;
|
205
|
+
readonly xwxz: T4;
|
206
|
+
readonly xwyy: T4;
|
207
|
+
readonly xwyz: T4;
|
208
|
+
readonly xwzz: T4;
|
209
|
+
readonly xwwx: T4;
|
210
|
+
readonly xwwy: T4;
|
211
|
+
readonly xwwz: T4;
|
212
|
+
readonly xwww: T4;
|
213
|
+
readonly yxxw: T4;
|
214
|
+
readonly yxyw: T4;
|
215
|
+
readonly yxzw: T4;
|
216
|
+
readonly yxwx: T4;
|
217
|
+
readonly yxwy: T4;
|
218
|
+
readonly yxwz: T4;
|
219
|
+
readonly yxww: T4;
|
220
|
+
readonly yyxw: T4;
|
221
|
+
readonly yyyw: T4;
|
222
|
+
readonly yyzw: T4;
|
223
|
+
readonly yywx: T4;
|
224
|
+
readonly yywy: T4;
|
225
|
+
readonly yywz: T4;
|
226
|
+
readonly yyww: T4;
|
227
|
+
readonly yzxw: T4;
|
228
|
+
readonly yzyw: T4;
|
229
|
+
readonly yzzw: T4;
|
230
|
+
readonly yzwx: T4;
|
231
|
+
readonly yzwy: T4;
|
232
|
+
readonly yzwz: T4;
|
233
|
+
readonly yzww: T4;
|
234
|
+
readonly ywxx: T4;
|
235
|
+
readonly ywxy: T4;
|
236
|
+
readonly ywxz: T4;
|
237
|
+
readonly ywxw: T4;
|
238
|
+
readonly ywyy: T4;
|
239
|
+
readonly ywyz: T4;
|
240
|
+
readonly ywzz: T4;
|
241
|
+
readonly ywwx: T4;
|
242
|
+
readonly ywwy: T4;
|
243
|
+
readonly ywwz: T4;
|
244
|
+
readonly ywww: T4;
|
245
|
+
readonly zxxw: T4;
|
246
|
+
readonly zxyw: T4;
|
247
|
+
readonly zxzw: T4;
|
248
|
+
readonly zxwx: T4;
|
249
|
+
readonly zxwy: T4;
|
250
|
+
readonly zxwz: T4;
|
251
|
+
readonly zxww: T4;
|
252
|
+
readonly zyxw: T4;
|
253
|
+
readonly zyyw: T4;
|
254
|
+
readonly zyzw: T4;
|
255
|
+
readonly zywx: T4;
|
256
|
+
readonly zywy: T4;
|
257
|
+
readonly zywz: T4;
|
258
|
+
readonly zyww: T4;
|
259
|
+
readonly zzxw: T4;
|
260
|
+
readonly zzyw: T4;
|
261
|
+
readonly zzzw: T4;
|
262
|
+
readonly zzwx: T4;
|
263
|
+
readonly zzwy: T4;
|
264
|
+
readonly zzwz: T4;
|
265
|
+
readonly zzww: T4;
|
266
|
+
readonly zwxx: T4;
|
267
|
+
readonly zwxy: T4;
|
268
|
+
readonly zwxz: T4;
|
269
|
+
readonly zwxw: T4;
|
270
|
+
readonly zwyy: T4;
|
271
|
+
readonly zwyz: T4;
|
272
|
+
readonly zwzz: T4;
|
273
|
+
readonly zwwx: T4;
|
274
|
+
readonly zwwy: T4;
|
275
|
+
readonly zwwz: T4;
|
276
|
+
readonly zwww: T4;
|
277
|
+
readonly wxxx: T4;
|
278
|
+
readonly wxxy: T4;
|
279
|
+
readonly wxxz: T4;
|
280
|
+
readonly wxxw: T4;
|
281
|
+
readonly wxyx: T4;
|
282
|
+
readonly wxyy: T4;
|
283
|
+
readonly wxyz: T4;
|
284
|
+
readonly wxyw: T4;
|
285
|
+
readonly wxzx: T4;
|
286
|
+
readonly wxzy: T4;
|
287
|
+
readonly wxzz: T4;
|
288
|
+
readonly wxzw: T4;
|
289
|
+
readonly wxwx: T4;
|
290
|
+
readonly wxwy: T4;
|
291
|
+
readonly wxwz: T4;
|
292
|
+
readonly wxww: T4;
|
293
|
+
readonly wyxx: T4;
|
294
|
+
readonly wyxy: T4;
|
295
|
+
readonly wyxz: T4;
|
296
|
+
readonly wyxw: T4;
|
297
|
+
readonly wyyy: T4;
|
298
|
+
readonly wyyz: T4;
|
299
|
+
readonly wyzw: T4;
|
300
|
+
readonly wywx: T4;
|
301
|
+
readonly wywy: T4;
|
302
|
+
readonly wywz: T4;
|
303
|
+
readonly wyww: T4;
|
304
|
+
readonly wzxx: T4;
|
305
|
+
readonly wzxy: T4;
|
306
|
+
readonly wzxz: T4;
|
307
|
+
readonly wzxw: T4;
|
308
|
+
readonly wzyy: T4;
|
309
|
+
readonly wzyz: T4;
|
310
|
+
readonly wzzy: T4;
|
311
|
+
readonly wzzw: T4;
|
312
|
+
readonly wzwx: T4;
|
313
|
+
readonly wzwy: T4;
|
314
|
+
readonly wzwz: T4;
|
315
|
+
readonly wzww: T4;
|
316
|
+
readonly wwxx: T4;
|
317
|
+
readonly wwxy: T4;
|
318
|
+
readonly wwxz: T4;
|
319
|
+
readonly wwxw: T4;
|
320
|
+
readonly wwyy: T4;
|
321
|
+
readonly wwyz: T4;
|
322
|
+
readonly wwzz: T4;
|
323
|
+
readonly wwwx: T4;
|
324
|
+
readonly wwwy: T4;
|
325
|
+
readonly wwwz: T4;
|
326
|
+
readonly wwww: T4;
|
327
|
+
}
|
328
|
+
/**
|
329
|
+
* Interface representing its WGSL vector type counterpart: vec2f or vec2<f32>.
|
330
|
+
* A vector with 2 elements of type f32
|
331
|
+
*/
|
332
|
+
interface v2f extends NumberArrayView, Swizzle2<v2f, v3f, v4f> {
|
333
|
+
/** use to distinguish between vectors of the same size on the type level */
|
334
|
+
readonly kind: 'vec2f';
|
335
|
+
x: number;
|
336
|
+
y: number;
|
337
|
+
}
|
338
|
+
/**
|
339
|
+
* Interface representing its WGSL vector type counterpart: vec2h or vec2<f16>.
|
340
|
+
* A vector with 2 elements of type f16
|
341
|
+
*/
|
342
|
+
interface v2h extends NumberArrayView, Swizzle2<v2h, v3h, v4h> {
|
343
|
+
/** use to distinguish between vectors of the same size on the type level */
|
344
|
+
readonly kind: 'vec2h';
|
345
|
+
x: number;
|
346
|
+
y: number;
|
347
|
+
}
|
348
|
+
/**
|
349
|
+
* Interface representing its WGSL vector type counterpart: vec2i or vec2<i32>.
|
350
|
+
* A vector with 2 elements of type i32
|
351
|
+
*/
|
352
|
+
interface v2i extends NumberArrayView, Swizzle2<v2i, v3i, v4i> {
|
353
|
+
/** use to distinguish between vectors of the same size on the type level */
|
354
|
+
readonly kind: 'vec2i';
|
355
|
+
x: number;
|
356
|
+
y: number;
|
357
|
+
}
|
358
|
+
/**
|
359
|
+
* Interface representing its WGSL vector type counterpart: vec2u or vec2<u32>.
|
360
|
+
* A vector with 2 elements of type u32
|
361
|
+
*/
|
362
|
+
interface v2u extends NumberArrayView, Swizzle2<v2u, v3u, v4u> {
|
363
|
+
/** use to distinguish between vectors of the same size on the type level */
|
364
|
+
readonly kind: 'vec2u';
|
365
|
+
x: number;
|
366
|
+
y: number;
|
367
|
+
}
|
368
|
+
/**
|
369
|
+
* Interface representing its WGSL vector type counterpart: vec3f or vec3<f32>.
|
370
|
+
* A vector with 3 elements of type f32
|
371
|
+
*/
|
372
|
+
interface v3f extends NumberArrayView, Swizzle3<v2f, v3f, v4f> {
|
373
|
+
/** use to distinguish between vectors of the same size on the type level */
|
374
|
+
readonly kind: 'vec3f';
|
375
|
+
x: number;
|
376
|
+
y: number;
|
377
|
+
z: number;
|
378
|
+
}
|
379
|
+
/**
|
380
|
+
* Interface representing its WGSL vector type counterpart: vec3h or vec3<f16>.
|
381
|
+
* A vector with 3 elements of type f16
|
382
|
+
*/
|
383
|
+
interface v3h extends NumberArrayView, Swizzle3<v2h, v3h, v4h> {
|
384
|
+
/** use to distinguish between vectors of the same size on the type level */
|
385
|
+
readonly kind: 'vec3h';
|
386
|
+
x: number;
|
387
|
+
y: number;
|
388
|
+
z: number;
|
389
|
+
}
|
390
|
+
/**
|
391
|
+
* Interface representing its WGSL vector type counterpart: vec3i or vec3<i32>.
|
392
|
+
* A vector with 3 elements of type i32
|
393
|
+
*/
|
394
|
+
interface v3i extends NumberArrayView, Swizzle3<v2i, v3i, v4i> {
|
395
|
+
/** use to distinguish between vectors of the same size on the type level */
|
396
|
+
readonly kind: 'vec3i';
|
397
|
+
x: number;
|
398
|
+
y: number;
|
399
|
+
z: number;
|
400
|
+
}
|
401
|
+
/**
|
402
|
+
* Interface representing its WGSL vector type counterpart: vec3u or vec3<u32>.
|
403
|
+
* A vector with 3 elements of type u32
|
404
|
+
*/
|
405
|
+
interface v3u extends NumberArrayView, Swizzle3<v2u, v3u, v4u> {
|
406
|
+
/** use to distinguish between vectors of the same size on the type level */
|
407
|
+
readonly kind: 'vec3u';
|
408
|
+
x: number;
|
409
|
+
y: number;
|
410
|
+
z: number;
|
411
|
+
}
|
412
|
+
/**
|
413
|
+
* Interface representing its WGSL vector type counterpart: vec4f or vec4<f32>.
|
414
|
+
* A vector with 4 elements of type f32
|
415
|
+
*/
|
416
|
+
interface v4f extends NumberArrayView, Swizzle4<v2f, v3f, v4f> {
|
417
|
+
/** use to distinguish between vectors of the same size on the type level */
|
418
|
+
readonly kind: 'vec4f';
|
419
|
+
x: number;
|
420
|
+
y: number;
|
421
|
+
z: number;
|
422
|
+
w: number;
|
423
|
+
}
|
424
|
+
/**
|
425
|
+
* Interface representing its WGSL vector type counterpart: vec4h or vec4<f16>.
|
426
|
+
* A vector with 4 elements of type f16
|
427
|
+
*/
|
428
|
+
interface v4h extends NumberArrayView, Swizzle4<v2h, v3h, v4h> {
|
429
|
+
/** use to distinguish between vectors of the same size on the type level */
|
430
|
+
readonly kind: 'vec4h';
|
431
|
+
x: number;
|
432
|
+
y: number;
|
433
|
+
z: number;
|
434
|
+
w: number;
|
435
|
+
}
|
436
|
+
/**
|
437
|
+
* Interface representing its WGSL vector type counterpart: vec4i or vec4<i32>.
|
438
|
+
* A vector with 4 elements of type i32
|
439
|
+
*/
|
440
|
+
interface v4i extends NumberArrayView, Swizzle4<v2i, v3i, v4i> {
|
441
|
+
/** use to distinguish between vectors of the same size on the type level */
|
442
|
+
readonly kind: 'vec4i';
|
443
|
+
x: number;
|
444
|
+
y: number;
|
445
|
+
z: number;
|
446
|
+
w: number;
|
447
|
+
}
|
448
|
+
/**
|
449
|
+
* Interface representing its WGSL vector type counterpart: vec4u or vec4<u32>.
|
450
|
+
* A vector with 4 elements of type u32
|
451
|
+
*/
|
452
|
+
interface v4u extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {
|
453
|
+
/** use to distinguish between vectors of the same size on the type level */
|
454
|
+
readonly kind: 'vec4u';
|
455
|
+
x: number;
|
456
|
+
y: number;
|
457
|
+
z: number;
|
458
|
+
w: number;
|
459
|
+
}
|
460
|
+
type AnyVecInstance = v2f | v2h | v2i | v2u | v3f | v3h | v3i | v3u | v4f | v4h | v4i | v4u;
|
461
|
+
interface matBase<TColumn> extends NumberArrayView {
|
462
|
+
readonly columns: readonly TColumn[];
|
463
|
+
}
|
464
|
+
/**
|
465
|
+
* Interface representing its WGSL matrix type counterpart: mat2x2
|
466
|
+
* A matrix with 2 rows and 2 columns, with elements of type `TColumn`
|
467
|
+
*/
|
468
|
+
interface mat2x2<TColumn> extends matBase<TColumn> {
|
469
|
+
readonly length: 4;
|
470
|
+
readonly kind: string;
|
471
|
+
[n: number]: number;
|
472
|
+
}
|
473
|
+
/**
|
474
|
+
* Interface representing its WGSL matrix type counterpart: mat2x2f or mat2x2<f32>
|
475
|
+
* A matrix with 2 rows and 2 columns, with elements of type d.f32
|
476
|
+
*/
|
477
|
+
interface m2x2f extends mat2x2<v2f> {
|
478
|
+
readonly kind: 'mat2x2f';
|
479
|
+
}
|
480
|
+
/**
|
481
|
+
* Interface representing its WGSL matrix type counterpart: mat3x3
|
482
|
+
* A matrix with 3 rows and 3 columns, with elements of type `TColumn`
|
483
|
+
*/
|
484
|
+
interface mat3x3<TColumn> extends matBase<TColumn> {
|
485
|
+
readonly length: 12;
|
486
|
+
readonly kind: string;
|
487
|
+
[n: number]: number;
|
488
|
+
}
|
489
|
+
/**
|
490
|
+
* Interface representing its WGSL matrix type counterpart: mat3x3f or mat3x3<f32>
|
491
|
+
* A matrix with 3 rows and 3 columns, with elements of type d.f32
|
492
|
+
*/
|
493
|
+
interface m3x3f extends mat3x3<v3f> {
|
494
|
+
readonly kind: 'mat3x3f';
|
495
|
+
}
|
496
|
+
/**
|
497
|
+
* Interface representing its WGSL matrix type counterpart: mat4x4
|
498
|
+
* A matrix with 4 rows and 4 columns, with elements of type `TColumn`
|
499
|
+
*/
|
500
|
+
interface mat4x4<TColumn> extends matBase<TColumn> {
|
501
|
+
readonly length: 16;
|
502
|
+
readonly kind: string;
|
503
|
+
[n: number]: number;
|
504
|
+
}
|
505
|
+
/**
|
506
|
+
* Interface representing its WGSL matrix type counterpart: mat4x4f or mat4x4<f32>
|
507
|
+
* A matrix with 4 rows and 4 columns, with elements of type d.f32
|
508
|
+
*/
|
509
|
+
interface m4x4f extends mat4x4<v4f> {
|
510
|
+
readonly kind: 'mat4x4f';
|
511
|
+
}
|
512
|
+
type AnyMatInstance = m2x2f | m3x3f | m4x4f;
|
513
|
+
/**
|
514
|
+
* Boolean schema representing a single WGSL bool value.
|
515
|
+
* Cannot be used inside buffers as it is not host-shareable.
|
516
|
+
*/
|
517
|
+
interface Bool {
|
518
|
+
readonly type: 'bool';
|
519
|
+
readonly '~repr': boolean;
|
520
|
+
}
|
521
|
+
interface F32 {
|
522
|
+
readonly type: 'f32';
|
523
|
+
/** Type-token, not available at runtime */
|
524
|
+
readonly '~repr': number;
|
525
|
+
}
|
526
|
+
interface F16 {
|
527
|
+
readonly type: 'f16';
|
528
|
+
/** Type-token, not available at runtime */
|
529
|
+
readonly '~repr': number;
|
530
|
+
}
|
531
|
+
interface I32 {
|
532
|
+
readonly type: 'i32';
|
533
|
+
/** Type-token, not available at runtime */
|
534
|
+
readonly '~repr': number;
|
535
|
+
}
|
536
|
+
interface U32 {
|
537
|
+
readonly type: 'u32';
|
538
|
+
/** Type-token, not available at runtime */
|
539
|
+
readonly '~repr': number;
|
540
|
+
}
|
541
|
+
interface Vec2f {
|
542
|
+
readonly type: 'vec2f';
|
543
|
+
/** Type-token, not available at runtime */
|
544
|
+
readonly '~repr': v2f;
|
545
|
+
}
|
546
|
+
interface Vec2h {
|
547
|
+
readonly type: 'vec2h';
|
548
|
+
/** Type-token, not available at runtime */
|
549
|
+
readonly '~repr': v2h;
|
550
|
+
}
|
551
|
+
interface Vec2i {
|
552
|
+
readonly type: 'vec2i';
|
553
|
+
/** Type-token, not available at runtime */
|
554
|
+
readonly '~repr': v2i;
|
555
|
+
}
|
556
|
+
interface Vec2u {
|
557
|
+
readonly type: 'vec2u';
|
558
|
+
/** Type-token, not available at runtime */
|
559
|
+
readonly '~repr': v2u;
|
560
|
+
}
|
561
|
+
interface Vec3f {
|
562
|
+
readonly type: 'vec3f';
|
563
|
+
/** Type-token, not available at runtime */
|
564
|
+
readonly '~repr': v3f;
|
565
|
+
}
|
566
|
+
interface Vec3h {
|
567
|
+
readonly type: 'vec3h';
|
568
|
+
/** Type-token, not available at runtime */
|
569
|
+
readonly '~repr': v3h;
|
570
|
+
}
|
571
|
+
interface Vec3i {
|
572
|
+
readonly type: 'vec3i';
|
573
|
+
/** Type-token, not available at runtime */
|
574
|
+
readonly '~repr': v3i;
|
575
|
+
}
|
576
|
+
interface Vec3u {
|
577
|
+
readonly type: 'vec3u';
|
578
|
+
/** Type-token, not available at runtime */
|
579
|
+
readonly '~repr': v3u;
|
580
|
+
}
|
581
|
+
interface Vec4f {
|
582
|
+
readonly type: 'vec4f';
|
583
|
+
/** Type-token, not available at runtime */
|
584
|
+
readonly '~repr': v4f;
|
585
|
+
}
|
586
|
+
interface Vec4h {
|
587
|
+
readonly type: 'vec4h';
|
588
|
+
/** Type-token, not available at runtime */
|
589
|
+
readonly '~repr': v4h;
|
590
|
+
}
|
591
|
+
interface Vec4i {
|
592
|
+
readonly type: 'vec4i';
|
593
|
+
/** Type-token, not available at runtime */
|
594
|
+
readonly '~repr': v4i;
|
595
|
+
}
|
596
|
+
interface Vec4u {
|
597
|
+
readonly type: 'vec4u';
|
598
|
+
/** Type-token, not available at runtime */
|
599
|
+
readonly '~repr': v4u;
|
600
|
+
}
|
601
|
+
interface Mat2x2f {
|
602
|
+
readonly type: 'mat2x2f';
|
603
|
+
/** Type-token, not available at runtime */
|
604
|
+
readonly '~repr': m2x2f;
|
605
|
+
}
|
606
|
+
interface Mat3x3f {
|
607
|
+
readonly type: 'mat3x3f';
|
608
|
+
/** Type-token, not available at runtime */
|
609
|
+
readonly '~repr': m3x3f;
|
610
|
+
}
|
611
|
+
interface Mat4x4f {
|
612
|
+
readonly type: 'mat4x4f';
|
613
|
+
/** Type-token, not available at runtime */
|
614
|
+
readonly '~repr': m4x4f;
|
615
|
+
}
|
616
|
+
interface WgslStruct<TProps extends Record<string, BaseWgslData> = Record<string, BaseWgslData>> {
|
617
|
+
readonly type: 'struct';
|
618
|
+
readonly label?: string | undefined;
|
619
|
+
readonly propTypes: TProps;
|
620
|
+
/** Type-token, not available at runtime */
|
621
|
+
readonly '~repr': InferRecord<TProps>;
|
622
|
+
}
|
623
|
+
interface WgslArray<TElement = BaseWgslData> {
|
624
|
+
readonly type: 'array';
|
625
|
+
readonly elementCount: number;
|
626
|
+
readonly elementType: TElement;
|
627
|
+
/** Type-token, not available at runtime */
|
628
|
+
readonly '~repr': Infer<TElement>[];
|
629
|
+
}
|
630
|
+
/**
|
631
|
+
* Schema representing the `atomic<...>` WGSL data type.
|
632
|
+
*/
|
633
|
+
interface Atomic<TInner extends U32 | I32 = U32 | I32> {
|
634
|
+
readonly type: 'atomic';
|
635
|
+
readonly inner: TInner;
|
636
|
+
/** Type-token, not available at runtime */
|
637
|
+
readonly '~repr': Infer<TInner>;
|
638
|
+
}
|
639
|
+
interface Align<T extends number> {
|
640
|
+
readonly type: '@align';
|
641
|
+
readonly value: T;
|
642
|
+
}
|
643
|
+
interface Size<T extends number> {
|
644
|
+
readonly type: '@size';
|
645
|
+
readonly value: T;
|
646
|
+
}
|
647
|
+
interface Location<T extends number> {
|
648
|
+
readonly type: '@location';
|
649
|
+
readonly value: T;
|
650
|
+
}
|
651
|
+
type PerspectiveOrLinearInterpolationType = `${'perspective' | 'linear'}${'' | ', center' | ', centroid' | ', sample'}`;
|
652
|
+
type FlatInterpolationType = `flat${'' | ', first' | ', either'}`;
|
653
|
+
type InterpolationType = PerspectiveOrLinearInterpolationType | FlatInterpolationType;
|
654
|
+
interface Interpolate<T extends InterpolationType> {
|
655
|
+
readonly type: '@interpolate';
|
656
|
+
readonly value: T;
|
657
|
+
}
|
658
|
+
interface Builtin<T extends string> {
|
659
|
+
readonly type: '@builtin';
|
660
|
+
readonly value: T;
|
661
|
+
}
|
662
|
+
interface Decorated<TInner extends BaseWgslData = BaseWgslData, TAttribs extends unknown[] = unknown[]> {
|
663
|
+
readonly type: 'decorated';
|
664
|
+
readonly inner: TInner;
|
665
|
+
readonly attribs: TAttribs;
|
666
|
+
/** Type-token, not available at runtime */
|
667
|
+
readonly '~repr': Infer<TInner>;
|
668
|
+
}
|
669
|
+
declare const wgslTypeLiterals: readonly ["bool", "f32", "f16", "i32", "u32", "vec2f", "vec2h", "vec2i", "vec2u", "vec3f", "vec3h", "vec3i", "vec3u", "vec4f", "vec4h", "vec4i", "vec4u", "mat2x2f", "mat3x3f", "mat4x4f", "struct", "array", "atomic", "decorated"];
|
670
|
+
type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];
|
671
|
+
type PerspectiveOrLinearInterpolatableData = F32 | F16 | Vec2f | Vec2h | Vec3f | Vec3h | Vec4f | Vec4h;
|
672
|
+
type FlatInterpolatableData = PerspectiveOrLinearInterpolatableData | I32 | U32 | Vec2i | Vec2u | Vec3i | Vec3u | Vec4i | Vec4u;
|
673
|
+
type AnyWgslData = Bool | F32 | F16 | I32 | U32 | Vec2f | Vec2h | Vec2i | Vec2u | Vec3f | Vec3h | Vec3i | Vec3u | Vec4f | Vec4h | Vec4i | Vec4u | Mat2x2f | Mat3x3f | Mat4x4f | WgslStruct | WgslArray | Atomic | Decorated;
|
674
|
+
declare function isWgslData(value: unknown): value is AnyWgslData;
|
675
|
+
/**
|
676
|
+
* Checks whether passed in value is an array schema,
|
677
|
+
* as opposed to, e.g., a disarray schema.
|
678
|
+
*
|
679
|
+
* Array schemas can be used to describe uniform and storage buffers,
|
680
|
+
* whereas disarray schemas cannot.
|
681
|
+
*
|
682
|
+
* @example
|
683
|
+
* isWgslArray(d.arrayOf(d.u32, 4)) // true
|
684
|
+
* isWgslArray(d.disarray(d.u32, 4)) // false
|
685
|
+
* isWgslArray(d.vec3f) // false
|
686
|
+
*/
|
687
|
+
declare function isWgslArray<T extends WgslArray>(schema: T | unknown): schema is T;
|
688
|
+
/**
|
689
|
+
* Checks whether passed in value is a struct schema,
|
690
|
+
* as opposed to, e.g., an unstruct schema.
|
691
|
+
*
|
692
|
+
* Struct schemas can be used to describe uniform and storage buffers,
|
693
|
+
* whereas unstruct schemas cannot.
|
694
|
+
*
|
695
|
+
* @example
|
696
|
+
* isWgslStruct(d.struct({ a: d.u32 })) // true
|
697
|
+
* isWgslStruct(d.unstruct({ a: d.u32 })) // false
|
698
|
+
* isWgslStruct(d.vec3f) // false
|
699
|
+
*/
|
700
|
+
declare function isWgslStruct<T extends WgslStruct>(schema: T | unknown): schema is T;
|
701
|
+
/**
|
702
|
+
* Checks whether the passed in value is an atomic schema.
|
703
|
+
*
|
704
|
+
* @example
|
705
|
+
* isAtomic(d.atomic(d.u32)) // true
|
706
|
+
* isAtomic(d.u32) // false
|
707
|
+
*/
|
708
|
+
declare function isAtomic<T extends Atomic<U32 | I32>>(schema: T | unknown): schema is T;
|
709
|
+
declare function isAlignAttrib<T extends Align<number>>(value: unknown | T): value is T;
|
710
|
+
declare function isSizeAttrib<T extends Size<number>>(value: unknown | T): value is T;
|
711
|
+
declare function isLocationAttrib<T extends Location<number>>(value: unknown | T): value is T;
|
712
|
+
declare function isInterpolateAttrib<T extends Interpolate<InterpolationType>>(value: unknown | T): value is T;
|
713
|
+
declare function isBuiltinAttrib<T extends Builtin<string>>(value: unknown | T): value is T;
|
714
|
+
declare function isDecorated<T extends Decorated>(value: unknown | T): value is T;
|
715
|
+
|
716
|
+
/**
|
717
|
+
* Type encompassing all available kinds of vector.
|
718
|
+
*/
|
719
|
+
type VecKind = 'vec2f' | 'vec2i' | 'vec2u' | 'vec2h' | 'vec3f' | 'vec3i' | 'vec3u' | 'vec3h' | 'vec4f' | 'vec4i' | 'vec4u' | 'vec4h';
|
720
|
+
/**
|
721
|
+
* Type of the `d.vec2f` object/function: vector data type schema/constructor
|
722
|
+
*/
|
723
|
+
type NativeVec2f = Vec2f & {
|
724
|
+
'~exotic': Vec2f;
|
725
|
+
} & ((x: number, y: number) => v2f) & ((xy: number) => v2f) & (() => v2f);
|
726
|
+
/**
|
727
|
+
*
|
728
|
+
* Schema representing vec2f - a vector with 2 elements of type f32.
|
729
|
+
* Also a constructor function for this vector value.
|
730
|
+
*
|
731
|
+
* @example
|
732
|
+
* const vector = d.vec2f(); // (0.0, 0.0)
|
733
|
+
* const vector = d.vec2f(1); // (1.0, 1.0)
|
734
|
+
* const vector = d.vec2f(0.5, 0.1); // (0.5, 0.1)
|
735
|
+
*
|
736
|
+
* @example
|
737
|
+
* const buffer = root.createBuffer(d.vec2f, d.vec2f(0, 1)); // buffer holding a d.vec2f value, with an initial value of vec2f(0, 1);
|
738
|
+
*/
|
739
|
+
declare const vec2f: NativeVec2f;
|
740
|
+
/**
|
741
|
+
* Type of the `d.vec2h` object/function: vector data type schema/constructor
|
742
|
+
*/
|
743
|
+
type NativeVec2h = Vec2h & {
|
744
|
+
'~exotic': Vec2h;
|
745
|
+
} & ((x: number, y: number) => v2h) & ((xy: number) => v2h) & (() => v2h);
|
746
|
+
/**
|
747
|
+
*
|
748
|
+
* Schema representing vec2h - a vector with 2 elements of type f16.
|
749
|
+
* Also a constructor function for this vector value.
|
750
|
+
*
|
751
|
+
* @example
|
752
|
+
* const vector = d.vec2h(); // (0.0, 0.0)
|
753
|
+
* const vector = d.vec2h(1); // (1.0, 1.0)
|
754
|
+
* const vector = d.vec2h(0.5, 0.1); // (0.5, 0.1)
|
755
|
+
*
|
756
|
+
* @example
|
757
|
+
* const buffer = root.createBuffer(d.vec2h, d.vec2h(0, 1)); // buffer holding a d.vec2h value, with an initial value of vec2h(0, 1);
|
758
|
+
*/
|
759
|
+
declare const vec2h: NativeVec2h;
|
760
|
+
/**
|
761
|
+
* Type of the `d.vec2i` object/function: vector data type schema/constructor
|
762
|
+
*/
|
763
|
+
type NativeVec2i = Vec2i & {
|
764
|
+
'~exotic': Vec2i;
|
765
|
+
} & ((x: number, y: number) => v2i) & ((xy: number) => v2i) & (() => v2i);
|
766
|
+
/**
|
767
|
+
*
|
768
|
+
* Schema representing vec2i - a vector with 2 elements of type i32.
|
769
|
+
* Also a constructor function for this vector value.
|
770
|
+
*
|
771
|
+
* @example
|
772
|
+
* const vector = d.vec2i(); // (0, 0)
|
773
|
+
* const vector = d.vec2i(1); // (1, 1)
|
774
|
+
* const vector = d.vec2i(-1, 1); // (-1, 1)
|
775
|
+
*
|
776
|
+
* @example
|
777
|
+
* const buffer = root.createBuffer(d.vec2i, d.vec2i(0, 1)); // buffer holding a d.vec2i value, with an initial value of vec2i(0, 1);
|
778
|
+
*/
|
779
|
+
declare const vec2i: NativeVec2i;
|
780
|
+
/**
|
781
|
+
* Type of the `d.vec2u` object/function: vector data type schema/constructor
|
782
|
+
*/
|
783
|
+
type NativeVec2u = Vec2u & {
|
784
|
+
'~exotic': Vec2u;
|
785
|
+
} & ((x: number, y: number) => v2u) & ((xy: number) => v2u) & (() => v2u);
|
786
|
+
/**
|
787
|
+
*
|
788
|
+
* Schema representing vec2u - a vector with 2 elements of type u32.
|
789
|
+
* Also a constructor function for this vector value.
|
790
|
+
*
|
791
|
+
* @example
|
792
|
+
* const vector = d.vec2u(); // (0, 0)
|
793
|
+
* const vector = d.vec2u(1); // (1, 1)
|
794
|
+
* const vector = d.vec2u(1, 2); // (1, 2)
|
795
|
+
*
|
796
|
+
* @example
|
797
|
+
* const buffer = root.createBuffer(d.vec2u, d.vec2u(0, 1)); // buffer holding a d.vec2u value, with an initial value of vec2u(0, 1);
|
798
|
+
*/
|
799
|
+
declare const vec2u: NativeVec2u;
|
800
|
+
/**
|
801
|
+
* Type of the `d.vec3f` object/function: vector data type schema/constructor
|
802
|
+
*/
|
803
|
+
type NativeVec3f = Vec3f & {
|
804
|
+
'~exotic': Vec3f;
|
805
|
+
} & ((x: number, y: number, z: number) => v3f) & ((xyz: number) => v3f) & (() => v3f);
|
806
|
+
/**
|
807
|
+
*
|
808
|
+
* Schema representing vec3f - a vector with 3 elements of type f32.
|
809
|
+
* Also a constructor function for this vector value.
|
810
|
+
*
|
811
|
+
* @example
|
812
|
+
* const vector = d.vec3f(); // (0.0, 0.0, 0.0)
|
813
|
+
* const vector = d.vec3f(1); // (1.0, 1.0, 1.0)
|
814
|
+
* const vector = d.vec3f(1, 2, 3.5); // (1.0, 2.0, 3.5)
|
815
|
+
*
|
816
|
+
* @example
|
817
|
+
* 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);
|
818
|
+
*/
|
819
|
+
declare const vec3f: NativeVec3f;
|
820
|
+
/**
|
821
|
+
* Type of the `d.vec3h` object/function: vector data type schema/constructor
|
822
|
+
*/
|
823
|
+
type NativeVec3h = Vec3h & {
|
824
|
+
'~exotic': Vec3h;
|
825
|
+
} & ((x: number, y: number, z: number) => v3h) & ((xyz: number) => v3h) & (() => v3h);
|
826
|
+
/**
|
827
|
+
*
|
828
|
+
* Schema representing vec3h - a vector with 3 elements of type f16.
|
829
|
+
* Also a constructor function for this vector value.
|
830
|
+
*
|
831
|
+
* @example
|
832
|
+
* const vector = d.vec3h(); // (0.0, 0.0, 0.0)
|
833
|
+
* const vector = d.vec3h(1); // (1.0, 1.0, 1.0)
|
834
|
+
* const vector = d.vec3h(1, 2, 3.5); // (1.0, 2.0, 3.5)
|
835
|
+
*
|
836
|
+
* @example
|
837
|
+
* 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);
|
838
|
+
*/
|
839
|
+
declare const vec3h: NativeVec3h;
|
840
|
+
/**
|
841
|
+
* Type of the `d.vec3i` object/function: vector data type schema/constructor
|
842
|
+
*/
|
843
|
+
type NativeVec3i = Vec3i & {
|
844
|
+
'~exotic': Vec3i;
|
845
|
+
} & ((x: number, y: number, z: number) => v3i) & ((xyz: number) => v3i) & (() => v3i);
|
846
|
+
/**
|
847
|
+
*
|
848
|
+
* Schema representing vec3i - a vector with 3 elements of type i32.
|
849
|
+
* Also a constructor function for this vector value.
|
850
|
+
*
|
851
|
+
* @example
|
852
|
+
* const vector = d.vec3i(); // (0, 0, 0)
|
853
|
+
* const vector = d.vec3i(1); // (1, 1, 1)
|
854
|
+
* const vector = d.vec3i(1, 2, -3); // (1, 2, -3)
|
855
|
+
*
|
856
|
+
* @example
|
857
|
+
* 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);
|
858
|
+
*/
|
859
|
+
declare const vec3i: NativeVec3i;
|
860
|
+
/**
|
861
|
+
* Type of the `d.vec3u` object/function: vector data type schema/constructor
|
862
|
+
*/
|
863
|
+
type NativeVec3u = Vec3u & {
|
864
|
+
'~exotic': Vec3u;
|
865
|
+
} & ((x: number, y: number, z: number) => v3u) & ((xyz: number) => v3u) & (() => v3u);
|
866
|
+
/**
|
867
|
+
*
|
868
|
+
* Schema representing vec3u - a vector with 3 elements of type u32.
|
869
|
+
* Also a constructor function for this vector value.
|
870
|
+
*
|
871
|
+
* @example
|
872
|
+
* const vector = d.vec3u(); // (0, 0, 0)
|
873
|
+
* const vector = d.vec3u(1); // (1, 1, 1)
|
874
|
+
* const vector = d.vec3u(1, 2, 3); // (1, 2, 3)
|
875
|
+
*
|
876
|
+
* @example
|
877
|
+
* 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);
|
878
|
+
*/
|
879
|
+
declare const vec3u: NativeVec3u;
|
880
|
+
/**
|
881
|
+
* Type of the `d.vec4f` object/function: vector data type schema/constructor
|
882
|
+
*/
|
883
|
+
type NativeVec4f = Vec4f & {
|
884
|
+
'~exotic': Vec4f;
|
885
|
+
} & ((x: number, y: number, z: number, w: number) => v4f) & ((xyzw: number) => v4f) & (() => v4f);
|
886
|
+
/**
|
887
|
+
*
|
888
|
+
* Schema representing vec4f - a vector with 4 elements of type f32.
|
889
|
+
* Also a constructor function for this vector value.
|
890
|
+
*
|
891
|
+
* @example
|
892
|
+
* const vector = d.vec4f(); // (0.0, 0.0, 0.0, 0.0)
|
893
|
+
* const vector = d.vec4f(1); // (1.0, 1.0, 1.0, 1.0)
|
894
|
+
* const vector = d.vec4f(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)
|
895
|
+
*
|
896
|
+
* @example
|
897
|
+
* 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);
|
898
|
+
*/
|
899
|
+
declare const vec4f: NativeVec4f;
|
900
|
+
/**
|
901
|
+
* Type of the `d.vec4h` object/function: vector data type schema/constructor
|
902
|
+
*/
|
903
|
+
type NativeVec4h = Vec4h & {
|
904
|
+
'~exotic': Vec4h;
|
905
|
+
} & ((x: number, y: number, z: number, w: number) => v4h) & ((xyzw: number) => v4h) & (() => v4h);
|
906
|
+
/**
|
907
|
+
*
|
908
|
+
* Schema representing vec4h - a vector with 4 elements of type f16.
|
909
|
+
* Also a constructor function for this vector value.
|
910
|
+
*
|
911
|
+
* @example
|
912
|
+
* const vector = d.vec4h(); // (0.0, 0.0, 0.0, 0.0)
|
913
|
+
* const vector = d.vec4h(1); // (1.0, 1.0, 1.0, 1.0)
|
914
|
+
* const vector = d.vec4h(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)
|
915
|
+
*
|
916
|
+
* @example
|
917
|
+
* 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);
|
918
|
+
*/
|
919
|
+
declare const vec4h: NativeVec4h;
|
920
|
+
/**
|
921
|
+
* Type of the `d.vec4i` object/function: vector data type schema/constructor
|
922
|
+
*/
|
923
|
+
type NativeVec4i = Vec4i & {
|
924
|
+
'~exotic': Vec4i;
|
925
|
+
} & ((x: number, y: number, z: number, w: number) => v4i) & ((xyzw: number) => v4i) & (() => v4i);
|
926
|
+
/**
|
927
|
+
*
|
928
|
+
* Schema representing vec4i - a vector with 4 elements of type i32.
|
929
|
+
* Also a constructor function for this vector value.
|
930
|
+
*
|
931
|
+
* @example
|
932
|
+
* const vector = d.vec4i(); // (0, 0, 0, 0)
|
933
|
+
* const vector = d.vec4i(1); // (1, 1, 1, 1)
|
934
|
+
* const vector = d.vec4i(1, 2, 3, -4); // (1, 2, 3, -4)
|
935
|
+
*
|
936
|
+
* @example
|
937
|
+
* 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);
|
938
|
+
*/
|
939
|
+
declare const vec4i: NativeVec4i;
|
940
|
+
/**
|
941
|
+
* Type of the `d.vec4u` object/function: vector data type schema/constructor
|
942
|
+
*/
|
943
|
+
type NativeVec4u = Vec4u & {
|
944
|
+
'~exotic': Vec4u;
|
945
|
+
} & ((x: number, y: number, z: number, w: number) => v4u) & ((xyzw: number) => v4u) & (() => v4u);
|
946
|
+
/**
|
947
|
+
*
|
948
|
+
* Schema representing vec4u - a vector with 4 elements of type u32.
|
949
|
+
* Also a constructor function for this vector value.
|
950
|
+
*
|
951
|
+
* @example
|
952
|
+
* const vector = d.vec4u(); // (0, 0, 0, 0)
|
953
|
+
* const vector = d.vec4u(1); // (1, 1, 1, 1)
|
954
|
+
* const vector = d.vec4u(1, 2, 3, 4); // (1, 2, 3, 4)
|
955
|
+
*
|
956
|
+
* @example
|
957
|
+
* 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);
|
958
|
+
*/
|
959
|
+
declare const vec4u: NativeVec4u;
|
960
|
+
|
961
|
+
export { type PerspectiveOrLinearInterpolatableData as $, type AnyWgslData as A, type BaseWgslData as B, type NativeVec3i as C, type Decorated as D, type InferRecord as E, type F32 as F, type m2x2f as G, type m3x3f as H, type Infer as I, type m4x4f as J, type v2f as K, type Location as L, type Mat2x2f as M, type NativeVec2u as N, type Mat3x3f as O, type v3f as P, type Mat4x4f as Q, type v4f as R, type Atomic as S, type Align as T, type U32 as U, type Vec2f as V, type WgslArray as W, type Size as X, type Interpolate as Y, type InterpolationType as Z, type PerspectiveOrLinearInterpolationType as _, type F16 as a, type FlatInterpolationType as a0, type FlatInterpolatableData as a1, isWgslData as a2, isWgslArray as a3, isWgslStruct as a4, isAtomic as a5, isDecorated as a6, isAlignAttrib as a7, isBuiltinAttrib as a8, isLocationAttrib as a9, isInterpolateAttrib as aa, isSizeAttrib as ab, type v2i as ac, type v2u as ad, type v3i as ae, type v3u as af, type v4i as ag, type v4u as ah, vec2f as ai, vec2h as aj, vec2i as ak, vec2u as al, vec3f as am, vec3h as an, vec3i as ao, vec3u as ap, vec4f as aq, vec4h as ar, vec4i as as, vec4u as at, type VecKind as au, type I32 as b, type Vec3f as c, type Vec4f as d, type Vec2h as e, type Vec3h as f, type Vec4h as g, type Vec2i as h, type Vec3i as i, type Vec4i as j, type Vec2u as k, type Vec3u as l, type Vec4u as m, type WgslStruct as n, type WgslTypeLiteral as o, type AnyVecInstance as p, type AnyMatInstance as q, type Builtin as r, type Bool as s, type NativeVec4u as t, type NativeVec2i as u, type NativeVec4i as v, type NativeVec2f as w, type NativeVec4f as x, type NativeVec3f as y, type NativeVec3u as z };
|