typegpu 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -12
- package/README.md +13 -5
- package/chunk-5RYM4COI.js +4 -0
- package/chunk-5RYM4COI.js.map +1 -0
- package/chunk-FHOQ6WZE.cjs +2 -0
- package/chunk-FHOQ6WZE.cjs.map +1 -0
- package/chunk-ODKBWWHU.cjs +4 -0
- package/chunk-ODKBWWHU.cjs.map +1 -0
- package/chunk-SMTSXYNG.js +2 -0
- package/chunk-SMTSXYNG.js.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.cjs.map +1 -1
- package/data/index.d.cts +5 -23
- package/data/index.d.ts +5 -23
- package/data/index.js +1 -1
- package/index.cjs +23 -19
- package/index.cjs.map +1 -1
- package/index.d.cts +4 -1045
- package/index.d.ts +4 -1045
- package/index.js +23 -19
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/std/index.cjs +1 -1
- package/std/index.cjs.map +1 -1
- package/std/index.d.cts +53 -4
- package/std/index.d.ts +53 -4
- package/std/index.js +1 -1
- package/std/index.js.map +1 -1
- package/tgpuComputeFn-DH8_PcIR.d.cts +3042 -0
- package/tgpuComputeFn-DH8_PcIR.d.ts +3042 -0
- package/attributes-B90UjSYb.d.ts +0 -159
- package/attributes-zljQ-iA7.d.cts +0 -159
- package/chunk-KJHEEZQT.js +0 -4
- package/chunk-KJHEEZQT.js.map +0 -1
- package/chunk-LB4TSIPN.cjs +0 -2
- package/chunk-LB4TSIPN.cjs.map +0 -1
- package/chunk-VTUUXD6H.cjs +0 -4
- package/chunk-VTUUXD6H.cjs.map +0 -1
- package/chunk-YVK55BVR.js +0 -2
- package/chunk-YVK55BVR.js.map +0 -1
- package/dataTypes-6k4EJeol.d.cts +0 -1405
- package/dataTypes-6k4EJeol.d.ts +0 -1405
- package/sampler-ByLNpSxj.d.ts +0 -369
- package/sampler-NRTAYTIW.d.cts +0 -369
package/dataTypes-6k4EJeol.d.ts
DELETED
@@ -1,1405 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Can be assigned a name. Not to be confused with
|
3
|
-
* being able to HAVE a name.
|
4
|
-
*/
|
5
|
-
interface TgpuNamable {
|
6
|
-
$name(label?: string | undefined): this;
|
7
|
-
}
|
8
|
-
|
9
|
-
declare const $repr: unique symbol;
|
10
|
-
/**
|
11
|
-
* Extracts the inferred representation of a resource.
|
12
|
-
* @example
|
13
|
-
* type A = Infer<F32> // => number
|
14
|
-
* type B = Infer<WgslArray<F32>> // => number[]
|
15
|
-
*/
|
16
|
-
type Infer<T> = T extends {
|
17
|
-
readonly [$repr]: infer TRepr;
|
18
|
-
} ? TRepr : T;
|
19
|
-
type InferPartial<T> = T extends {
|
20
|
-
readonly '~reprPartial': infer TRepr;
|
21
|
-
} ? TRepr : T extends {
|
22
|
-
readonly [$repr]: infer TRepr;
|
23
|
-
} ? TRepr | undefined : T extends Record<string | number | symbol, unknown> ? InferPartialRecord<T> : T;
|
24
|
-
type InferGPU<T> = T extends {
|
25
|
-
readonly '~gpuRepr': infer TRepr;
|
26
|
-
} ? TRepr : Infer<T>;
|
27
|
-
type InferRecord<T extends Record<string | number | symbol, unknown>> = {
|
28
|
-
[Key in keyof T]: Infer<T[Key]>;
|
29
|
-
};
|
30
|
-
type InferPartialRecord<T extends Record<string | number | symbol, unknown>> = {
|
31
|
-
[Key in keyof T]: InferPartial<T[Key]>;
|
32
|
-
};
|
33
|
-
type InferGPURecord<T extends Record<string | number | symbol, unknown>> = {
|
34
|
-
[Key in keyof T]: InferGPU<T[Key]>;
|
35
|
-
};
|
36
|
-
type MemIdentity<T> = T extends {
|
37
|
-
readonly '~memIdent': infer TMemIdent;
|
38
|
-
} ? TMemIdent : T;
|
39
|
-
type MemIdentityRecord<T extends Record<string | number | symbol, unknown>> = {
|
40
|
-
[Key in keyof T]: MemIdentity<T[Key]>;
|
41
|
-
};
|
42
|
-
|
43
|
-
declare const $internal: unique symbol;
|
44
|
-
|
45
|
-
type Default<T, TDefault> = unknown extends T ? TDefault : T extends undefined ? TDefault : T;
|
46
|
-
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
47
|
-
type Prettify<T> = {
|
48
|
-
[K in keyof T]: T[K];
|
49
|
-
} & {};
|
50
|
-
/**
|
51
|
-
* Removes properties from record type that extend `Prop`
|
52
|
-
*/
|
53
|
-
type OmitProps<T extends Record<string, unknown>, Prop> = Pick<T, {
|
54
|
-
[Key in keyof T]: T[Key] extends Prop ? never : Key;
|
55
|
-
}[keyof T]>;
|
56
|
-
/**
|
57
|
-
* The opposite of Readonly<T>
|
58
|
-
*/
|
59
|
-
type Mutable<T> = {
|
60
|
-
-readonly [P in keyof T]: T[P];
|
61
|
-
};
|
62
|
-
|
63
|
-
type DecoratedLocation<T extends BaseData> = Decorated<T, Location<number>[]>;
|
64
|
-
interface NumberArrayView {
|
65
|
-
readonly length: number;
|
66
|
-
[n: number]: number;
|
67
|
-
}
|
68
|
-
interface BooleanArrayView {
|
69
|
-
readonly length: number;
|
70
|
-
[n: number]: boolean;
|
71
|
-
}
|
72
|
-
interface BaseData {
|
73
|
-
readonly [$internal]: true;
|
74
|
-
readonly type: string;
|
75
|
-
readonly [$repr]: unknown;
|
76
|
-
}
|
77
|
-
/**
|
78
|
-
* Represents a 64-bit integer.
|
79
|
-
*/
|
80
|
-
interface AbstractInt {
|
81
|
-
readonly [$internal]: true;
|
82
|
-
readonly type: 'abstractInt';
|
83
|
-
readonly [$repr]: number;
|
84
|
-
}
|
85
|
-
/**
|
86
|
-
* Represents a 64-bit IEEE 754 floating point number.
|
87
|
-
*/
|
88
|
-
interface AbstractFloat {
|
89
|
-
readonly [$internal]: true;
|
90
|
-
readonly type: 'abstractFloat';
|
91
|
-
readonly [$repr]: number;
|
92
|
-
}
|
93
|
-
interface Void {
|
94
|
-
readonly [$internal]: true;
|
95
|
-
readonly type: 'void';
|
96
|
-
readonly [$repr]: undefined;
|
97
|
-
}
|
98
|
-
declare const Void: Void;
|
99
|
-
interface Swizzle2<T2, T3, T4> {
|
100
|
-
readonly xx: T2;
|
101
|
-
readonly xy: T2;
|
102
|
-
readonly yx: T2;
|
103
|
-
readonly yy: T2;
|
104
|
-
readonly xxx: T3;
|
105
|
-
readonly xxy: T3;
|
106
|
-
readonly xyx: T3;
|
107
|
-
readonly xyy: T3;
|
108
|
-
readonly yxx: T3;
|
109
|
-
readonly yxy: T3;
|
110
|
-
readonly yyx: T3;
|
111
|
-
readonly yyy: T3;
|
112
|
-
readonly xxxx: T4;
|
113
|
-
readonly xxxy: T4;
|
114
|
-
readonly xxyx: T4;
|
115
|
-
readonly xxyy: T4;
|
116
|
-
readonly xyxx: T4;
|
117
|
-
readonly xyxy: T4;
|
118
|
-
readonly xyyx: T4;
|
119
|
-
readonly xyyy: T4;
|
120
|
-
readonly yxxx: T4;
|
121
|
-
readonly yxxy: T4;
|
122
|
-
readonly yxyx: T4;
|
123
|
-
readonly yxyy: T4;
|
124
|
-
readonly yyxx: T4;
|
125
|
-
readonly yyxy: T4;
|
126
|
-
readonly yyyx: T4;
|
127
|
-
readonly yyyy: T4;
|
128
|
-
}
|
129
|
-
interface Swizzle3<T2, T3, T4> extends Swizzle2<T2, T3, T4> {
|
130
|
-
readonly xz: T2;
|
131
|
-
readonly yz: T2;
|
132
|
-
readonly zx: T2;
|
133
|
-
readonly zy: T2;
|
134
|
-
readonly zz: T2;
|
135
|
-
readonly xxz: T3;
|
136
|
-
readonly xyz: T3;
|
137
|
-
readonly xzx: T3;
|
138
|
-
readonly xzy: T3;
|
139
|
-
readonly xzz: T3;
|
140
|
-
readonly yxz: T3;
|
141
|
-
readonly yyz: T3;
|
142
|
-
readonly yzx: T3;
|
143
|
-
readonly yzy: T3;
|
144
|
-
readonly yzz: T3;
|
145
|
-
readonly zxx: T3;
|
146
|
-
readonly zxy: T3;
|
147
|
-
readonly zxz: T3;
|
148
|
-
readonly zyx: T3;
|
149
|
-
readonly zyy: T3;
|
150
|
-
readonly zyz: T3;
|
151
|
-
readonly zzx: T3;
|
152
|
-
readonly zzy: T3;
|
153
|
-
readonly zzz: T3;
|
154
|
-
readonly xxxz: T4;
|
155
|
-
readonly xxyz: T4;
|
156
|
-
readonly xxzx: T4;
|
157
|
-
readonly xxzy: T4;
|
158
|
-
readonly xxzz: T4;
|
159
|
-
readonly xyxz: T4;
|
160
|
-
readonly xyyz: T4;
|
161
|
-
readonly xyzx: T4;
|
162
|
-
readonly xyzy: T4;
|
163
|
-
readonly xyzz: T4;
|
164
|
-
readonly xzxx: T4;
|
165
|
-
readonly xzxy: T4;
|
166
|
-
readonly xzxz: T4;
|
167
|
-
readonly xzyx: T4;
|
168
|
-
readonly xzyy: T4;
|
169
|
-
readonly xzyz: T4;
|
170
|
-
readonly xzzx: T4;
|
171
|
-
readonly xzzy: T4;
|
172
|
-
readonly xzzz: T4;
|
173
|
-
readonly yxxz: T4;
|
174
|
-
readonly yxyz: T4;
|
175
|
-
readonly yxzx: T4;
|
176
|
-
readonly yxzy: T4;
|
177
|
-
readonly yxzz: T4;
|
178
|
-
readonly yyxz: T4;
|
179
|
-
readonly yyyz: T4;
|
180
|
-
readonly yyzx: T4;
|
181
|
-
readonly yyzy: T4;
|
182
|
-
readonly yyzz: T4;
|
183
|
-
readonly yzxx: T4;
|
184
|
-
readonly yzxy: T4;
|
185
|
-
readonly yzxz: T4;
|
186
|
-
readonly yzyx: T4;
|
187
|
-
readonly yzyy: T4;
|
188
|
-
readonly yzyz: T4;
|
189
|
-
readonly yzzx: T4;
|
190
|
-
readonly yzzy: T4;
|
191
|
-
readonly yzzz: T4;
|
192
|
-
readonly zxxx: T4;
|
193
|
-
readonly zxxy: T4;
|
194
|
-
readonly zxxz: T4;
|
195
|
-
readonly zxyx: T4;
|
196
|
-
readonly zxyy: T4;
|
197
|
-
readonly zxyz: T4;
|
198
|
-
readonly zxzx: T4;
|
199
|
-
readonly zxzy: T4;
|
200
|
-
readonly zxzz: T4;
|
201
|
-
readonly zyxx: T4;
|
202
|
-
readonly zyxy: T4;
|
203
|
-
readonly zyxz: T4;
|
204
|
-
readonly zyyx: T4;
|
205
|
-
readonly zyyy: T4;
|
206
|
-
readonly zyyz: T4;
|
207
|
-
readonly zyzx: T4;
|
208
|
-
readonly zyzy: T4;
|
209
|
-
readonly zyzz: T4;
|
210
|
-
readonly zzxx: T4;
|
211
|
-
readonly zzxy: T4;
|
212
|
-
readonly zzxz: T4;
|
213
|
-
readonly zzyx: T4;
|
214
|
-
readonly zzyy: T4;
|
215
|
-
readonly zzyz: T4;
|
216
|
-
readonly zzzx: T4;
|
217
|
-
readonly zzzy: T4;
|
218
|
-
readonly zzzz: T4;
|
219
|
-
}
|
220
|
-
interface Swizzle4<T2, T3, T4> extends Swizzle3<T2, T3, T4> {
|
221
|
-
readonly yw: T2;
|
222
|
-
readonly zw: T2;
|
223
|
-
readonly wx: T2;
|
224
|
-
readonly wy: T2;
|
225
|
-
readonly wz: T2;
|
226
|
-
readonly ww: T2;
|
227
|
-
readonly xxw: T3;
|
228
|
-
readonly xyw: T3;
|
229
|
-
readonly xzw: T3;
|
230
|
-
readonly xwx: T3;
|
231
|
-
readonly xwy: T3;
|
232
|
-
readonly xwz: T3;
|
233
|
-
readonly xww: T3;
|
234
|
-
readonly yxw: T3;
|
235
|
-
readonly yyw: T3;
|
236
|
-
readonly yzw: T3;
|
237
|
-
readonly ywx: T3;
|
238
|
-
readonly ywy: T3;
|
239
|
-
readonly ywz: T3;
|
240
|
-
readonly yww: T3;
|
241
|
-
readonly zxw: T3;
|
242
|
-
readonly zyw: T3;
|
243
|
-
readonly zzw: T3;
|
244
|
-
readonly zwx: T3;
|
245
|
-
readonly zwy: T3;
|
246
|
-
readonly zwz: T3;
|
247
|
-
readonly zww: T3;
|
248
|
-
readonly wxx: T3;
|
249
|
-
readonly wxz: T3;
|
250
|
-
readonly wxy: T3;
|
251
|
-
readonly wyy: T3;
|
252
|
-
readonly wyz: T3;
|
253
|
-
readonly wzz: T3;
|
254
|
-
readonly wwx: T3;
|
255
|
-
readonly wwy: T3;
|
256
|
-
readonly wwz: T3;
|
257
|
-
readonly www: T3;
|
258
|
-
readonly xxxw: T4;
|
259
|
-
readonly xxyw: T4;
|
260
|
-
readonly xxzw: T4;
|
261
|
-
readonly xxwx: T4;
|
262
|
-
readonly xxwy: T4;
|
263
|
-
readonly xxwz: T4;
|
264
|
-
readonly xxww: T4;
|
265
|
-
readonly xyxw: T4;
|
266
|
-
readonly xyyw: T4;
|
267
|
-
readonly xyzw: T4;
|
268
|
-
readonly xywx: T4;
|
269
|
-
readonly xywy: T4;
|
270
|
-
readonly xywz: T4;
|
271
|
-
readonly xyww: T4;
|
272
|
-
readonly xzxw: T4;
|
273
|
-
readonly xzyw: T4;
|
274
|
-
readonly xzzw: T4;
|
275
|
-
readonly xzwx: T4;
|
276
|
-
readonly xzwy: T4;
|
277
|
-
readonly xzwz: T4;
|
278
|
-
readonly xzww: T4;
|
279
|
-
readonly xwxx: T4;
|
280
|
-
readonly xwxy: T4;
|
281
|
-
readonly xwxz: T4;
|
282
|
-
readonly xwyy: T4;
|
283
|
-
readonly xwyz: T4;
|
284
|
-
readonly xwzz: T4;
|
285
|
-
readonly xwwx: T4;
|
286
|
-
readonly xwwy: T4;
|
287
|
-
readonly xwwz: T4;
|
288
|
-
readonly xwww: T4;
|
289
|
-
readonly yxxw: T4;
|
290
|
-
readonly yxyw: T4;
|
291
|
-
readonly yxzw: T4;
|
292
|
-
readonly yxwx: T4;
|
293
|
-
readonly yxwy: T4;
|
294
|
-
readonly yxwz: T4;
|
295
|
-
readonly yxww: T4;
|
296
|
-
readonly yyxw: T4;
|
297
|
-
readonly yyyw: T4;
|
298
|
-
readonly yyzw: T4;
|
299
|
-
readonly yywx: T4;
|
300
|
-
readonly yywy: T4;
|
301
|
-
readonly yywz: T4;
|
302
|
-
readonly yyww: T4;
|
303
|
-
readonly yzxw: T4;
|
304
|
-
readonly yzyw: T4;
|
305
|
-
readonly yzzw: T4;
|
306
|
-
readonly yzwx: T4;
|
307
|
-
readonly yzwy: T4;
|
308
|
-
readonly yzwz: T4;
|
309
|
-
readonly yzww: T4;
|
310
|
-
readonly ywxx: T4;
|
311
|
-
readonly ywxy: T4;
|
312
|
-
readonly ywxz: T4;
|
313
|
-
readonly ywxw: T4;
|
314
|
-
readonly ywyy: T4;
|
315
|
-
readonly ywyz: T4;
|
316
|
-
readonly ywzz: T4;
|
317
|
-
readonly ywwx: T4;
|
318
|
-
readonly ywwy: T4;
|
319
|
-
readonly ywwz: T4;
|
320
|
-
readonly ywww: T4;
|
321
|
-
readonly zxxw: T4;
|
322
|
-
readonly zxyw: T4;
|
323
|
-
readonly zxzw: T4;
|
324
|
-
readonly zxwx: T4;
|
325
|
-
readonly zxwy: T4;
|
326
|
-
readonly zxwz: T4;
|
327
|
-
readonly zxww: T4;
|
328
|
-
readonly zyxw: T4;
|
329
|
-
readonly zyyw: T4;
|
330
|
-
readonly zyzw: T4;
|
331
|
-
readonly zywx: T4;
|
332
|
-
readonly zywy: T4;
|
333
|
-
readonly zywz: T4;
|
334
|
-
readonly zyww: T4;
|
335
|
-
readonly zzxw: T4;
|
336
|
-
readonly zzyw: T4;
|
337
|
-
readonly zzzw: T4;
|
338
|
-
readonly zzwx: T4;
|
339
|
-
readonly zzwy: T4;
|
340
|
-
readonly zzwz: T4;
|
341
|
-
readonly zzww: T4;
|
342
|
-
readonly zwxx: T4;
|
343
|
-
readonly zwxy: T4;
|
344
|
-
readonly zwxz: T4;
|
345
|
-
readonly zwxw: T4;
|
346
|
-
readonly zwyy: T4;
|
347
|
-
readonly zwyz: T4;
|
348
|
-
readonly zwzz: T4;
|
349
|
-
readonly zwwx: T4;
|
350
|
-
readonly zwwy: T4;
|
351
|
-
readonly zwwz: T4;
|
352
|
-
readonly zwww: T4;
|
353
|
-
readonly wxxx: T4;
|
354
|
-
readonly wxxy: T4;
|
355
|
-
readonly wxxz: T4;
|
356
|
-
readonly wxxw: T4;
|
357
|
-
readonly wxyx: T4;
|
358
|
-
readonly wxyy: T4;
|
359
|
-
readonly wxyz: T4;
|
360
|
-
readonly wxyw: T4;
|
361
|
-
readonly wxzx: T4;
|
362
|
-
readonly wxzy: T4;
|
363
|
-
readonly wxzz: T4;
|
364
|
-
readonly wxzw: T4;
|
365
|
-
readonly wxwx: T4;
|
366
|
-
readonly wxwy: T4;
|
367
|
-
readonly wxwz: T4;
|
368
|
-
readonly wxww: T4;
|
369
|
-
readonly wyxx: T4;
|
370
|
-
readonly wyxy: T4;
|
371
|
-
readonly wyxz: T4;
|
372
|
-
readonly wyxw: T4;
|
373
|
-
readonly wyyy: T4;
|
374
|
-
readonly wyyz: T4;
|
375
|
-
readonly wyzw: T4;
|
376
|
-
readonly wywx: T4;
|
377
|
-
readonly wywy: T4;
|
378
|
-
readonly wywz: T4;
|
379
|
-
readonly wyww: T4;
|
380
|
-
readonly wzxx: T4;
|
381
|
-
readonly wzxy: T4;
|
382
|
-
readonly wzxz: T4;
|
383
|
-
readonly wzxw: T4;
|
384
|
-
readonly wzyy: T4;
|
385
|
-
readonly wzyz: T4;
|
386
|
-
readonly wzzy: T4;
|
387
|
-
readonly wzzw: T4;
|
388
|
-
readonly wzwx: T4;
|
389
|
-
readonly wzwy: T4;
|
390
|
-
readonly wzwz: T4;
|
391
|
-
readonly wzww: T4;
|
392
|
-
readonly wwxx: T4;
|
393
|
-
readonly wwxy: T4;
|
394
|
-
readonly wwxz: T4;
|
395
|
-
readonly wwxw: T4;
|
396
|
-
readonly wwyy: T4;
|
397
|
-
readonly wwyz: T4;
|
398
|
-
readonly wwzz: T4;
|
399
|
-
readonly wwwx: T4;
|
400
|
-
readonly wwwy: T4;
|
401
|
-
readonly wwwz: T4;
|
402
|
-
readonly wwww: T4;
|
403
|
-
}
|
404
|
-
/**
|
405
|
-
* Interface representing its WGSL vector type counterpart: vec2f or vec2<f32>.
|
406
|
-
* A vector with 2 elements of type f32
|
407
|
-
*/
|
408
|
-
interface v2f extends NumberArrayView, Swizzle2<v2f, v3f, v4f> {
|
409
|
-
readonly [$internal]: true;
|
410
|
-
/** use to distinguish between vectors of the same size on the type level */
|
411
|
-
readonly kind: 'vec2f';
|
412
|
-
x: number;
|
413
|
-
y: number;
|
414
|
-
}
|
415
|
-
/**
|
416
|
-
* Interface representing its WGSL vector type counterpart: vec2h or vec2<f16>.
|
417
|
-
* A vector with 2 elements of type f16
|
418
|
-
*/
|
419
|
-
interface v2h extends NumberArrayView, Swizzle2<v2h, v3h, v4h> {
|
420
|
-
readonly [$internal]: true;
|
421
|
-
/** use to distinguish between vectors of the same size on the type level */
|
422
|
-
readonly kind: 'vec2h';
|
423
|
-
x: number;
|
424
|
-
y: number;
|
425
|
-
}
|
426
|
-
/**
|
427
|
-
* Interface representing its WGSL vector type counterpart: vec2i or vec2<i32>.
|
428
|
-
* A vector with 2 elements of type i32
|
429
|
-
*/
|
430
|
-
interface v2i extends NumberArrayView, Swizzle2<v2i, v3i, v4i> {
|
431
|
-
readonly [$internal]: true;
|
432
|
-
/** use to distinguish between vectors of the same size on the type level */
|
433
|
-
readonly kind: 'vec2i';
|
434
|
-
x: number;
|
435
|
-
y: number;
|
436
|
-
}
|
437
|
-
/**
|
438
|
-
* Interface representing its WGSL vector type counterpart: vec2u or vec2<u32>.
|
439
|
-
* A vector with 2 elements of type u32
|
440
|
-
*/
|
441
|
-
interface v2u extends NumberArrayView, Swizzle2<v2u, v3u, v4u> {
|
442
|
-
readonly [$internal]: true;
|
443
|
-
/** use to distinguish between vectors of the same size on the type level */
|
444
|
-
readonly kind: 'vec2u';
|
445
|
-
x: number;
|
446
|
-
y: number;
|
447
|
-
}
|
448
|
-
/**
|
449
|
-
* Interface representing its WGSL vector type counterpart: `vec2<bool>`.
|
450
|
-
* A vector with 2 elements of type `bool`
|
451
|
-
*/
|
452
|
-
interface v2b extends BooleanArrayView, Swizzle2<v2b, v3b, v4b> {
|
453
|
-
readonly [$internal]: true;
|
454
|
-
/** use to distinguish between vectors of the same size on the type level */
|
455
|
-
readonly kind: 'vec2<bool>';
|
456
|
-
x: boolean;
|
457
|
-
y: boolean;
|
458
|
-
}
|
459
|
-
/**
|
460
|
-
* Interface representing its WGSL vector type counterpart: vec3f or vec3<f32>.
|
461
|
-
* A vector with 3 elements of type f32
|
462
|
-
*/
|
463
|
-
interface v3f extends NumberArrayView, Swizzle3<v2f, v3f, v4f> {
|
464
|
-
readonly [$internal]: true;
|
465
|
-
/** use to distinguish between vectors of the same size on the type level */
|
466
|
-
readonly kind: 'vec3f';
|
467
|
-
x: number;
|
468
|
-
y: number;
|
469
|
-
z: number;
|
470
|
-
}
|
471
|
-
/**
|
472
|
-
* Interface representing its WGSL vector type counterpart: vec3h or vec3<f16>.
|
473
|
-
* A vector with 3 elements of type f16
|
474
|
-
*/
|
475
|
-
interface v3h extends NumberArrayView, Swizzle3<v2h, v3h, v4h> {
|
476
|
-
readonly [$internal]: true;
|
477
|
-
/** use to distinguish between vectors of the same size on the type level */
|
478
|
-
readonly kind: 'vec3h';
|
479
|
-
x: number;
|
480
|
-
y: number;
|
481
|
-
z: number;
|
482
|
-
}
|
483
|
-
/**
|
484
|
-
* Interface representing its WGSL vector type counterpart: vec3i or vec3<i32>.
|
485
|
-
* A vector with 3 elements of type i32
|
486
|
-
*/
|
487
|
-
interface v3i extends NumberArrayView, Swizzle3<v2i, v3i, v4i> {
|
488
|
-
readonly [$internal]: true;
|
489
|
-
/** use to distinguish between vectors of the same size on the type level */
|
490
|
-
readonly kind: 'vec3i';
|
491
|
-
x: number;
|
492
|
-
y: number;
|
493
|
-
z: number;
|
494
|
-
}
|
495
|
-
/**
|
496
|
-
* Interface representing its WGSL vector type counterpart: vec3u or vec3<u32>.
|
497
|
-
* A vector with 3 elements of type u32
|
498
|
-
*/
|
499
|
-
interface v3u extends NumberArrayView, Swizzle3<v2u, v3u, v4u> {
|
500
|
-
readonly [$internal]: true;
|
501
|
-
/** use to distinguish between vectors of the same size on the type level */
|
502
|
-
readonly kind: 'vec3u';
|
503
|
-
x: number;
|
504
|
-
y: number;
|
505
|
-
z: number;
|
506
|
-
}
|
507
|
-
/**
|
508
|
-
* Interface representing its WGSL vector type counterpart: `vec3<bool>`.
|
509
|
-
* A vector with 3 elements of type `bool`
|
510
|
-
*/
|
511
|
-
interface v3b extends BooleanArrayView, Swizzle3<v2b, v3b, v4b> {
|
512
|
-
readonly [$internal]: true;
|
513
|
-
/** use to distinguish between vectors of the same size on the type level */
|
514
|
-
readonly kind: 'vec3<bool>';
|
515
|
-
x: boolean;
|
516
|
-
y: boolean;
|
517
|
-
z: boolean;
|
518
|
-
}
|
519
|
-
/**
|
520
|
-
* Interface representing its WGSL vector type counterpart: vec4f or vec4<f32>.
|
521
|
-
* A vector with 4 elements of type f32
|
522
|
-
*/
|
523
|
-
interface v4f extends NumberArrayView, Swizzle4<v2f, v3f, v4f> {
|
524
|
-
readonly [$internal]: true;
|
525
|
-
/** use to distinguish between vectors of the same size on the type level */
|
526
|
-
readonly kind: 'vec4f';
|
527
|
-
x: number;
|
528
|
-
y: number;
|
529
|
-
z: number;
|
530
|
-
w: number;
|
531
|
-
}
|
532
|
-
/**
|
533
|
-
* Interface representing its WGSL vector type counterpart: vec4h or vec4<f16>.
|
534
|
-
* A vector with 4 elements of type f16
|
535
|
-
*/
|
536
|
-
interface v4h extends NumberArrayView, Swizzle4<v2h, v3h, v4h> {
|
537
|
-
readonly [$internal]: true;
|
538
|
-
/** use to distinguish between vectors of the same size on the type level */
|
539
|
-
readonly kind: 'vec4h';
|
540
|
-
x: number;
|
541
|
-
y: number;
|
542
|
-
z: number;
|
543
|
-
w: number;
|
544
|
-
}
|
545
|
-
/**
|
546
|
-
* Interface representing its WGSL vector type counterpart: vec4i or vec4<i32>.
|
547
|
-
* A vector with 4 elements of type i32
|
548
|
-
*/
|
549
|
-
interface v4i extends NumberArrayView, Swizzle4<v2i, v3i, v4i> {
|
550
|
-
readonly [$internal]: true;
|
551
|
-
/** use to distinguish between vectors of the same size on the type level */
|
552
|
-
readonly kind: 'vec4i';
|
553
|
-
x: number;
|
554
|
-
y: number;
|
555
|
-
z: number;
|
556
|
-
w: number;
|
557
|
-
}
|
558
|
-
/**
|
559
|
-
* Interface representing its WGSL vector type counterpart: vec4u or vec4<u32>.
|
560
|
-
* A vector with 4 elements of type u32
|
561
|
-
*/
|
562
|
-
interface v4u extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {
|
563
|
-
readonly [$internal]: true;
|
564
|
-
/** use to distinguish between vectors of the same size on the type level */
|
565
|
-
readonly kind: 'vec4u';
|
566
|
-
x: number;
|
567
|
-
y: number;
|
568
|
-
z: number;
|
569
|
-
w: number;
|
570
|
-
}
|
571
|
-
/**
|
572
|
-
* Interface representing its WGSL vector type counterpart: `vec4<bool>`.
|
573
|
-
* A vector with 4 elements of type `bool`
|
574
|
-
*/
|
575
|
-
interface v4b extends BooleanArrayView, Swizzle4<v2b, v3b, v4b> {
|
576
|
-
readonly [$internal]: true;
|
577
|
-
/** use to distinguish between vectors of the same size on the type level */
|
578
|
-
readonly kind: 'vec4<bool>';
|
579
|
-
x: boolean;
|
580
|
-
y: boolean;
|
581
|
-
z: boolean;
|
582
|
-
w: boolean;
|
583
|
-
}
|
584
|
-
type AnyFloatVecInstance = v2f | v2h | v3f | v3h | v4f | v4h;
|
585
|
-
type AnyBooleanVecInstance = v2b | v3b | v4b;
|
586
|
-
type AnyNumericVec2Instance = v2f | v2h | v2i | v2u;
|
587
|
-
type AnyNumericVec3Instance = v3f | v3h | v3i | v3u;
|
588
|
-
type AnyNumericVec4Instance = v4f | v4h | v4i | v4u;
|
589
|
-
type AnyNumericVecInstance = AnyNumericVec2Instance | AnyNumericVec3Instance | AnyNumericVec4Instance;
|
590
|
-
type AnyVec2Instance = v2f | v2h | v2i | v2u | v2b;
|
591
|
-
type AnyVec3Instance = v3f | v3h | v3i | v3u | v3b;
|
592
|
-
type AnyVec4Instance = v4f | v4h | v4i | v4u | v4b;
|
593
|
-
type AnyVecInstance = AnyVec2Instance | AnyVec3Instance | AnyVec4Instance;
|
594
|
-
interface matBase<TColumn> extends NumberArrayView {
|
595
|
-
readonly [$internal]: true;
|
596
|
-
readonly columns: readonly TColumn[];
|
597
|
-
}
|
598
|
-
/**
|
599
|
-
* Interface representing its WGSL matrix type counterpart: mat2x2
|
600
|
-
* A matrix with 2 rows and 2 columns, with elements of type `TColumn`
|
601
|
-
*/
|
602
|
-
interface mat2x2<TColumn> extends matBase<TColumn> {
|
603
|
-
readonly length: 4;
|
604
|
-
readonly kind: string;
|
605
|
-
[n: number]: number;
|
606
|
-
}
|
607
|
-
/**
|
608
|
-
* Interface representing its WGSL matrix type counterpart: mat2x2f or mat2x2<f32>
|
609
|
-
* A matrix with 2 rows and 2 columns, with elements of type d.f32
|
610
|
-
*/
|
611
|
-
interface m2x2f extends mat2x2<v2f> {
|
612
|
-
readonly kind: 'mat2x2f';
|
613
|
-
}
|
614
|
-
/**
|
615
|
-
* Interface representing its WGSL matrix type counterpart: mat3x3
|
616
|
-
* A matrix with 3 rows and 3 columns, with elements of type `TColumn`
|
617
|
-
*/
|
618
|
-
interface mat3x3<TColumn> extends matBase<TColumn> {
|
619
|
-
readonly length: 12;
|
620
|
-
readonly kind: string;
|
621
|
-
[n: number]: number;
|
622
|
-
}
|
623
|
-
/**
|
624
|
-
* Interface representing its WGSL matrix type counterpart: mat3x3f or mat3x3<f32>
|
625
|
-
* A matrix with 3 rows and 3 columns, with elements of type d.f32
|
626
|
-
*/
|
627
|
-
interface m3x3f extends mat3x3<v3f> {
|
628
|
-
readonly kind: 'mat3x3f';
|
629
|
-
}
|
630
|
-
/**
|
631
|
-
* Interface representing its WGSL matrix type counterpart: mat4x4
|
632
|
-
* A matrix with 4 rows and 4 columns, with elements of type `TColumn`
|
633
|
-
*/
|
634
|
-
interface mat4x4<TColumn> extends matBase<TColumn> {
|
635
|
-
readonly length: 16;
|
636
|
-
readonly kind: string;
|
637
|
-
[n: number]: number;
|
638
|
-
}
|
639
|
-
/**
|
640
|
-
* Interface representing its WGSL matrix type counterpart: mat4x4f or mat4x4<f32>
|
641
|
-
* A matrix with 4 rows and 4 columns, with elements of type d.f32
|
642
|
-
*/
|
643
|
-
interface m4x4f extends mat4x4<v4f> {
|
644
|
-
readonly kind: 'mat4x4f';
|
645
|
-
}
|
646
|
-
type AnyMatInstance = m2x2f | m3x3f | m4x4f;
|
647
|
-
type vBaseForMat<T extends AnyMatInstance> = T extends m2x2f ? v2f : T extends m3x3f ? v3f : v4f;
|
648
|
-
/**
|
649
|
-
* Boolean schema representing a single WGSL bool value.
|
650
|
-
* Cannot be used inside buffers as it is not host-shareable.
|
651
|
-
*/
|
652
|
-
interface Bool {
|
653
|
-
readonly [$internal]: true;
|
654
|
-
readonly type: 'bool';
|
655
|
-
readonly [$repr]: boolean;
|
656
|
-
}
|
657
|
-
/**
|
658
|
-
* 32-bit float schema representing a single WGSL f32 value.
|
659
|
-
*/
|
660
|
-
interface F32 {
|
661
|
-
readonly [$internal]: true;
|
662
|
-
readonly type: 'f32';
|
663
|
-
readonly [$repr]: number;
|
664
|
-
(v: number | boolean): number;
|
665
|
-
}
|
666
|
-
/**
|
667
|
-
* 16-bit float schema representing a single WGSL f16 value.
|
668
|
-
*/
|
669
|
-
interface F16 {
|
670
|
-
readonly [$internal]: true;
|
671
|
-
readonly type: 'f16';
|
672
|
-
readonly [$repr]: number;
|
673
|
-
(v: number | boolean): number;
|
674
|
-
}
|
675
|
-
/**
|
676
|
-
* Signed 32-bit integer schema representing a single WGSL i32 value.
|
677
|
-
*/
|
678
|
-
interface I32 {
|
679
|
-
readonly [$internal]: true;
|
680
|
-
readonly type: 'i32';
|
681
|
-
readonly [$repr]: number;
|
682
|
-
readonly '~memIdent': I32 | Atomic<I32> | DecoratedLocation<I32>;
|
683
|
-
(v: number | boolean): number;
|
684
|
-
}
|
685
|
-
/**
|
686
|
-
* Unsigned 32-bit integer schema representing a single WGSL u32 value.
|
687
|
-
*/
|
688
|
-
interface U32 {
|
689
|
-
readonly [$internal]: true;
|
690
|
-
readonly type: 'u32';
|
691
|
-
readonly [$repr]: number;
|
692
|
-
readonly '~memIdent': U32 | Atomic<U32> | DecoratedLocation<U32>;
|
693
|
-
(v: number | boolean): number;
|
694
|
-
}
|
695
|
-
/**
|
696
|
-
* Type of the `d.vec2f` object/function: vector data type schema/constructor
|
697
|
-
*/
|
698
|
-
interface Vec2f {
|
699
|
-
readonly [$internal]: true;
|
700
|
-
readonly type: 'vec2f';
|
701
|
-
readonly [$repr]: v2f;
|
702
|
-
(x: number, y: number): v2f;
|
703
|
-
(xy: number): v2f;
|
704
|
-
(): v2f;
|
705
|
-
(v: AnyNumericVec2Instance): v2f;
|
706
|
-
}
|
707
|
-
/**
|
708
|
-
* Type of the `d.vec2h` object/function: vector data type schema/constructor
|
709
|
-
*/
|
710
|
-
interface Vec2h {
|
711
|
-
readonly [$internal]: true;
|
712
|
-
readonly type: 'vec2h';
|
713
|
-
readonly [$repr]: v2h;
|
714
|
-
(x: number, y: number): v2h;
|
715
|
-
(xy: number): v2h;
|
716
|
-
(): v2h;
|
717
|
-
(v: AnyNumericVec2Instance): v2h;
|
718
|
-
}
|
719
|
-
/**
|
720
|
-
* Type of the `d.vec2i` object/function: vector data type schema/constructor
|
721
|
-
*/
|
722
|
-
interface Vec2i {
|
723
|
-
readonly [$internal]: true;
|
724
|
-
readonly type: 'vec2i';
|
725
|
-
readonly [$repr]: v2i;
|
726
|
-
(x: number, y: number): v2i;
|
727
|
-
(xy: number): v2i;
|
728
|
-
(): v2i;
|
729
|
-
(v: AnyNumericVec2Instance): v2i;
|
730
|
-
}
|
731
|
-
/**
|
732
|
-
* Type of the `d.vec2u` object/function: vector data type schema/constructor
|
733
|
-
*/
|
734
|
-
interface Vec2u {
|
735
|
-
readonly [$internal]: true;
|
736
|
-
readonly type: 'vec2u';
|
737
|
-
readonly [$repr]: v2u;
|
738
|
-
(x: number, y: number): v2u;
|
739
|
-
(xy: number): v2u;
|
740
|
-
(): v2u;
|
741
|
-
(v: AnyNumericVec2Instance): v2u;
|
742
|
-
}
|
743
|
-
/**
|
744
|
-
* Type of the `d.vec2b` object/function: vector data type schema/constructor
|
745
|
-
* Cannot be used inside buffers as it is not host-shareable.
|
746
|
-
*/
|
747
|
-
interface Vec2b {
|
748
|
-
readonly [$internal]: true;
|
749
|
-
readonly type: 'vec2<bool>';
|
750
|
-
readonly [$repr]: v2b;
|
751
|
-
(x: boolean, y: boolean): v2b;
|
752
|
-
(xy: boolean): v2b;
|
753
|
-
(): v2b;
|
754
|
-
(v: v2b): v2b;
|
755
|
-
}
|
756
|
-
/**
|
757
|
-
* Type of the `d.vec3f` object/function: vector data type schema/constructor
|
758
|
-
*/
|
759
|
-
interface Vec3f {
|
760
|
-
readonly [$internal]: true;
|
761
|
-
readonly type: 'vec3f';
|
762
|
-
readonly [$repr]: v3f;
|
763
|
-
(x: number, y: number, z: number): v3f;
|
764
|
-
(xyz: number): v3f;
|
765
|
-
(): v3f;
|
766
|
-
(v: AnyNumericVec3Instance): v3f;
|
767
|
-
(v0: AnyNumericVec2Instance, z: number): v3f;
|
768
|
-
(x: number, v0: AnyNumericVec2Instance): v3f;
|
769
|
-
}
|
770
|
-
/**
|
771
|
-
* Type of the `d.vec3h` object/function: vector data type schema/constructor
|
772
|
-
*/
|
773
|
-
interface Vec3h {
|
774
|
-
readonly [$internal]: true;
|
775
|
-
readonly type: 'vec3h';
|
776
|
-
readonly [$repr]: v3h;
|
777
|
-
(x: number, y: number, z: number): v3h;
|
778
|
-
(xyz: number): v3h;
|
779
|
-
(): v3h;
|
780
|
-
(v: AnyNumericVec3Instance): v3h;
|
781
|
-
(v0: AnyNumericVec2Instance, z: number): v3h;
|
782
|
-
(x: number, v0: AnyNumericVec2Instance): v3h;
|
783
|
-
}
|
784
|
-
/**
|
785
|
-
* Type of the `d.vec3i` object/function: vector data type schema/constructor
|
786
|
-
*/
|
787
|
-
interface Vec3i {
|
788
|
-
readonly [$internal]: true;
|
789
|
-
readonly type: 'vec3i';
|
790
|
-
readonly [$repr]: v3i;
|
791
|
-
(x: number, y: number, z: number): v3i;
|
792
|
-
(xyz: number): v3i;
|
793
|
-
(): v3i;
|
794
|
-
(v: AnyNumericVec3Instance): v3i;
|
795
|
-
(v0: AnyNumericVec2Instance, z: number): v3i;
|
796
|
-
(x: number, v0: AnyNumericVec2Instance): v3i;
|
797
|
-
}
|
798
|
-
/**
|
799
|
-
* Type of the `d.vec3u` object/function: vector data type schema/constructor
|
800
|
-
*/
|
801
|
-
interface Vec3u {
|
802
|
-
readonly [$internal]: true;
|
803
|
-
readonly type: 'vec3u';
|
804
|
-
readonly [$repr]: v3u;
|
805
|
-
(x: number, y: number, z: number): v3u;
|
806
|
-
(xyz: number): v3u;
|
807
|
-
(): v3u;
|
808
|
-
(v: AnyNumericVec3Instance): v3u;
|
809
|
-
(v0: AnyNumericVec2Instance, z: number): v3u;
|
810
|
-
(x: number, v0: AnyNumericVec2Instance): v3u;
|
811
|
-
}
|
812
|
-
/**
|
813
|
-
* Type of the `d.vec3b` object/function: vector data type schema/constructor
|
814
|
-
* Cannot be used inside buffers as it is not host-shareable.
|
815
|
-
*/
|
816
|
-
interface Vec3b {
|
817
|
-
readonly [$internal]: true;
|
818
|
-
readonly type: 'vec3<bool>';
|
819
|
-
readonly [$repr]: v3b;
|
820
|
-
(x: boolean, y: boolean, z: boolean): v3b;
|
821
|
-
(xyz: boolean): v3b;
|
822
|
-
(): v3b;
|
823
|
-
(v: v3b): v3b;
|
824
|
-
(v0: v2b, z: boolean): v3b;
|
825
|
-
(x: boolean, v0: v2b): v3b;
|
826
|
-
}
|
827
|
-
/**
|
828
|
-
* Type of the `d.vec4f` object/function: vector data type schema/constructor
|
829
|
-
*/
|
830
|
-
interface Vec4f {
|
831
|
-
readonly [$internal]: true;
|
832
|
-
readonly type: 'vec4f';
|
833
|
-
readonly [$repr]: v4f;
|
834
|
-
(x: number, y: number, z: number, w: number): v4f;
|
835
|
-
(xyzw: number): v4f;
|
836
|
-
(): v4f;
|
837
|
-
(v: AnyNumericVec4Instance): v4f;
|
838
|
-
(v0: AnyNumericVec3Instance, w: number): v4f;
|
839
|
-
(x: number, v0: AnyNumericVec3Instance): v4f;
|
840
|
-
(v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4f;
|
841
|
-
(v0: AnyNumericVec2Instance, z: number, w: number): v4f;
|
842
|
-
(x: number, v0: AnyNumericVec2Instance, z: number): v4f;
|
843
|
-
(x: number, y: number, v0: AnyNumericVec2Instance): v4f;
|
844
|
-
}
|
845
|
-
/**
|
846
|
-
* Type of the `d.vec4h` object/function: vector data type schema/constructor
|
847
|
-
*/
|
848
|
-
interface Vec4h {
|
849
|
-
readonly [$internal]: true;
|
850
|
-
readonly type: 'vec4h';
|
851
|
-
readonly [$repr]: v4h;
|
852
|
-
(x: number, y: number, z: number, w: number): v4h;
|
853
|
-
(xyzw: number): v4h;
|
854
|
-
(): v4h;
|
855
|
-
(v: AnyNumericVec4Instance): v4h;
|
856
|
-
(v0: AnyNumericVec3Instance, w: number): v4h;
|
857
|
-
(x: number, v0: AnyNumericVec3Instance): v4h;
|
858
|
-
(v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4h;
|
859
|
-
(v0: AnyNumericVec2Instance, z: number, w: number): v4h;
|
860
|
-
(x: number, v0: AnyNumericVec2Instance, z: number): v4h;
|
861
|
-
(x: number, y: number, v0: AnyNumericVec2Instance): v4h;
|
862
|
-
}
|
863
|
-
/**
|
864
|
-
* Type of the `d.vec4i` object/function: vector data type schema/constructor
|
865
|
-
*/
|
866
|
-
interface Vec4i {
|
867
|
-
readonly [$internal]: true;
|
868
|
-
readonly type: 'vec4i';
|
869
|
-
readonly [$repr]: v4i;
|
870
|
-
(x: number, y: number, z: number, w: number): v4i;
|
871
|
-
(xyzw: number): v4i;
|
872
|
-
(): v4i;
|
873
|
-
(v: AnyNumericVec4Instance): v4i;
|
874
|
-
(v0: AnyNumericVec3Instance, w: number): v4i;
|
875
|
-
(x: number, v0: AnyNumericVec3Instance): v4i;
|
876
|
-
(v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4i;
|
877
|
-
(v0: AnyNumericVec2Instance, z: number, w: number): v4i;
|
878
|
-
(x: number, v0: AnyNumericVec2Instance, z: number): v4i;
|
879
|
-
(x: number, y: number, v0: AnyNumericVec2Instance): v4i;
|
880
|
-
}
|
881
|
-
/**
|
882
|
-
* Type of the `d.vec4u` object/function: vector data type schema/constructor
|
883
|
-
*/
|
884
|
-
interface Vec4u {
|
885
|
-
readonly [$internal]: true;
|
886
|
-
readonly type: 'vec4u';
|
887
|
-
readonly [$repr]: v4u;
|
888
|
-
(x: number, y: number, z: number, w: number): v4u;
|
889
|
-
(xyzw: number): v4u;
|
890
|
-
(): v4u;
|
891
|
-
(v: AnyNumericVec4Instance): v4u;
|
892
|
-
(v0: AnyNumericVec3Instance, w: number): v4u;
|
893
|
-
(x: number, v0: AnyNumericVec3Instance): v4u;
|
894
|
-
(v0: AnyNumericVec2Instance, v1: AnyNumericVec2Instance): v4u;
|
895
|
-
(v0: AnyNumericVec2Instance, z: number, w: number): v4u;
|
896
|
-
(x: number, v0: AnyNumericVec2Instance, z: number): v4u;
|
897
|
-
(x: number, y: number, v0: AnyNumericVec2Instance): v4u;
|
898
|
-
}
|
899
|
-
/**
|
900
|
-
* Type of the `d.vec4b` object/function: vector data type schema/constructor
|
901
|
-
* Cannot be used inside buffers as it is not host-shareable.
|
902
|
-
*/
|
903
|
-
interface Vec4b {
|
904
|
-
readonly [$internal]: true;
|
905
|
-
readonly type: 'vec4<bool>';
|
906
|
-
readonly [$repr]: v4b;
|
907
|
-
(x: boolean, y: boolean, z: boolean, w: boolean): v4b;
|
908
|
-
(xyzw: boolean): v4b;
|
909
|
-
(): v4b;
|
910
|
-
(v: v4b): v4b;
|
911
|
-
(v0: v3b, w: boolean): v4b;
|
912
|
-
(x: boolean, v0: v3b): v4b;
|
913
|
-
(v0: v2b, v1: v2b): v4b;
|
914
|
-
(v0: v2b, z: boolean, w: boolean): v4b;
|
915
|
-
(x: boolean, v0: v2b, z: boolean): v4b;
|
916
|
-
(x: boolean, y: boolean, v0: v2b): v4b;
|
917
|
-
}
|
918
|
-
/**
|
919
|
-
* Type of the `d.mat2x2f` object/function: matrix data type schema/constructor
|
920
|
-
*/
|
921
|
-
interface Mat2x2f {
|
922
|
-
readonly [$internal]: true;
|
923
|
-
readonly type: 'mat2x2f';
|
924
|
-
readonly [$repr]: m2x2f;
|
925
|
-
(...elements: number[]): m2x2f;
|
926
|
-
(...columns: v2f[]): m2x2f;
|
927
|
-
(): m2x2f;
|
928
|
-
}
|
929
|
-
/**
|
930
|
-
* Type of the `d.mat3x3f` object/function: matrix data type schema/constructor
|
931
|
-
*/
|
932
|
-
interface Mat3x3f {
|
933
|
-
readonly [$internal]: true;
|
934
|
-
readonly type: 'mat3x3f';
|
935
|
-
readonly [$repr]: m3x3f;
|
936
|
-
(...elements: number[]): m3x3f;
|
937
|
-
(...columns: v3f[]): m3x3f;
|
938
|
-
(): m3x3f;
|
939
|
-
}
|
940
|
-
/**
|
941
|
-
* Type of the `d.mat4x4f` object/function: matrix data type schema/constructor
|
942
|
-
*/
|
943
|
-
interface Mat4x4f {
|
944
|
-
readonly [$internal]: true;
|
945
|
-
readonly type: 'mat4x4f';
|
946
|
-
readonly [$repr]: m4x4f;
|
947
|
-
(...elements: number[]): m4x4f;
|
948
|
-
(...columns: v4f[]): m4x4f;
|
949
|
-
(): m4x4f;
|
950
|
-
}
|
951
|
-
/**
|
952
|
-
* Array schema constructed via `d.arrayOf` function.
|
953
|
-
*
|
954
|
-
* Responsible for handling reading and writing array values
|
955
|
-
* between binary and JS representation. Takes into account
|
956
|
-
* the `byteAlignment` requirement of its elementType.
|
957
|
-
*/
|
958
|
-
interface WgslArray<TElement extends BaseData = BaseData> {
|
959
|
-
readonly [$internal]: true;
|
960
|
-
readonly type: 'array';
|
961
|
-
readonly elementCount: number;
|
962
|
-
readonly elementType: TElement;
|
963
|
-
readonly [$repr]: Infer<TElement>[];
|
964
|
-
readonly '~gpuRepr': InferGPU<TElement>[];
|
965
|
-
readonly '~reprPartial': {
|
966
|
-
idx: number;
|
967
|
-
value: InferPartial<TElement>;
|
968
|
-
}[];
|
969
|
-
readonly '~memIdent': WgslArray<MemIdentity<TElement>>;
|
970
|
-
}
|
971
|
-
/**
|
972
|
-
* Struct schema constructed via `d.struct` function.
|
973
|
-
*
|
974
|
-
* Responsible for handling reading and writing struct values
|
975
|
-
* between binary and JS representation. Takes into account
|
976
|
-
* the `byteAlignment` requirement of its members.
|
977
|
-
*/
|
978
|
-
interface WgslStruct<TProps extends Record<string, BaseData> = Record<string, BaseData>> extends TgpuNamable {
|
979
|
-
(props: Prettify<InferRecord<TProps>>): Prettify<InferRecord<TProps>>;
|
980
|
-
readonly [$internal]: true;
|
981
|
-
readonly type: 'struct';
|
982
|
-
readonly label?: string | undefined;
|
983
|
-
readonly propTypes: TProps;
|
984
|
-
readonly [$repr]: Prettify<InferRecord<TProps>>;
|
985
|
-
/** Type-token, not available at runtime */
|
986
|
-
readonly '~gpuRepr': Prettify<InferGPURecord<TProps>>;
|
987
|
-
/** Type-token, not available at runtime */
|
988
|
-
readonly '~memIdent': WgslStruct<Prettify<MemIdentityRecord<TProps>>>;
|
989
|
-
/** Type-token, not available at runtime */
|
990
|
-
readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
|
991
|
-
}
|
992
|
-
type AnyWgslStruct = WgslStruct<any>;
|
993
|
-
type AddressSpace = 'uniform' | 'storage' | 'workgroup' | 'private' | 'function' | 'handle';
|
994
|
-
type Access = 'read' | 'write' | 'read-write';
|
995
|
-
interface Ptr<TAddr extends AddressSpace = AddressSpace, TInner extends BaseData = BaseData, // can also be sampler or texture (╯'□')╯︵ ┻━┻
|
996
|
-
TAccess extends Access = Access> {
|
997
|
-
readonly [$internal]: true;
|
998
|
-
readonly type: 'ptr';
|
999
|
-
readonly inner: TInner;
|
1000
|
-
readonly addressSpace: TAddr;
|
1001
|
-
readonly access: TAccess;
|
1002
|
-
readonly [$repr]: Infer<TInner>;
|
1003
|
-
}
|
1004
|
-
/**
|
1005
|
-
* Schema representing the `atomic<...>` WGSL data type.
|
1006
|
-
*/
|
1007
|
-
interface Atomic<TInner extends U32 | I32 = U32 | I32> {
|
1008
|
-
readonly [$internal]: true;
|
1009
|
-
readonly type: 'atomic';
|
1010
|
-
readonly inner: TInner;
|
1011
|
-
readonly [$repr]: Infer<TInner>;
|
1012
|
-
readonly '~gpuRepr': TInner extends U32 ? atomicU32 : atomicI32;
|
1013
|
-
readonly '~memIdent': MemIdentity<TInner>;
|
1014
|
-
}
|
1015
|
-
interface atomicU32 {
|
1016
|
-
readonly [$internal]: true;
|
1017
|
-
readonly type: 'atomicU32';
|
1018
|
-
}
|
1019
|
-
interface atomicI32 {
|
1020
|
-
readonly [$internal]: true;
|
1021
|
-
readonly type: 'atomicI32';
|
1022
|
-
}
|
1023
|
-
interface Align<T extends number> {
|
1024
|
-
readonly [$internal]: true;
|
1025
|
-
readonly type: '@align';
|
1026
|
-
readonly value: T;
|
1027
|
-
}
|
1028
|
-
interface Size<T extends number> {
|
1029
|
-
readonly [$internal]: true;
|
1030
|
-
readonly type: '@size';
|
1031
|
-
readonly value: T;
|
1032
|
-
}
|
1033
|
-
interface Location<T extends number> {
|
1034
|
-
readonly [$internal]: true;
|
1035
|
-
readonly type: '@location';
|
1036
|
-
readonly value: T;
|
1037
|
-
}
|
1038
|
-
type PerspectiveOrLinearInterpolationType = `${'perspective' | 'linear'}${'' | ', center' | ', centroid' | ', sample'}`;
|
1039
|
-
type FlatInterpolationType = `flat${'' | ', first' | ', either'}`;
|
1040
|
-
type InterpolationType = PerspectiveOrLinearInterpolationType | FlatInterpolationType;
|
1041
|
-
interface Interpolate<T extends InterpolationType> {
|
1042
|
-
readonly [$internal]: true;
|
1043
|
-
readonly type: '@interpolate';
|
1044
|
-
readonly value: T;
|
1045
|
-
}
|
1046
|
-
interface Builtin<T extends string> {
|
1047
|
-
readonly [$internal]: true;
|
1048
|
-
readonly type: '@builtin';
|
1049
|
-
readonly value: T;
|
1050
|
-
}
|
1051
|
-
interface Decorated<TInner extends BaseData = BaseData, TAttribs extends unknown[] = unknown[]> {
|
1052
|
-
readonly [$internal]: true;
|
1053
|
-
readonly type: 'decorated';
|
1054
|
-
readonly inner: TInner;
|
1055
|
-
readonly attribs: TAttribs;
|
1056
|
-
readonly [$repr]: Infer<TInner>;
|
1057
|
-
readonly '~gpuRepr': InferGPU<TInner>;
|
1058
|
-
readonly '~reprPartial': InferPartial<TInner>;
|
1059
|
-
readonly '~memIdent': TAttribs extends Location<number>[] ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs> : Decorated<MemIdentity<TInner>, TAttribs>;
|
1060
|
-
}
|
1061
|
-
declare const wgslTypeLiterals: readonly ["bool", "f32", "f16", "i32", "u32", "vec2f", "vec2h", "vec2i", "vec2u", "vec2<bool>", "vec3f", "vec3h", "vec3i", "vec3u", "vec3<bool>", "vec4f", "vec4h", "vec4i", "vec4u", "vec4<bool>", "mat2x2f", "mat3x3f", "mat4x4f", "struct", "array", "ptr", "atomic", "decorated", "abstractInt", "abstractFloat", "void"];
|
1062
|
-
type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];
|
1063
|
-
type PerspectiveOrLinearInterpolatableBaseType = F32 | F16 | Vec2f | Vec2h | Vec3f | Vec3h | Vec4f | Vec4h;
|
1064
|
-
type PerspectiveOrLinearInterpolatableData = PerspectiveOrLinearInterpolatableBaseType | Decorated<PerspectiveOrLinearInterpolatableBaseType>;
|
1065
|
-
type FlatInterpolatableAdditionalBaseType = I32 | U32 | Vec2i | Vec2u | Vec3i | Vec3u | Vec4i | Vec4u;
|
1066
|
-
type FlatInterpolatableData = PerspectiveOrLinearInterpolatableData | FlatInterpolatableAdditionalBaseType | Decorated<FlatInterpolatableAdditionalBaseType>;
|
1067
|
-
type ScalarData = Bool | F32 | F16 | I32 | U32 | AbstractInt | AbstractFloat;
|
1068
|
-
type AnyWgslData = Bool | F32 | F16 | I32 | U32 | Vec2f | Vec2h | Vec2i | Vec2u | Vec2b | Vec3f | Vec3h | Vec3i | Vec3u | Vec3b | Vec4f | Vec4h | Vec4i | Vec4u | Vec4b | Mat2x2f | Mat3x3f | Mat4x4f | AnyWgslStruct | WgslArray | Ptr | Atomic | Decorated | AbstractInt | AbstractFloat | Void;
|
1069
|
-
declare function isWgslData(value: unknown): value is AnyWgslData;
|
1070
|
-
/**
|
1071
|
-
* Checks whether passed in value is an array schema,
|
1072
|
-
* as opposed to, e.g., a disarray schema.
|
1073
|
-
*
|
1074
|
-
* Array schemas can be used to describe uniform and storage buffers,
|
1075
|
-
* whereas disarray schemas cannot.
|
1076
|
-
*
|
1077
|
-
* @example
|
1078
|
-
* isWgslArray(d.arrayOf(d.u32, 4)) // true
|
1079
|
-
* isWgslArray(d.disarray(d.u32, 4)) // false
|
1080
|
-
* isWgslArray(d.vec3f) // false
|
1081
|
-
*/
|
1082
|
-
declare function isWgslArray<T extends WgslArray>(schema: T | unknown): schema is T;
|
1083
|
-
/**
|
1084
|
-
* Checks whether passed in value is a struct schema,
|
1085
|
-
* as opposed to, e.g., an unstruct schema.
|
1086
|
-
*
|
1087
|
-
* Struct schemas can be used to describe uniform and storage buffers,
|
1088
|
-
* whereas unstruct schemas cannot.
|
1089
|
-
*
|
1090
|
-
* @example
|
1091
|
-
* isWgslStruct(d.struct({ a: d.u32 })) // true
|
1092
|
-
* isWgslStruct(d.unstruct({ a: d.u32 })) // false
|
1093
|
-
* isWgslStruct(d.vec3f) // false
|
1094
|
-
*/
|
1095
|
-
declare function isWgslStruct<T extends WgslStruct>(schema: T | unknown): schema is T;
|
1096
|
-
/**
|
1097
|
-
* Checks whether passed in value is a pointer ('function' scope) schema.
|
1098
|
-
*
|
1099
|
-
* @example
|
1100
|
-
* isPtrFn(d.ptrFn(d.f32)) // true
|
1101
|
-
* isPtrFn(d.f32) // false
|
1102
|
-
*/
|
1103
|
-
declare function isPtr<T extends Ptr>(schema: T | unknown): schema is T;
|
1104
|
-
/**
|
1105
|
-
* Checks whether the passed in value is an atomic schema.
|
1106
|
-
*
|
1107
|
-
* @example
|
1108
|
-
* isAtomic(d.atomic(d.u32)) // true
|
1109
|
-
* isAtomic(d.u32) // false
|
1110
|
-
*/
|
1111
|
-
declare function isAtomic<T extends Atomic<U32 | I32>>(schema: T | unknown): schema is T;
|
1112
|
-
declare function isAlignAttrib<T extends Align<number>>(value: unknown | T): value is T;
|
1113
|
-
declare function isSizeAttrib<T extends Size<number>>(value: unknown | T): value is T;
|
1114
|
-
declare function isLocationAttrib<T extends Location<number>>(value: unknown | T): value is T;
|
1115
|
-
declare function isInterpolateAttrib<T extends Interpolate<InterpolationType>>(value: unknown | T): value is T;
|
1116
|
-
declare function isBuiltinAttrib<T extends Builtin<string>>(value: unknown | T): value is T;
|
1117
|
-
declare function isDecorated<T extends Decorated>(value: unknown | T): value is T;
|
1118
|
-
|
1119
|
-
declare const vertexFormats: readonly ["uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra"];
|
1120
|
-
type VertexFormat = (typeof vertexFormats)[number];
|
1121
|
-
declare const kindToDefaultFormatMap: {
|
1122
|
-
readonly f32: "float32";
|
1123
|
-
readonly vec2f: "float32x2";
|
1124
|
-
readonly vec3f: "float32x3";
|
1125
|
-
readonly vec4f: "float32x4";
|
1126
|
-
readonly f16: "float16";
|
1127
|
-
readonly vec2h: "float16x2";
|
1128
|
-
readonly vec4h: "float16x4";
|
1129
|
-
readonly u32: "uint32";
|
1130
|
-
readonly vec2u: "uint32x2";
|
1131
|
-
readonly vec3u: "uint32x3";
|
1132
|
-
readonly vec4u: "uint32x4";
|
1133
|
-
readonly i32: "sint32";
|
1134
|
-
readonly vec2i: "sint32x2";
|
1135
|
-
readonly vec3i: "sint32x3";
|
1136
|
-
readonly vec4i: "sint32x4";
|
1137
|
-
};
|
1138
|
-
type KindToDefaultFormatMap = typeof kindToDefaultFormatMap;
|
1139
|
-
interface TgpuVertexAttrib<TFormat extends VertexFormat = VertexFormat> {
|
1140
|
-
readonly format: TFormat;
|
1141
|
-
readonly offset: number;
|
1142
|
-
}
|
1143
|
-
/**
|
1144
|
-
* All vertex attribute formats that can be interpreted as
|
1145
|
-
* an single or multi component u32 in a shader.
|
1146
|
-
* https://www.w3.org/TR/webgpu/#vertex-formats
|
1147
|
-
*/
|
1148
|
-
type U32CompatibleFormats = TgpuVertexAttrib<'uint8'> | TgpuVertexAttrib<'uint8x2'> | TgpuVertexAttrib<'uint8x4'> | TgpuVertexAttrib<'uint16'> | TgpuVertexAttrib<'uint16x2'> | TgpuVertexAttrib<'uint16x4'> | TgpuVertexAttrib<'uint32'> | TgpuVertexAttrib<'uint32x2'> | TgpuVertexAttrib<'uint32x3'> | TgpuVertexAttrib<'uint32x4'>;
|
1149
|
-
/**
|
1150
|
-
* All vertex attribute formats that can be interpreted as
|
1151
|
-
* an single or multi component i32 in a shader.
|
1152
|
-
* https://www.w3.org/TR/webgpu/#vertex-formats
|
1153
|
-
*/
|
1154
|
-
type I32CompatibleFormats = TgpuVertexAttrib<'sint8'> | TgpuVertexAttrib<'sint8x2'> | TgpuVertexAttrib<'sint8x4'> | TgpuVertexAttrib<'sint16'> | TgpuVertexAttrib<'sint16x2'> | TgpuVertexAttrib<'sint16x4'> | TgpuVertexAttrib<'sint32'> | TgpuVertexAttrib<'sint32x2'> | TgpuVertexAttrib<'sint32x3'> | TgpuVertexAttrib<'sint32x4'>;
|
1155
|
-
/**
|
1156
|
-
* All vertex attribute formats that can be interpreted as
|
1157
|
-
* an single or multi component f32 in a shader.
|
1158
|
-
* https://www.w3.org/TR/webgpu/#vertex-formats
|
1159
|
-
*/
|
1160
|
-
type F32CompatibleFormats = TgpuVertexAttrib<'unorm8'> | TgpuVertexAttrib<'unorm8x2'> | TgpuVertexAttrib<'unorm8x4'> | TgpuVertexAttrib<'snorm8'> | TgpuVertexAttrib<'snorm8x2'> | TgpuVertexAttrib<'snorm8x4'> | TgpuVertexAttrib<'unorm16'> | TgpuVertexAttrib<'unorm16x2'> | TgpuVertexAttrib<'unorm16x4'> | TgpuVertexAttrib<'snorm16'> | TgpuVertexAttrib<'snorm16x2'> | TgpuVertexAttrib<'snorm16x4'> | TgpuVertexAttrib<'float16'> | TgpuVertexAttrib<'float16x2'> | TgpuVertexAttrib<'float16x4'> | TgpuVertexAttrib<'float32'> | TgpuVertexAttrib<'float32x2'> | TgpuVertexAttrib<'float32x3'> | TgpuVertexAttrib<'float32x4'> | TgpuVertexAttrib<'unorm10-10-10-2'> | TgpuVertexAttrib<'unorm8x4-bgra'>;
|
1161
|
-
/**
|
1162
|
-
* All vertex attribute formats that can be interpreted as
|
1163
|
-
* a single or multi component f16 in a shader. (same as f32 on the shader side)
|
1164
|
-
* https://www.w3.org/TR/webgpu/#vertex-formats
|
1165
|
-
*/
|
1166
|
-
type F16CompatibleFormats = F32CompatibleFormats;
|
1167
|
-
type KindToAcceptedAttribMap = {
|
1168
|
-
u32: U32CompatibleFormats;
|
1169
|
-
vec2u: U32CompatibleFormats;
|
1170
|
-
vec3u: U32CompatibleFormats;
|
1171
|
-
vec4u: U32CompatibleFormats;
|
1172
|
-
i32: I32CompatibleFormats;
|
1173
|
-
vec2i: I32CompatibleFormats;
|
1174
|
-
vec3i: I32CompatibleFormats;
|
1175
|
-
vec4i: I32CompatibleFormats;
|
1176
|
-
f16: F16CompatibleFormats;
|
1177
|
-
vec2h: F16CompatibleFormats;
|
1178
|
-
vec3h: F16CompatibleFormats;
|
1179
|
-
vec4h: F16CompatibleFormats;
|
1180
|
-
f32: F32CompatibleFormats;
|
1181
|
-
vec2f: F32CompatibleFormats;
|
1182
|
-
vec3f: F32CompatibleFormats;
|
1183
|
-
vec4f: F32CompatibleFormats;
|
1184
|
-
};
|
1185
|
-
|
1186
|
-
type FormatToWGSLType<T extends VertexFormat> = (typeof formatToWGSLType)[T];
|
1187
|
-
interface TgpuVertexFormatData<T extends VertexFormat> {
|
1188
|
-
readonly [$internal]: true;
|
1189
|
-
readonly type: T;
|
1190
|
-
readonly [$repr]: Infer<FormatToWGSLType<T>>;
|
1191
|
-
}
|
1192
|
-
declare const formatToWGSLType: {
|
1193
|
-
readonly uint8: U32;
|
1194
|
-
readonly uint8x2: Vec2u;
|
1195
|
-
readonly uint8x4: Vec4u;
|
1196
|
-
readonly sint8: I32;
|
1197
|
-
readonly sint8x2: Vec2i;
|
1198
|
-
readonly sint8x4: Vec4i;
|
1199
|
-
readonly unorm8: F32;
|
1200
|
-
readonly unorm8x2: Vec2f;
|
1201
|
-
readonly unorm8x4: Vec4f;
|
1202
|
-
readonly snorm8: F32;
|
1203
|
-
readonly snorm8x2: Vec2f;
|
1204
|
-
readonly snorm8x4: Vec4f;
|
1205
|
-
readonly uint16: U32;
|
1206
|
-
readonly uint16x2: Vec2u;
|
1207
|
-
readonly uint16x4: Vec4u;
|
1208
|
-
readonly sint16: I32;
|
1209
|
-
readonly sint16x2: Vec2i;
|
1210
|
-
readonly sint16x4: Vec4i;
|
1211
|
-
readonly unorm16: F32;
|
1212
|
-
readonly unorm16x2: Vec2f;
|
1213
|
-
readonly unorm16x4: Vec4f;
|
1214
|
-
readonly snorm16: F32;
|
1215
|
-
readonly snorm16x2: Vec2f;
|
1216
|
-
readonly snorm16x4: Vec4f;
|
1217
|
-
readonly float16: F32;
|
1218
|
-
readonly float16x2: Vec2f;
|
1219
|
-
readonly float16x4: Vec4f;
|
1220
|
-
readonly float32: F32;
|
1221
|
-
readonly float32x2: Vec2f;
|
1222
|
-
readonly float32x3: Vec3f;
|
1223
|
-
readonly float32x4: Vec4f;
|
1224
|
-
readonly uint32: U32;
|
1225
|
-
readonly uint32x2: Vec2u;
|
1226
|
-
readonly uint32x3: Vec3u;
|
1227
|
-
readonly uint32x4: Vec4u;
|
1228
|
-
readonly sint32: I32;
|
1229
|
-
readonly sint32x2: Vec2i;
|
1230
|
-
readonly sint32x3: Vec3i;
|
1231
|
-
readonly sint32x4: Vec4i;
|
1232
|
-
readonly 'unorm10-10-10-2': Vec4f;
|
1233
|
-
readonly 'unorm8x4-bgra': Vec4f;
|
1234
|
-
};
|
1235
|
-
declare const packedFormats: string[];
|
1236
|
-
type uint8 = TgpuVertexFormatData<'uint8'>;
|
1237
|
-
declare const uint8: uint8;
|
1238
|
-
type uint8x2 = TgpuVertexFormatData<'uint8x2'>;
|
1239
|
-
declare const uint8x2: uint8x2;
|
1240
|
-
type uint8x4 = TgpuVertexFormatData<'uint8x4'>;
|
1241
|
-
declare const uint8x4: uint8x4;
|
1242
|
-
type sint8 = TgpuVertexFormatData<'sint8'>;
|
1243
|
-
declare const sint8: sint8;
|
1244
|
-
type sint8x2 = TgpuVertexFormatData<'sint8x2'>;
|
1245
|
-
declare const sint8x2: sint8x2;
|
1246
|
-
type sint8x4 = TgpuVertexFormatData<'sint8x4'>;
|
1247
|
-
declare const sint8x4: sint8x4;
|
1248
|
-
type unorm8 = TgpuVertexFormatData<'unorm8'>;
|
1249
|
-
declare const unorm8: unorm8;
|
1250
|
-
type unorm8x2 = TgpuVertexFormatData<'unorm8x2'>;
|
1251
|
-
declare const unorm8x2: unorm8x2;
|
1252
|
-
type unorm8x4 = TgpuVertexFormatData<'unorm8x4'>;
|
1253
|
-
declare const unorm8x4: unorm8x4;
|
1254
|
-
type snorm8 = TgpuVertexFormatData<'snorm8'>;
|
1255
|
-
declare const snorm8: snorm8;
|
1256
|
-
type snorm8x2 = TgpuVertexFormatData<'snorm8x2'>;
|
1257
|
-
declare const snorm8x2: snorm8x2;
|
1258
|
-
type snorm8x4 = TgpuVertexFormatData<'snorm8x4'>;
|
1259
|
-
declare const snorm8x4: snorm8x4;
|
1260
|
-
type uint16 = TgpuVertexFormatData<'uint16'>;
|
1261
|
-
declare const uint16: uint16;
|
1262
|
-
type uint16x2 = TgpuVertexFormatData<'uint16x2'>;
|
1263
|
-
declare const uint16x2: uint16x2;
|
1264
|
-
type uint16x4 = TgpuVertexFormatData<'uint16x4'>;
|
1265
|
-
declare const uint16x4: uint16x4;
|
1266
|
-
type sint16 = TgpuVertexFormatData<'sint16'>;
|
1267
|
-
declare const sint16: sint16;
|
1268
|
-
type sint16x2 = TgpuVertexFormatData<'sint16x2'>;
|
1269
|
-
declare const sint16x2: sint16x2;
|
1270
|
-
type sint16x4 = TgpuVertexFormatData<'sint16x4'>;
|
1271
|
-
declare const sint16x4: sint16x4;
|
1272
|
-
type unorm16 = TgpuVertexFormatData<'unorm16'>;
|
1273
|
-
declare const unorm16: unorm16;
|
1274
|
-
type unorm16x2 = TgpuVertexFormatData<'unorm16x2'>;
|
1275
|
-
declare const unorm16x2: unorm16x2;
|
1276
|
-
type unorm16x4 = TgpuVertexFormatData<'unorm16x4'>;
|
1277
|
-
declare const unorm16x4: unorm16x4;
|
1278
|
-
type snorm16 = TgpuVertexFormatData<'snorm16'>;
|
1279
|
-
declare const snorm16: snorm16;
|
1280
|
-
type snorm16x2 = TgpuVertexFormatData<'snorm16x2'>;
|
1281
|
-
declare const snorm16x2: snorm16x2;
|
1282
|
-
type snorm16x4 = TgpuVertexFormatData<'snorm16x4'>;
|
1283
|
-
declare const snorm16x4: snorm16x4;
|
1284
|
-
type float16 = TgpuVertexFormatData<'float16'>;
|
1285
|
-
declare const float16: float16;
|
1286
|
-
type float16x2 = TgpuVertexFormatData<'float16x2'>;
|
1287
|
-
declare const float16x2: float16x2;
|
1288
|
-
type float16x4 = TgpuVertexFormatData<'float16x4'>;
|
1289
|
-
declare const float16x4: float16x4;
|
1290
|
-
type float32 = TgpuVertexFormatData<'float32'>;
|
1291
|
-
declare const float32: float32;
|
1292
|
-
type float32x2 = TgpuVertexFormatData<'float32x2'>;
|
1293
|
-
declare const float32x2: float32x2;
|
1294
|
-
type float32x3 = TgpuVertexFormatData<'float32x3'>;
|
1295
|
-
declare const float32x3: float32x3;
|
1296
|
-
type float32x4 = TgpuVertexFormatData<'float32x4'>;
|
1297
|
-
declare const float32x4: float32x4;
|
1298
|
-
type uint32 = TgpuVertexFormatData<'uint32'>;
|
1299
|
-
declare const uint32: uint32;
|
1300
|
-
type uint32x2 = TgpuVertexFormatData<'uint32x2'>;
|
1301
|
-
declare const uint32x2: uint32x2;
|
1302
|
-
type uint32x3 = TgpuVertexFormatData<'uint32x3'>;
|
1303
|
-
declare const uint32x3: uint32x3;
|
1304
|
-
type uint32x4 = TgpuVertexFormatData<'uint32x4'>;
|
1305
|
-
declare const uint32x4: uint32x4;
|
1306
|
-
type sint32 = TgpuVertexFormatData<'sint32'>;
|
1307
|
-
declare const sint32: sint32;
|
1308
|
-
type sint32x2 = TgpuVertexFormatData<'sint32x2'>;
|
1309
|
-
declare const sint32x2: sint32x2;
|
1310
|
-
type sint32x3 = TgpuVertexFormatData<'sint32x3'>;
|
1311
|
-
declare const sint32x3: sint32x3;
|
1312
|
-
type sint32x4 = TgpuVertexFormatData<'sint32x4'>;
|
1313
|
-
declare const sint32x4: sint32x4;
|
1314
|
-
type unorm10_10_10_2 = TgpuVertexFormatData<'unorm10-10-10-2'>;
|
1315
|
-
declare const unorm10_10_10_2: unorm10_10_10_2;
|
1316
|
-
type unorm8x4_bgra = TgpuVertexFormatData<'unorm8x4-bgra'>;
|
1317
|
-
declare const unorm8x4_bgra: unorm8x4_bgra;
|
1318
|
-
type PackedData = uint8 | uint8x2 | uint8x4 | sint8 | sint8x2 | sint8x4 | unorm8 | unorm8x2 | unorm8x4 | snorm8 | snorm8x2 | snorm8x4 | uint16 | uint16x2 | uint16x4 | sint16 | sint16x2 | sint16x4 | unorm16 | unorm16x2 | unorm16x4 | snorm16 | snorm16x2 | snorm16x4 | float16 | float16x2 | float16x4 | float32 | float32x2 | float32x3 | float32x4 | uint32 | uint32x2 | uint32x3 | uint32x4 | sint32 | sint32x2 | sint32x3 | sint32x4 | unorm10_10_10_2 | unorm8x4_bgra;
|
1319
|
-
|
1320
|
-
type TgpuDualFn<TImpl extends (...args: unknown[]) => unknown> = TImpl & {
|
1321
|
-
[$internal]: true;
|
1322
|
-
};
|
1323
|
-
/**
|
1324
|
-
* Array schema constructed via `d.disarrayOf` function.
|
1325
|
-
*
|
1326
|
-
* Useful for defining vertex buffers.
|
1327
|
-
* Elements in the schema are not aligned in respect to their `byteAlignment`,
|
1328
|
-
* unless they are explicitly decorated with the custom align attribute
|
1329
|
-
* via `d.align` function.
|
1330
|
-
*/
|
1331
|
-
interface Disarray<TElement extends BaseData = BaseData> {
|
1332
|
-
readonly [$internal]: true;
|
1333
|
-
readonly type: 'disarray';
|
1334
|
-
readonly elementCount: number;
|
1335
|
-
readonly elementType: TElement;
|
1336
|
-
readonly [$repr]: Infer<TElement>[];
|
1337
|
-
readonly '~reprPartial': {
|
1338
|
-
idx: number;
|
1339
|
-
value: InferPartial<TElement>;
|
1340
|
-
}[];
|
1341
|
-
}
|
1342
|
-
/**
|
1343
|
-
* Struct schema constructed via `d.unstruct` function.
|
1344
|
-
*
|
1345
|
-
* Useful for defining vertex buffers, as the standard layout restrictions do not apply.
|
1346
|
-
* Members are not aligned in respect to their `byteAlignment`,
|
1347
|
-
* unless they are explicitly decorated with the custom align attribute
|
1348
|
-
* via `d.align` function.
|
1349
|
-
*/
|
1350
|
-
interface Unstruct<TProps extends Record<string, BaseData> = Record<string, BaseData>> extends TgpuNamable {
|
1351
|
-
readonly [$internal]: true;
|
1352
|
-
(props: Prettify<InferRecord<TProps>>): Prettify<InferRecord<TProps>>;
|
1353
|
-
readonly label?: string | undefined;
|
1354
|
-
readonly type: 'unstruct';
|
1355
|
-
readonly propTypes: TProps;
|
1356
|
-
readonly [$repr]: Prettify<InferRecord<TProps>>;
|
1357
|
-
readonly '~gpuRepr': Prettify<InferGPURecord<TProps>>;
|
1358
|
-
readonly '~memIdent': Unstruct<Prettify<MemIdentityRecord<TProps>>>;
|
1359
|
-
readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
|
1360
|
-
}
|
1361
|
-
type AnyUnstruct = Unstruct<any>;
|
1362
|
-
interface LooseDecorated<TInner extends BaseData = BaseData, TAttribs extends unknown[] = unknown[]> {
|
1363
|
-
readonly [$internal]: true;
|
1364
|
-
readonly type: 'loose-decorated';
|
1365
|
-
readonly inner: TInner;
|
1366
|
-
readonly attribs: TAttribs;
|
1367
|
-
readonly [$repr]: Infer<TInner>;
|
1368
|
-
}
|
1369
|
-
declare const looseTypeLiterals: readonly ["unstruct", "disarray", "loose-decorated", "uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra"];
|
1370
|
-
type LooseTypeLiteral = (typeof looseTypeLiterals)[number];
|
1371
|
-
type AnyLooseData = Disarray | AnyUnstruct | LooseDecorated | PackedData;
|
1372
|
-
declare function isLooseData(data: unknown): data is AnyLooseData;
|
1373
|
-
/**
|
1374
|
-
* Checks whether the passed in value is a disarray schema,
|
1375
|
-
* as opposed to, e.g., a regular array schema.
|
1376
|
-
*
|
1377
|
-
* Array schemas can be used to describe uniform and storage buffers,
|
1378
|
-
* whereas disarray schemas cannot. Disarrays are useful for
|
1379
|
-
* defining vertex buffers instead.
|
1380
|
-
*
|
1381
|
-
* @example
|
1382
|
-
* isDisarray(d.arrayOf(d.u32, 4)) // false
|
1383
|
-
* isDisarray(d.disarrayOf(d.u32, 4)) // true
|
1384
|
-
* isDisarray(d.vec3f) // false
|
1385
|
-
*/
|
1386
|
-
declare function isDisarray<T extends Disarray>(schema: T | unknown): schema is T;
|
1387
|
-
/**
|
1388
|
-
* Checks whether passed in value is a unstruct schema,
|
1389
|
-
* as opposed to, e.g., a struct schema.
|
1390
|
-
*
|
1391
|
-
* Struct schemas can be used to describe uniform and storage buffers,
|
1392
|
-
* whereas unstruct schemas cannot. Unstructs are useful for
|
1393
|
-
* defining vertex buffers instead.
|
1394
|
-
*
|
1395
|
-
* @example
|
1396
|
-
* isUnstruct(d.struct({ a: d.u32 })) // false
|
1397
|
-
* isUnstruct(d.unstruct({ a: d.u32 })) // true
|
1398
|
-
* isUnstruct(d.vec3f) // false
|
1399
|
-
*/
|
1400
|
-
declare function isUnstruct<T extends Unstruct>(schema: T | unknown): schema is T;
|
1401
|
-
declare function isLooseDecorated<T extends LooseDecorated>(value: T | unknown): value is T;
|
1402
|
-
declare function isData(value: unknown): value is AnyData;
|
1403
|
-
type AnyData = AnyWgslData | AnyLooseData;
|
1404
|
-
|
1405
|
-
export { $internal as $, type AnyWgslData as A, type BaseData as B, type Default as C, type Decorated as D, type InferGPU as E, type F32 as F, type AnyVecInstance as G, type AnyMatInstance as H, type Infer as I, type Bool as J, type KindToDefaultFormatMap as K, type Location as L, type Mutable as M, type Ptr as N, type OmitProps as O, type Prettify as P, type Vec2b as Q, type Vec3b as R, type Vec4b as S, type TgpuNamable as T, type U32 as U, type Vec2f as V, type WgslStruct as W, type Unstruct as X, type Mat2x2f as Y, type Mat3x3f as Z, type Mat4x4f as _, type F16 as a, float16 as a$, type m2x2f as a0, type m3x3f as a1, type m4x4f as a2, type Atomic as a3, isWgslData as a4, isWgslArray as a5, isWgslStruct as a6, isPtr as a7, isAtomic as a8, isDecorated as a9, type TgpuVertexFormatData as aA, formatToWGSLType as aB, packedFormats as aC, uint8 as aD, uint8x2 as aE, uint8x4 as aF, sint8 as aG, sint8x2 as aH, sint8x4 as aI, unorm8 as aJ, unorm8x2 as aK, unorm8x4 as aL, snorm8 as aM, snorm8x2 as aN, snorm8x4 as aO, uint16 as aP, uint16x2 as aQ, uint16x4 as aR, sint16 as aS, sint16x2 as aT, sint16x4 as aU, unorm16 as aV, unorm16x2 as aW, unorm16x4 as aX, snorm16 as aY, snorm16x2 as aZ, snorm16x4 as a_, isAlignAttrib as aa, isBuiltinAttrib as ab, isLocationAttrib as ac, isInterpolateAttrib as ad, isSizeAttrib as ae, type Size as af, type Align as ag, type Builtin as ah, type Interpolate as ai, type v2f as aj, type v2i as ak, type v2u as al, type v3f as am, type v3i as an, type v3u as ao, type v4f as ap, type v4i as aq, type v4u as ar, type LooseDecorated as as, type AnyLooseData as at, isDisarray as au, isUnstruct as av, isLooseDecorated as aw, isData as ax, isLooseData as ay, type FormatToWGSLType as az, type I32 as b, float16x2 as b0, float16x4 as b1, float32 as b2, float32x2 as b3, float32x3 as b4, float32x4 as b5, uint32 as b6, uint32x2 as b7, uint32x3 as b8, uint32x4 as b9, type atomicU32 as bA, sint32 as ba, sint32x2 as bb, sint32x3 as bc, sint32x4 as bd, unorm10_10_10_2 as be, unorm8x4_bgra as bf, type PackedData as bg, type InterpolationType as bh, type LooseTypeLiteral as bi, type PerspectiveOrLinearInterpolationType as bj, type PerspectiveOrLinearInterpolatableData as bk, type FlatInterpolationType as bl, type FlatInterpolatableData as bm, type TgpuDualFn as bn, type AnyNumericVecInstance as bo, type vBaseForMat as bp, type AnyFloatVecInstance as bq, type v3h as br, type AnyVec2Instance as bs, type v2b as bt, type AnyVec3Instance as bu, type v3b as bv, type v4b as bw, type AnyBooleanVecInstance as bx, type ScalarData as by, type atomicI32 as bz, 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 AnyWgslStruct as n, $repr as o, type WgslArray as p, type Disarray as q, type AnyUnstruct as r, type VertexFormat as s, type TgpuVertexAttrib as t, type KindToAcceptedAttribMap as u, type AnyData as v, type WgslTypeLiteral as w, type UnionToIntersection as x, type InferPartial as y, type MemIdentity as z };
|