typegpu 0.4.3 → 0.4.5
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/{attributes-Dri8dk1v.d.ts → attributes-B4JpvOTz.d.ts} +1 -1
- package/{attributes--1y4Kirx.d.cts → attributes-DSOqT8yA.d.cts} +1 -1
- package/chunk-7S2KQX6O.js +4 -0
- package/chunk-7S2KQX6O.js.map +1 -0
- package/chunk-JSF3RDCP.js +2 -0
- package/chunk-JSF3RDCP.js.map +1 -0
- package/chunk-TLEBUZ6A.cjs +4 -0
- package/{chunk-7X4KDNDZ.cjs.map → chunk-TLEBUZ6A.cjs.map} +1 -1
- package/chunk-WVFPBCIE.cjs +2 -0
- package/chunk-WVFPBCIE.cjs.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.cjs.map +1 -1
- package/data/index.d.cts +10 -5
- package/data/index.d.ts +10 -5
- package/data/index.js +1 -1
- package/index.cjs +12 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +107 -102
- package/index.d.ts +107 -102
- package/index.js +12 -10
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/std/index.cjs +1 -1
- package/std/index.cjs.map +1 -1
- package/std/index.d.cts +20 -2
- package/std/index.d.ts +20 -2
- package/std/index.js +1 -1
- package/std/index.js.map +1 -1
- package/{wgslTypes-D0JqCGnw.d.ts → wgslTypes-VtSRoe90.d.cts} +112 -28
- package/{wgslTypes-D0JqCGnw.d.cts → wgslTypes-VtSRoe90.d.ts} +112 -28
- package/chunk-7X4KDNDZ.cjs +0 -4
- package/chunk-O7JKWPDH.cjs +0 -2
- package/chunk-O7JKWPDH.cjs.map +0 -1
- package/chunk-OERXDFXG.js +0 -2
- package/chunk-OERXDFXG.js.map +0 -1
- package/chunk-ZHXAQ2YE.js +0 -4
- package/chunk-ZHXAQ2YE.js.map +0 -1
@@ -6,6 +6,24 @@ interface TgpuNamable {
|
|
6
6
|
$name(label?: string | undefined): this;
|
7
7
|
}
|
8
8
|
|
9
|
+
type Default<T, TDefault> = unknown extends T ? TDefault : T extends undefined ? TDefault : T;
|
10
|
+
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
11
|
+
type Prettify<T> = {
|
12
|
+
[K in keyof T]: T[K];
|
13
|
+
} & {};
|
14
|
+
/**
|
15
|
+
* Removes properties from record type that extend `Prop`
|
16
|
+
*/
|
17
|
+
type OmitProps<T extends Record<string, unknown>, Prop> = Pick<T, {
|
18
|
+
[Key in keyof T]: T[Key] extends Prop ? never : Key;
|
19
|
+
}[keyof T]>;
|
20
|
+
/**
|
21
|
+
* The opposite of Readonly<T>
|
22
|
+
*/
|
23
|
+
type Mutable<T> = {
|
24
|
+
-readonly [P in keyof T]: T[P];
|
25
|
+
};
|
26
|
+
|
9
27
|
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"];
|
10
28
|
type VertexFormat = (typeof vertexFormats)[number];
|
11
29
|
declare const kindToDefaultFormatMap: {
|
@@ -236,8 +254,8 @@ interface Unstruct<TProps extends Record<string, BaseData> = Record<string, Base
|
|
236
254
|
readonly label?: string | undefined;
|
237
255
|
readonly type: 'unstruct';
|
238
256
|
readonly propTypes: TProps;
|
239
|
-
readonly '~repr': InferRecord<TProps
|
240
|
-
readonly '~reprPartial': Partial<InferPartialRecord<TProps
|
257
|
+
readonly '~repr': Prettify<InferRecord<TProps>>;
|
258
|
+
readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
|
241
259
|
}
|
242
260
|
interface LooseDecorated<TInner extends BaseData = BaseData, TAttribs extends unknown[] = unknown[]> {
|
243
261
|
readonly type: 'loose-decorated';
|
@@ -295,12 +313,18 @@ type InferPartial<T> = T extends {
|
|
295
313
|
} ? TRepr : T extends {
|
296
314
|
readonly '~repr': infer TRepr;
|
297
315
|
} ? TRepr | undefined : T extends Record<string | number | symbol, unknown> ? InferPartialRecord<T> : T;
|
316
|
+
type InferGPU<T> = T extends {
|
317
|
+
readonly '~gpuRepr': infer TRepr;
|
318
|
+
} ? TRepr : Infer<T>;
|
298
319
|
type InferRecord<T extends Record<string | number | symbol, unknown>> = {
|
299
320
|
[Key in keyof T]: Infer<T[Key]>;
|
300
321
|
};
|
301
322
|
type InferPartialRecord<T extends Record<string | number | symbol, unknown>> = {
|
302
323
|
[Key in keyof T]: InferPartial<T[Key]>;
|
303
324
|
};
|
325
|
+
type InferGPURecord<T extends Record<string | number | symbol, unknown>> = {
|
326
|
+
[Key in keyof T]: InferGPU<T[Key]>;
|
327
|
+
};
|
304
328
|
type MemIdentity<T> = T extends {
|
305
329
|
readonly '~memIdent': infer TMemIdent extends AnyData;
|
306
330
|
} ? TMemIdent : T;
|
@@ -308,24 +332,6 @@ type MemIdentityRecord<T extends Record<string | number | symbol, unknown>> = {
|
|
308
332
|
[Key in keyof T]: MemIdentity<T[Key]>;
|
309
333
|
};
|
310
334
|
|
311
|
-
type Default<T, TDefault> = unknown extends T ? TDefault : T extends undefined ? TDefault : T;
|
312
|
-
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
313
|
-
type Prettify<T> = {
|
314
|
-
[K in keyof T]: T[K];
|
315
|
-
} & {};
|
316
|
-
/**
|
317
|
-
* Removes properties from record type that extend `Prop`
|
318
|
-
*/
|
319
|
-
type OmitProps<T extends Record<string, unknown>, Prop> = Pick<T, {
|
320
|
-
[Key in keyof T]: T[Key] extends Prop ? never : Key;
|
321
|
-
}[keyof T]>;
|
322
|
-
/**
|
323
|
-
* The opposite of Readonly<T>
|
324
|
-
*/
|
325
|
-
type Mutable<T> = {
|
326
|
-
-readonly [P in keyof T]: T[P];
|
327
|
-
};
|
328
|
-
|
329
335
|
/**
|
330
336
|
* Struct schema constructed via `d.struct` function.
|
331
337
|
*
|
@@ -339,11 +345,13 @@ interface WgslStruct<TProps extends Record<string, BaseData> = Record<string, Ba
|
|
339
345
|
readonly label?: string | undefined;
|
340
346
|
readonly propTypes: TProps;
|
341
347
|
/** Type-token, not available at runtime */
|
342
|
-
readonly '~repr': InferRecord<TProps
|
348
|
+
readonly '~repr': Prettify<InferRecord<TProps>>;
|
349
|
+
/** Type-token, not available at runtime */
|
350
|
+
readonly '~gpuRepr': InferGPURecord<TProps>;
|
343
351
|
/** Type-token, not available at runtime */
|
344
352
|
readonly '~memIdent': WgslStruct<MemIdentityRecord<TProps>>;
|
345
353
|
/** Type-token, not available at runtime */
|
346
|
-
readonly '~reprPartial': Partial<InferPartialRecord<TProps
|
354
|
+
readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
|
347
355
|
}
|
348
356
|
type AnyWgslStruct = WgslStruct<any>;
|
349
357
|
/**
|
@@ -369,6 +377,20 @@ interface BaseData {
|
|
369
377
|
/** Type-token, not available at runtime */
|
370
378
|
readonly '~repr': unknown;
|
371
379
|
}
|
380
|
+
/**
|
381
|
+
* Represents a 64-bit integer.
|
382
|
+
*/
|
383
|
+
interface AbstractInt {
|
384
|
+
readonly type: 'abstractInt';
|
385
|
+
readonly '~repr': number;
|
386
|
+
}
|
387
|
+
/**
|
388
|
+
* Represents a 64-bit IEEE 754 floating point number.
|
389
|
+
*/
|
390
|
+
interface AbstractFloat {
|
391
|
+
readonly type: 'abstractFloat';
|
392
|
+
readonly '~repr': number;
|
393
|
+
}
|
372
394
|
interface Swizzle2<T2, T3, T4> {
|
373
395
|
readonly xx: T2;
|
374
396
|
readonly xy: T2;
|
@@ -807,6 +829,9 @@ interface v4u extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {
|
|
807
829
|
w: number;
|
808
830
|
}
|
809
831
|
type AnyVecInstance = v2f | v2h | v2i | v2u | v3f | v3h | v3i | v3u | v4f | v4h | v4i | v4u;
|
832
|
+
type AnyVec2Instance = v2f | v2h | v2i | v2u;
|
833
|
+
type AnyVec3Instance = v3f | v3h | v3i | v3u;
|
834
|
+
type AnyVec4Instance = v4f | v4h | v4i | v4u;
|
810
835
|
type VecKind = AnyVecInstance['kind'];
|
811
836
|
interface matBase<TColumn> extends NumberArrayView {
|
812
837
|
readonly columns: readonly TColumn[];
|
@@ -917,6 +942,7 @@ interface Vec2f {
|
|
917
942
|
(x: number, y: number): v2f;
|
918
943
|
(xy: number): v2f;
|
919
944
|
(): v2f;
|
945
|
+
(v: AnyVec2Instance): v2f;
|
920
946
|
}
|
921
947
|
/**
|
922
948
|
* Type of the `d.vec2h` object/function: vector data type schema/constructor
|
@@ -928,6 +954,7 @@ interface Vec2h {
|
|
928
954
|
(x: number, y: number): v2h;
|
929
955
|
(xy: number): v2h;
|
930
956
|
(): v2h;
|
957
|
+
(v: AnyVec2Instance): v2h;
|
931
958
|
}
|
932
959
|
/**
|
933
960
|
* Type of the `d.vec2i` object/function: vector data type schema/constructor
|
@@ -939,6 +966,7 @@ interface Vec2i {
|
|
939
966
|
(x: number, y: number): v2i;
|
940
967
|
(xy: number): v2i;
|
941
968
|
(): v2i;
|
969
|
+
(v: AnyVec2Instance): v2i;
|
942
970
|
}
|
943
971
|
/**
|
944
972
|
* Type of the `d.vec2u` object/function: vector data type schema/constructor
|
@@ -950,6 +978,7 @@ interface Vec2u {
|
|
950
978
|
(x: number, y: number): v2u;
|
951
979
|
(xy: number): v2u;
|
952
980
|
(): v2u;
|
981
|
+
(v: AnyVec2Instance): v2u;
|
953
982
|
}
|
954
983
|
/**
|
955
984
|
* Type of the `d.vec3f` object/function: vector data type schema/constructor
|
@@ -961,6 +990,9 @@ interface Vec3f {
|
|
961
990
|
(x: number, y: number, z: number): v3f;
|
962
991
|
(xyz: number): v3f;
|
963
992
|
(): v3f;
|
993
|
+
(v: AnyVec3Instance): v3f;
|
994
|
+
(v0: AnyVec2Instance, z: number): v3f;
|
995
|
+
(x: number, v0: AnyVec2Instance): v3f;
|
964
996
|
}
|
965
997
|
/**
|
966
998
|
* Type of the `d.vec3h` object/function: vector data type schema/constructor
|
@@ -972,6 +1004,9 @@ interface Vec3h {
|
|
972
1004
|
(x: number, y: number, z: number): v3h;
|
973
1005
|
(xyz: number): v3h;
|
974
1006
|
(): v3h;
|
1007
|
+
(v: AnyVec3Instance): v3h;
|
1008
|
+
(v0: AnyVec2Instance, z: number): v3h;
|
1009
|
+
(x: number, v0: AnyVec2Instance): v3h;
|
975
1010
|
}
|
976
1011
|
/**
|
977
1012
|
* Type of the `d.vec3i` object/function: vector data type schema/constructor
|
@@ -983,6 +1018,9 @@ interface Vec3i {
|
|
983
1018
|
(x: number, y: number, z: number): v3i;
|
984
1019
|
(xyz: number): v3i;
|
985
1020
|
(): v3i;
|
1021
|
+
(v: AnyVec3Instance): v3i;
|
1022
|
+
(v0: AnyVec2Instance, z: number): v3i;
|
1023
|
+
(x: number, v0: AnyVec2Instance): v3i;
|
986
1024
|
}
|
987
1025
|
/**
|
988
1026
|
* Type of the `d.vec3u` object/function: vector data type schema/constructor
|
@@ -994,6 +1032,9 @@ interface Vec3u {
|
|
994
1032
|
(x: number, y: number, z: number): v3u;
|
995
1033
|
(xyz: number): v3u;
|
996
1034
|
(): v3u;
|
1035
|
+
(v: AnyVec3Instance): v3u;
|
1036
|
+
(v0: AnyVec2Instance, z: number): v3u;
|
1037
|
+
(x: number, v0: AnyVec2Instance): v3u;
|
997
1038
|
}
|
998
1039
|
/**
|
999
1040
|
* Type of the `d.vec4f` object/function: vector data type schema/constructor
|
@@ -1005,6 +1046,13 @@ interface Vec4f {
|
|
1005
1046
|
(x: number, y: number, z: number, w: number): v4f;
|
1006
1047
|
(xyzw: number): v4f;
|
1007
1048
|
(): v4f;
|
1049
|
+
(v: AnyVec4Instance): v4f;
|
1050
|
+
(v0: AnyVec3Instance, w: number): v4f;
|
1051
|
+
(x: number, v0: AnyVec3Instance): v4f;
|
1052
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4f;
|
1053
|
+
(v0: AnyVec2Instance, z: number, w: number): v4f;
|
1054
|
+
(x: number, v0: AnyVec2Instance, z: number): v4f;
|
1055
|
+
(x: number, y: number, v0: AnyVec2Instance): v4f;
|
1008
1056
|
}
|
1009
1057
|
/**
|
1010
1058
|
* Type of the `d.vec4h` object/function: vector data type schema/constructor
|
@@ -1016,6 +1064,13 @@ interface Vec4h {
|
|
1016
1064
|
(x: number, y: number, z: number, w: number): v4h;
|
1017
1065
|
(xyzw: number): v4h;
|
1018
1066
|
(): v4h;
|
1067
|
+
(v: AnyVec4Instance): v4h;
|
1068
|
+
(v0: AnyVec3Instance, w: number): v4h;
|
1069
|
+
(x: number, v0: AnyVec3Instance): v4h;
|
1070
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4h;
|
1071
|
+
(v0: AnyVec2Instance, z: number, w: number): v4h;
|
1072
|
+
(x: number, v0: AnyVec2Instance, z: number): v4h;
|
1073
|
+
(x: number, y: number, v0: AnyVec2Instance): v4h;
|
1019
1074
|
}
|
1020
1075
|
/**
|
1021
1076
|
* Type of the `d.vec4i` object/function: vector data type schema/constructor
|
@@ -1027,6 +1082,13 @@ interface Vec4i {
|
|
1027
1082
|
(x: number, y: number, z: number, w: number): v4i;
|
1028
1083
|
(xyzw: number): v4i;
|
1029
1084
|
(): v4i;
|
1085
|
+
(v: AnyVec4Instance): v4i;
|
1086
|
+
(v0: AnyVec3Instance, w: number): v4i;
|
1087
|
+
(x: number, v0: AnyVec3Instance): v4i;
|
1088
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4i;
|
1089
|
+
(v0: AnyVec2Instance, z: number, w: number): v4i;
|
1090
|
+
(x: number, v0: AnyVec2Instance, z: number): v4i;
|
1091
|
+
(x: number, y: number, v0: AnyVec2Instance): v4i;
|
1030
1092
|
}
|
1031
1093
|
/**
|
1032
1094
|
* Type of the `d.vec4u` object/function: vector data type schema/constructor
|
@@ -1038,6 +1100,13 @@ interface Vec4u {
|
|
1038
1100
|
(x: number, y: number, z: number, w: number): v4u;
|
1039
1101
|
(xyzw: number): v4u;
|
1040
1102
|
(): v4u;
|
1103
|
+
(v: AnyVec4Instance): v4u;
|
1104
|
+
(v0: AnyVec3Instance, w: number): v4u;
|
1105
|
+
(x: number, v0: AnyVec3Instance): v4u;
|
1106
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4u;
|
1107
|
+
(v0: AnyVec2Instance, z: number, w: number): v4u;
|
1108
|
+
(x: number, v0: AnyVec2Instance, z: number): v4u;
|
1109
|
+
(x: number, y: number, v0: AnyVec2Instance): v4u;
|
1041
1110
|
}
|
1042
1111
|
/**
|
1043
1112
|
* Type of the `d.mat2x2f` object/function: matrix data type schema/constructor
|
@@ -1085,15 +1154,21 @@ interface WgslArray<TElement extends BaseData = BaseData> {
|
|
1085
1154
|
readonly elementType: TElement;
|
1086
1155
|
/** Type-token, not available at runtime */
|
1087
1156
|
readonly '~repr': Infer<TElement>[];
|
1157
|
+
readonly '~gpuRepr': InferGPU<TElement>[];
|
1088
1158
|
readonly '~reprPartial': {
|
1089
1159
|
idx: number;
|
1090
1160
|
value: InferPartial<TElement>;
|
1091
1161
|
}[];
|
1092
1162
|
readonly '~memIdent': WgslArray<MemIdentity<TElement>>;
|
1093
1163
|
}
|
1094
|
-
|
1095
|
-
|
1164
|
+
type AddressSpace = 'uniform' | 'storage' | 'workgroup' | 'private' | 'function' | 'handle';
|
1165
|
+
type Access = 'read' | 'write' | 'read-write';
|
1166
|
+
interface Ptr<TAddr extends AddressSpace = AddressSpace, TInner extends BaseData = BaseData, // can also be sampler or texture (╯'□')╯︵ ┻━┻
|
1167
|
+
TAccess extends Access = Access> {
|
1168
|
+
readonly type: 'ptr';
|
1096
1169
|
readonly inner: TInner;
|
1170
|
+
readonly addressSpace: TAddr;
|
1171
|
+
readonly access: TAccess;
|
1097
1172
|
/** Type-token, not available at runtime */
|
1098
1173
|
readonly '~repr': Infer<TInner>;
|
1099
1174
|
}
|
@@ -1105,8 +1180,15 @@ interface Atomic<TInner extends U32 | I32 = U32 | I32> {
|
|
1105
1180
|
readonly inner: TInner;
|
1106
1181
|
/** Type-token, not available at runtime */
|
1107
1182
|
readonly '~repr': Infer<TInner>;
|
1183
|
+
readonly '~gpuRepr': TInner extends U32 ? atomicU32 : atomicI32;
|
1108
1184
|
readonly '~memIdent': MemIdentity<TInner>;
|
1109
1185
|
}
|
1186
|
+
interface atomicU32 {
|
1187
|
+
type: 'atomicU32';
|
1188
|
+
}
|
1189
|
+
interface atomicI32 {
|
1190
|
+
type: 'atomicI32';
|
1191
|
+
}
|
1110
1192
|
interface Align<T extends number> {
|
1111
1193
|
readonly type: '@align';
|
1112
1194
|
readonly value: T;
|
@@ -1136,13 +1218,15 @@ interface Decorated<TInner extends BaseData = BaseData, TAttribs extends unknown
|
|
1136
1218
|
readonly attribs: TAttribs;
|
1137
1219
|
/** Type-token, not available at runtime */
|
1138
1220
|
readonly '~repr': Infer<TInner>;
|
1221
|
+
readonly '~gpuRepr': InferGPU<TInner>;
|
1222
|
+
readonly '~reprPartial': InferPartial<TInner>;
|
1139
1223
|
readonly '~memIdent': TAttribs extends Location<number>[] ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs> : Decorated<MemIdentity<TInner>, TAttribs>;
|
1140
1224
|
}
|
1141
|
-
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", "
|
1225
|
+
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", "ptr", "atomic", "decorated", "abstractInt", "abstractFloat"];
|
1142
1226
|
type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];
|
1143
1227
|
type PerspectiveOrLinearInterpolatableData = F32 | F16 | Vec2f | Vec2h | Vec3f | Vec3h | Vec4f | Vec4h;
|
1144
1228
|
type FlatInterpolatableData = PerspectiveOrLinearInterpolatableData | I32 | U32 | Vec2i | Vec2u | Vec3i | Vec3u | Vec4i | Vec4u;
|
1145
|
-
type AnyWgslData = Bool | F32 | F16 | I32 | U32 | Vec2f | Vec2h | Vec2i | Vec2u | Vec3f | Vec3h | Vec3i | Vec3u | Vec4f | Vec4h | Vec4i | Vec4u | Mat2x2f | Mat3x3f | Mat4x4f | AnyWgslStruct | WgslArray |
|
1229
|
+
type AnyWgslData = Bool | F32 | F16 | I32 | U32 | Vec2f | Vec2h | Vec2i | Vec2u | Vec3f | Vec3h | Vec3i | Vec3u | Vec4f | Vec4h | Vec4i | Vec4u | Mat2x2f | Mat3x3f | Mat4x4f | AnyWgslStruct | WgslArray | Ptr | Atomic | Decorated | AbstractInt | AbstractFloat;
|
1146
1230
|
declare function isWgslData(value: unknown): value is AnyWgslData;
|
1147
1231
|
/**
|
1148
1232
|
* Checks whether passed in value is an array schema,
|
@@ -1177,7 +1261,7 @@ declare function isWgslStruct<T extends WgslStruct>(schema: T | unknown): schema
|
|
1177
1261
|
* isPtrFn(d.ptrFn(d.f32)) // true
|
1178
1262
|
* isPtrFn(d.f32) // false
|
1179
1263
|
*/
|
1180
|
-
declare function
|
1264
|
+
declare function isPtr<T extends Ptr>(schema: T | unknown): schema is T;
|
1181
1265
|
/**
|
1182
1266
|
* Checks whether the passed in value is an atomic schema.
|
1183
1267
|
*
|
@@ -1193,4 +1277,4 @@ declare function isInterpolateAttrib<T extends Interpolate<InterpolationType>>(v
|
|
1193
1277
|
declare function isBuiltinAttrib<T extends Builtin<string>>(value: unknown | T): value is T;
|
1194
1278
|
declare function isDecorated<T extends Decorated>(value: unknown | T): value is T;
|
1195
1279
|
|
1196
|
-
export {
|
1280
|
+
export { type Atomic as $, type AnyWgslData as A, type BaseData as B, type InferGPU as C, type Decorated as D, type AbstractInt as E, type F32 as F, type AbstractFloat as G, type AnyVecInstance as H, type Infer as I, type AnyMatInstance as J, type KindToDefaultFormatMap as K, type Location as L, type Mutable as M, type Bool as N, type OmitProps as O, type Prettify as P, type Ptr as Q, type Mat2x2f as R, type Mat3x3f as S, type TgpuNamable as T, type U32 as U, type Vec2f as V, type WgslStruct as W, type Mat4x4f as X, type m2x2f as Y, type m3x3f as Z, type m4x4f as _, type F16 as a, float32 as a$, isWgslData as a0, isWgslArray as a1, isWgslStruct as a2, isPtr as a3, isAtomic as a4, isDecorated as a5, isAlignAttrib as a6, isBuiltinAttrib as a7, isLocationAttrib as a8, isInterpolateAttrib as a9, uint8 as aA, uint8x2 as aB, uint8x4 as aC, sint8 as aD, sint8x2 as aE, sint8x4 as aF, unorm8 as aG, unorm8x2 as aH, unorm8x4 as aI, snorm8 as aJ, snorm8x2 as aK, snorm8x4 as aL, uint16 as aM, uint16x2 as aN, uint16x4 as aO, sint16 as aP, sint16x2 as aQ, sint16x4 as aR, unorm16 as aS, unorm16x2 as aT, unorm16x4 as aU, snorm16 as aV, snorm16x2 as aW, snorm16x4 as aX, float16 as aY, float16x2 as aZ, float16x4 as a_, isSizeAttrib as aa, type Size as ab, type Align as ac, type Builtin as ad, type Interpolate as ae, type v2f as af, type v2i as ag, type v2u as ah, type v3f as ai, type v3i as aj, type v3u as ak, type v4f as al, type v4i as am, type v4u as an, struct as ao, type LooseDecorated as ap, type AnyLooseData as aq, isDisarray as ar, isUnstruct as as, isLooseDecorated as at, isData as au, isLooseData as av, type FormatToWGSLType as aw, type TgpuVertexFormatData as ax, formatToWGSLType as ay, packedFormats as az, type I32 as b, float32x2 as b0, float32x3 as b1, float32x4 as b2, uint32 as b3, uint32x2 as b4, uint32x3 as b5, uint32x4 as b6, sint32 as b7, sint32x2 as b8, sint32x3 as b9, sint32x4 as ba, unorm10_10_10_2 as bb, unorm8x4_bgra as bc, type PackedData as bd, type InterpolationType as be, type LooseTypeLiteral as bf, type PerspectiveOrLinearInterpolationType as bg, type PerspectiveOrLinearInterpolatableData as bh, type FlatInterpolationType as bi, type FlatInterpolatableData as bj, type VecKind as bk, type vBaseForMat as bl, type v2h as bm, type v3h as bn, type v4h as bo, type atomicI32 as bp, type atomicU32 as bq, 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, type Default as o, type UnionToIntersection as p, type WgslArray as q, type Disarray as r, type Unstruct as s, type VertexFormat as t, type TgpuVertexAttrib as u, type KindToAcceptedAttribMap as v, type AnyData as w, type WgslTypeLiteral as x, type InferPartial as y, type MemIdentity as z };
|
@@ -6,6 +6,24 @@ interface TgpuNamable {
|
|
6
6
|
$name(label?: string | undefined): this;
|
7
7
|
}
|
8
8
|
|
9
|
+
type Default<T, TDefault> = unknown extends T ? TDefault : T extends undefined ? TDefault : T;
|
10
|
+
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
11
|
+
type Prettify<T> = {
|
12
|
+
[K in keyof T]: T[K];
|
13
|
+
} & {};
|
14
|
+
/**
|
15
|
+
* Removes properties from record type that extend `Prop`
|
16
|
+
*/
|
17
|
+
type OmitProps<T extends Record<string, unknown>, Prop> = Pick<T, {
|
18
|
+
[Key in keyof T]: T[Key] extends Prop ? never : Key;
|
19
|
+
}[keyof T]>;
|
20
|
+
/**
|
21
|
+
* The opposite of Readonly<T>
|
22
|
+
*/
|
23
|
+
type Mutable<T> = {
|
24
|
+
-readonly [P in keyof T]: T[P];
|
25
|
+
};
|
26
|
+
|
9
27
|
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"];
|
10
28
|
type VertexFormat = (typeof vertexFormats)[number];
|
11
29
|
declare const kindToDefaultFormatMap: {
|
@@ -236,8 +254,8 @@ interface Unstruct<TProps extends Record<string, BaseData> = Record<string, Base
|
|
236
254
|
readonly label?: string | undefined;
|
237
255
|
readonly type: 'unstruct';
|
238
256
|
readonly propTypes: TProps;
|
239
|
-
readonly '~repr': InferRecord<TProps
|
240
|
-
readonly '~reprPartial': Partial<InferPartialRecord<TProps
|
257
|
+
readonly '~repr': Prettify<InferRecord<TProps>>;
|
258
|
+
readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
|
241
259
|
}
|
242
260
|
interface LooseDecorated<TInner extends BaseData = BaseData, TAttribs extends unknown[] = unknown[]> {
|
243
261
|
readonly type: 'loose-decorated';
|
@@ -295,12 +313,18 @@ type InferPartial<T> = T extends {
|
|
295
313
|
} ? TRepr : T extends {
|
296
314
|
readonly '~repr': infer TRepr;
|
297
315
|
} ? TRepr | undefined : T extends Record<string | number | symbol, unknown> ? InferPartialRecord<T> : T;
|
316
|
+
type InferGPU<T> = T extends {
|
317
|
+
readonly '~gpuRepr': infer TRepr;
|
318
|
+
} ? TRepr : Infer<T>;
|
298
319
|
type InferRecord<T extends Record<string | number | symbol, unknown>> = {
|
299
320
|
[Key in keyof T]: Infer<T[Key]>;
|
300
321
|
};
|
301
322
|
type InferPartialRecord<T extends Record<string | number | symbol, unknown>> = {
|
302
323
|
[Key in keyof T]: InferPartial<T[Key]>;
|
303
324
|
};
|
325
|
+
type InferGPURecord<T extends Record<string | number | symbol, unknown>> = {
|
326
|
+
[Key in keyof T]: InferGPU<T[Key]>;
|
327
|
+
};
|
304
328
|
type MemIdentity<T> = T extends {
|
305
329
|
readonly '~memIdent': infer TMemIdent extends AnyData;
|
306
330
|
} ? TMemIdent : T;
|
@@ -308,24 +332,6 @@ type MemIdentityRecord<T extends Record<string | number | symbol, unknown>> = {
|
|
308
332
|
[Key in keyof T]: MemIdentity<T[Key]>;
|
309
333
|
};
|
310
334
|
|
311
|
-
type Default<T, TDefault> = unknown extends T ? TDefault : T extends undefined ? TDefault : T;
|
312
|
-
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
313
|
-
type Prettify<T> = {
|
314
|
-
[K in keyof T]: T[K];
|
315
|
-
} & {};
|
316
|
-
/**
|
317
|
-
* Removes properties from record type that extend `Prop`
|
318
|
-
*/
|
319
|
-
type OmitProps<T extends Record<string, unknown>, Prop> = Pick<T, {
|
320
|
-
[Key in keyof T]: T[Key] extends Prop ? never : Key;
|
321
|
-
}[keyof T]>;
|
322
|
-
/**
|
323
|
-
* The opposite of Readonly<T>
|
324
|
-
*/
|
325
|
-
type Mutable<T> = {
|
326
|
-
-readonly [P in keyof T]: T[P];
|
327
|
-
};
|
328
|
-
|
329
335
|
/**
|
330
336
|
* Struct schema constructed via `d.struct` function.
|
331
337
|
*
|
@@ -339,11 +345,13 @@ interface WgslStruct<TProps extends Record<string, BaseData> = Record<string, Ba
|
|
339
345
|
readonly label?: string | undefined;
|
340
346
|
readonly propTypes: TProps;
|
341
347
|
/** Type-token, not available at runtime */
|
342
|
-
readonly '~repr': InferRecord<TProps
|
348
|
+
readonly '~repr': Prettify<InferRecord<TProps>>;
|
349
|
+
/** Type-token, not available at runtime */
|
350
|
+
readonly '~gpuRepr': InferGPURecord<TProps>;
|
343
351
|
/** Type-token, not available at runtime */
|
344
352
|
readonly '~memIdent': WgslStruct<MemIdentityRecord<TProps>>;
|
345
353
|
/** Type-token, not available at runtime */
|
346
|
-
readonly '~reprPartial': Partial<InferPartialRecord<TProps
|
354
|
+
readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
|
347
355
|
}
|
348
356
|
type AnyWgslStruct = WgslStruct<any>;
|
349
357
|
/**
|
@@ -369,6 +377,20 @@ interface BaseData {
|
|
369
377
|
/** Type-token, not available at runtime */
|
370
378
|
readonly '~repr': unknown;
|
371
379
|
}
|
380
|
+
/**
|
381
|
+
* Represents a 64-bit integer.
|
382
|
+
*/
|
383
|
+
interface AbstractInt {
|
384
|
+
readonly type: 'abstractInt';
|
385
|
+
readonly '~repr': number;
|
386
|
+
}
|
387
|
+
/**
|
388
|
+
* Represents a 64-bit IEEE 754 floating point number.
|
389
|
+
*/
|
390
|
+
interface AbstractFloat {
|
391
|
+
readonly type: 'abstractFloat';
|
392
|
+
readonly '~repr': number;
|
393
|
+
}
|
372
394
|
interface Swizzle2<T2, T3, T4> {
|
373
395
|
readonly xx: T2;
|
374
396
|
readonly xy: T2;
|
@@ -807,6 +829,9 @@ interface v4u extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {
|
|
807
829
|
w: number;
|
808
830
|
}
|
809
831
|
type AnyVecInstance = v2f | v2h | v2i | v2u | v3f | v3h | v3i | v3u | v4f | v4h | v4i | v4u;
|
832
|
+
type AnyVec2Instance = v2f | v2h | v2i | v2u;
|
833
|
+
type AnyVec3Instance = v3f | v3h | v3i | v3u;
|
834
|
+
type AnyVec4Instance = v4f | v4h | v4i | v4u;
|
810
835
|
type VecKind = AnyVecInstance['kind'];
|
811
836
|
interface matBase<TColumn> extends NumberArrayView {
|
812
837
|
readonly columns: readonly TColumn[];
|
@@ -917,6 +942,7 @@ interface Vec2f {
|
|
917
942
|
(x: number, y: number): v2f;
|
918
943
|
(xy: number): v2f;
|
919
944
|
(): v2f;
|
945
|
+
(v: AnyVec2Instance): v2f;
|
920
946
|
}
|
921
947
|
/**
|
922
948
|
* Type of the `d.vec2h` object/function: vector data type schema/constructor
|
@@ -928,6 +954,7 @@ interface Vec2h {
|
|
928
954
|
(x: number, y: number): v2h;
|
929
955
|
(xy: number): v2h;
|
930
956
|
(): v2h;
|
957
|
+
(v: AnyVec2Instance): v2h;
|
931
958
|
}
|
932
959
|
/**
|
933
960
|
* Type of the `d.vec2i` object/function: vector data type schema/constructor
|
@@ -939,6 +966,7 @@ interface Vec2i {
|
|
939
966
|
(x: number, y: number): v2i;
|
940
967
|
(xy: number): v2i;
|
941
968
|
(): v2i;
|
969
|
+
(v: AnyVec2Instance): v2i;
|
942
970
|
}
|
943
971
|
/**
|
944
972
|
* Type of the `d.vec2u` object/function: vector data type schema/constructor
|
@@ -950,6 +978,7 @@ interface Vec2u {
|
|
950
978
|
(x: number, y: number): v2u;
|
951
979
|
(xy: number): v2u;
|
952
980
|
(): v2u;
|
981
|
+
(v: AnyVec2Instance): v2u;
|
953
982
|
}
|
954
983
|
/**
|
955
984
|
* Type of the `d.vec3f` object/function: vector data type schema/constructor
|
@@ -961,6 +990,9 @@ interface Vec3f {
|
|
961
990
|
(x: number, y: number, z: number): v3f;
|
962
991
|
(xyz: number): v3f;
|
963
992
|
(): v3f;
|
993
|
+
(v: AnyVec3Instance): v3f;
|
994
|
+
(v0: AnyVec2Instance, z: number): v3f;
|
995
|
+
(x: number, v0: AnyVec2Instance): v3f;
|
964
996
|
}
|
965
997
|
/**
|
966
998
|
* Type of the `d.vec3h` object/function: vector data type schema/constructor
|
@@ -972,6 +1004,9 @@ interface Vec3h {
|
|
972
1004
|
(x: number, y: number, z: number): v3h;
|
973
1005
|
(xyz: number): v3h;
|
974
1006
|
(): v3h;
|
1007
|
+
(v: AnyVec3Instance): v3h;
|
1008
|
+
(v0: AnyVec2Instance, z: number): v3h;
|
1009
|
+
(x: number, v0: AnyVec2Instance): v3h;
|
975
1010
|
}
|
976
1011
|
/**
|
977
1012
|
* Type of the `d.vec3i` object/function: vector data type schema/constructor
|
@@ -983,6 +1018,9 @@ interface Vec3i {
|
|
983
1018
|
(x: number, y: number, z: number): v3i;
|
984
1019
|
(xyz: number): v3i;
|
985
1020
|
(): v3i;
|
1021
|
+
(v: AnyVec3Instance): v3i;
|
1022
|
+
(v0: AnyVec2Instance, z: number): v3i;
|
1023
|
+
(x: number, v0: AnyVec2Instance): v3i;
|
986
1024
|
}
|
987
1025
|
/**
|
988
1026
|
* Type of the `d.vec3u` object/function: vector data type schema/constructor
|
@@ -994,6 +1032,9 @@ interface Vec3u {
|
|
994
1032
|
(x: number, y: number, z: number): v3u;
|
995
1033
|
(xyz: number): v3u;
|
996
1034
|
(): v3u;
|
1035
|
+
(v: AnyVec3Instance): v3u;
|
1036
|
+
(v0: AnyVec2Instance, z: number): v3u;
|
1037
|
+
(x: number, v0: AnyVec2Instance): v3u;
|
997
1038
|
}
|
998
1039
|
/**
|
999
1040
|
* Type of the `d.vec4f` object/function: vector data type schema/constructor
|
@@ -1005,6 +1046,13 @@ interface Vec4f {
|
|
1005
1046
|
(x: number, y: number, z: number, w: number): v4f;
|
1006
1047
|
(xyzw: number): v4f;
|
1007
1048
|
(): v4f;
|
1049
|
+
(v: AnyVec4Instance): v4f;
|
1050
|
+
(v0: AnyVec3Instance, w: number): v4f;
|
1051
|
+
(x: number, v0: AnyVec3Instance): v4f;
|
1052
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4f;
|
1053
|
+
(v0: AnyVec2Instance, z: number, w: number): v4f;
|
1054
|
+
(x: number, v0: AnyVec2Instance, z: number): v4f;
|
1055
|
+
(x: number, y: number, v0: AnyVec2Instance): v4f;
|
1008
1056
|
}
|
1009
1057
|
/**
|
1010
1058
|
* Type of the `d.vec4h` object/function: vector data type schema/constructor
|
@@ -1016,6 +1064,13 @@ interface Vec4h {
|
|
1016
1064
|
(x: number, y: number, z: number, w: number): v4h;
|
1017
1065
|
(xyzw: number): v4h;
|
1018
1066
|
(): v4h;
|
1067
|
+
(v: AnyVec4Instance): v4h;
|
1068
|
+
(v0: AnyVec3Instance, w: number): v4h;
|
1069
|
+
(x: number, v0: AnyVec3Instance): v4h;
|
1070
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4h;
|
1071
|
+
(v0: AnyVec2Instance, z: number, w: number): v4h;
|
1072
|
+
(x: number, v0: AnyVec2Instance, z: number): v4h;
|
1073
|
+
(x: number, y: number, v0: AnyVec2Instance): v4h;
|
1019
1074
|
}
|
1020
1075
|
/**
|
1021
1076
|
* Type of the `d.vec4i` object/function: vector data type schema/constructor
|
@@ -1027,6 +1082,13 @@ interface Vec4i {
|
|
1027
1082
|
(x: number, y: number, z: number, w: number): v4i;
|
1028
1083
|
(xyzw: number): v4i;
|
1029
1084
|
(): v4i;
|
1085
|
+
(v: AnyVec4Instance): v4i;
|
1086
|
+
(v0: AnyVec3Instance, w: number): v4i;
|
1087
|
+
(x: number, v0: AnyVec3Instance): v4i;
|
1088
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4i;
|
1089
|
+
(v0: AnyVec2Instance, z: number, w: number): v4i;
|
1090
|
+
(x: number, v0: AnyVec2Instance, z: number): v4i;
|
1091
|
+
(x: number, y: number, v0: AnyVec2Instance): v4i;
|
1030
1092
|
}
|
1031
1093
|
/**
|
1032
1094
|
* Type of the `d.vec4u` object/function: vector data type schema/constructor
|
@@ -1038,6 +1100,13 @@ interface Vec4u {
|
|
1038
1100
|
(x: number, y: number, z: number, w: number): v4u;
|
1039
1101
|
(xyzw: number): v4u;
|
1040
1102
|
(): v4u;
|
1103
|
+
(v: AnyVec4Instance): v4u;
|
1104
|
+
(v0: AnyVec3Instance, w: number): v4u;
|
1105
|
+
(x: number, v0: AnyVec3Instance): v4u;
|
1106
|
+
(v0: AnyVec2Instance, v1: AnyVec2Instance): v4u;
|
1107
|
+
(v0: AnyVec2Instance, z: number, w: number): v4u;
|
1108
|
+
(x: number, v0: AnyVec2Instance, z: number): v4u;
|
1109
|
+
(x: number, y: number, v0: AnyVec2Instance): v4u;
|
1041
1110
|
}
|
1042
1111
|
/**
|
1043
1112
|
* Type of the `d.mat2x2f` object/function: matrix data type schema/constructor
|
@@ -1085,15 +1154,21 @@ interface WgslArray<TElement extends BaseData = BaseData> {
|
|
1085
1154
|
readonly elementType: TElement;
|
1086
1155
|
/** Type-token, not available at runtime */
|
1087
1156
|
readonly '~repr': Infer<TElement>[];
|
1157
|
+
readonly '~gpuRepr': InferGPU<TElement>[];
|
1088
1158
|
readonly '~reprPartial': {
|
1089
1159
|
idx: number;
|
1090
1160
|
value: InferPartial<TElement>;
|
1091
1161
|
}[];
|
1092
1162
|
readonly '~memIdent': WgslArray<MemIdentity<TElement>>;
|
1093
1163
|
}
|
1094
|
-
|
1095
|
-
|
1164
|
+
type AddressSpace = 'uniform' | 'storage' | 'workgroup' | 'private' | 'function' | 'handle';
|
1165
|
+
type Access = 'read' | 'write' | 'read-write';
|
1166
|
+
interface Ptr<TAddr extends AddressSpace = AddressSpace, TInner extends BaseData = BaseData, // can also be sampler or texture (╯'□')╯︵ ┻━┻
|
1167
|
+
TAccess extends Access = Access> {
|
1168
|
+
readonly type: 'ptr';
|
1096
1169
|
readonly inner: TInner;
|
1170
|
+
readonly addressSpace: TAddr;
|
1171
|
+
readonly access: TAccess;
|
1097
1172
|
/** Type-token, not available at runtime */
|
1098
1173
|
readonly '~repr': Infer<TInner>;
|
1099
1174
|
}
|
@@ -1105,8 +1180,15 @@ interface Atomic<TInner extends U32 | I32 = U32 | I32> {
|
|
1105
1180
|
readonly inner: TInner;
|
1106
1181
|
/** Type-token, not available at runtime */
|
1107
1182
|
readonly '~repr': Infer<TInner>;
|
1183
|
+
readonly '~gpuRepr': TInner extends U32 ? atomicU32 : atomicI32;
|
1108
1184
|
readonly '~memIdent': MemIdentity<TInner>;
|
1109
1185
|
}
|
1186
|
+
interface atomicU32 {
|
1187
|
+
type: 'atomicU32';
|
1188
|
+
}
|
1189
|
+
interface atomicI32 {
|
1190
|
+
type: 'atomicI32';
|
1191
|
+
}
|
1110
1192
|
interface Align<T extends number> {
|
1111
1193
|
readonly type: '@align';
|
1112
1194
|
readonly value: T;
|
@@ -1136,13 +1218,15 @@ interface Decorated<TInner extends BaseData = BaseData, TAttribs extends unknown
|
|
1136
1218
|
readonly attribs: TAttribs;
|
1137
1219
|
/** Type-token, not available at runtime */
|
1138
1220
|
readonly '~repr': Infer<TInner>;
|
1221
|
+
readonly '~gpuRepr': InferGPU<TInner>;
|
1222
|
+
readonly '~reprPartial': InferPartial<TInner>;
|
1139
1223
|
readonly '~memIdent': TAttribs extends Location<number>[] ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs> : Decorated<MemIdentity<TInner>, TAttribs>;
|
1140
1224
|
}
|
1141
|
-
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", "
|
1225
|
+
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", "ptr", "atomic", "decorated", "abstractInt", "abstractFloat"];
|
1142
1226
|
type WgslTypeLiteral = (typeof wgslTypeLiterals)[number];
|
1143
1227
|
type PerspectiveOrLinearInterpolatableData = F32 | F16 | Vec2f | Vec2h | Vec3f | Vec3h | Vec4f | Vec4h;
|
1144
1228
|
type FlatInterpolatableData = PerspectiveOrLinearInterpolatableData | I32 | U32 | Vec2i | Vec2u | Vec3i | Vec3u | Vec4i | Vec4u;
|
1145
|
-
type AnyWgslData = Bool | F32 | F16 | I32 | U32 | Vec2f | Vec2h | Vec2i | Vec2u | Vec3f | Vec3h | Vec3i | Vec3u | Vec4f | Vec4h | Vec4i | Vec4u | Mat2x2f | Mat3x3f | Mat4x4f | AnyWgslStruct | WgslArray |
|
1229
|
+
type AnyWgslData = Bool | F32 | F16 | I32 | U32 | Vec2f | Vec2h | Vec2i | Vec2u | Vec3f | Vec3h | Vec3i | Vec3u | Vec4f | Vec4h | Vec4i | Vec4u | Mat2x2f | Mat3x3f | Mat4x4f | AnyWgslStruct | WgslArray | Ptr | Atomic | Decorated | AbstractInt | AbstractFloat;
|
1146
1230
|
declare function isWgslData(value: unknown): value is AnyWgslData;
|
1147
1231
|
/**
|
1148
1232
|
* Checks whether passed in value is an array schema,
|
@@ -1177,7 +1261,7 @@ declare function isWgslStruct<T extends WgslStruct>(schema: T | unknown): schema
|
|
1177
1261
|
* isPtrFn(d.ptrFn(d.f32)) // true
|
1178
1262
|
* isPtrFn(d.f32) // false
|
1179
1263
|
*/
|
1180
|
-
declare function
|
1264
|
+
declare function isPtr<T extends Ptr>(schema: T | unknown): schema is T;
|
1181
1265
|
/**
|
1182
1266
|
* Checks whether the passed in value is an atomic schema.
|
1183
1267
|
*
|
@@ -1193,4 +1277,4 @@ declare function isInterpolateAttrib<T extends Interpolate<InterpolationType>>(v
|
|
1193
1277
|
declare function isBuiltinAttrib<T extends Builtin<string>>(value: unknown | T): value is T;
|
1194
1278
|
declare function isDecorated<T extends Decorated>(value: unknown | T): value is T;
|
1195
1279
|
|
1196
|
-
export {
|
1280
|
+
export { type Atomic as $, type AnyWgslData as A, type BaseData as B, type InferGPU as C, type Decorated as D, type AbstractInt as E, type F32 as F, type AbstractFloat as G, type AnyVecInstance as H, type Infer as I, type AnyMatInstance as J, type KindToDefaultFormatMap as K, type Location as L, type Mutable as M, type Bool as N, type OmitProps as O, type Prettify as P, type Ptr as Q, type Mat2x2f as R, type Mat3x3f as S, type TgpuNamable as T, type U32 as U, type Vec2f as V, type WgslStruct as W, type Mat4x4f as X, type m2x2f as Y, type m3x3f as Z, type m4x4f as _, type F16 as a, float32 as a$, isWgslData as a0, isWgslArray as a1, isWgslStruct as a2, isPtr as a3, isAtomic as a4, isDecorated as a5, isAlignAttrib as a6, isBuiltinAttrib as a7, isLocationAttrib as a8, isInterpolateAttrib as a9, uint8 as aA, uint8x2 as aB, uint8x4 as aC, sint8 as aD, sint8x2 as aE, sint8x4 as aF, unorm8 as aG, unorm8x2 as aH, unorm8x4 as aI, snorm8 as aJ, snorm8x2 as aK, snorm8x4 as aL, uint16 as aM, uint16x2 as aN, uint16x4 as aO, sint16 as aP, sint16x2 as aQ, sint16x4 as aR, unorm16 as aS, unorm16x2 as aT, unorm16x4 as aU, snorm16 as aV, snorm16x2 as aW, snorm16x4 as aX, float16 as aY, float16x2 as aZ, float16x4 as a_, isSizeAttrib as aa, type Size as ab, type Align as ac, type Builtin as ad, type Interpolate as ae, type v2f as af, type v2i as ag, type v2u as ah, type v3f as ai, type v3i as aj, type v3u as ak, type v4f as al, type v4i as am, type v4u as an, struct as ao, type LooseDecorated as ap, type AnyLooseData as aq, isDisarray as ar, isUnstruct as as, isLooseDecorated as at, isData as au, isLooseData as av, type FormatToWGSLType as aw, type TgpuVertexFormatData as ax, formatToWGSLType as ay, packedFormats as az, type I32 as b, float32x2 as b0, float32x3 as b1, float32x4 as b2, uint32 as b3, uint32x2 as b4, uint32x3 as b5, uint32x4 as b6, sint32 as b7, sint32x2 as b8, sint32x3 as b9, sint32x4 as ba, unorm10_10_10_2 as bb, unorm8x4_bgra as bc, type PackedData as bd, type InterpolationType as be, type LooseTypeLiteral as bf, type PerspectiveOrLinearInterpolationType as bg, type PerspectiveOrLinearInterpolatableData as bh, type FlatInterpolationType as bi, type FlatInterpolatableData as bj, type VecKind as bk, type vBaseForMat as bl, type v2h as bm, type v3h as bn, type v4h as bo, type atomicI32 as bp, type atomicU32 as bq, 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, type Default as o, type UnionToIntersection as p, type WgslArray as q, type Disarray as r, type Unstruct as s, type VertexFormat as t, type TgpuVertexAttrib as u, type KindToAcceptedAttribMap as v, type AnyData as w, type WgslTypeLiteral as x, type InferPartial as y, type MemIdentity as z };
|