typegpu 0.4.4 → 0.4.6

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.
@@ -313,12 +313,18 @@ type InferPartial<T> = T extends {
313
313
  } ? TRepr : T extends {
314
314
  readonly '~repr': infer TRepr;
315
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>;
316
319
  type InferRecord<T extends Record<string | number | symbol, unknown>> = {
317
320
  [Key in keyof T]: Infer<T[Key]>;
318
321
  };
319
322
  type InferPartialRecord<T extends Record<string | number | symbol, unknown>> = {
320
323
  [Key in keyof T]: InferPartial<T[Key]>;
321
324
  };
325
+ type InferGPURecord<T extends Record<string | number | symbol, unknown>> = {
326
+ [Key in keyof T]: InferGPU<T[Key]>;
327
+ };
322
328
  type MemIdentity<T> = T extends {
323
329
  readonly '~memIdent': infer TMemIdent extends AnyData;
324
330
  } ? TMemIdent : T;
@@ -341,6 +347,8 @@ interface WgslStruct<TProps extends Record<string, BaseData> = Record<string, Ba
341
347
  /** Type-token, not available at runtime */
342
348
  readonly '~repr': Prettify<InferRecord<TProps>>;
343
349
  /** Type-token, not available at runtime */
350
+ readonly '~gpuRepr': InferGPURecord<TProps>;
351
+ /** Type-token, not available at runtime */
344
352
  readonly '~memIdent': WgslStruct<MemIdentityRecord<TProps>>;
345
353
  /** Type-token, not available at runtime */
346
354
  readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
@@ -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
- interface PtrFn<TInner = BaseData> {
1095
- readonly type: 'ptrFn';
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", "ptrFn", "atomic", "decorated"];
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 | PtrFn | Atomic | Decorated;
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 isPtrFn<T extends PtrFn>(schema: T | unknown): schema is T;
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 { isWgslStruct as $, type AnyWgslData as A, type BaseData as B, type AnyVecInstance as C, type Decorated as D, type AnyMatInstance as E, type F32 as F, type Bool as G, type PtrFn as H, type Infer as I, type Mat2x2f as J, type KindToDefaultFormatMap as K, type Location as L, type Mutable as M, type Mat3x3f as N, type OmitProps as O, type Prettify as P, type Mat4x4f as Q, type m2x2f as R, type m3x3f as S, type TgpuNamable as T, type U32 as U, type Vec2f as V, type WgslStruct as W, type m4x4f as X, type Atomic as Y, isWgslData as Z, isWgslArray as _, type F16 as a, float32x4 as a$, isPtrFn as a0, isAtomic as a1, isDecorated as a2, isAlignAttrib as a3, isBuiltinAttrib as a4, isLocationAttrib as a5, isInterpolateAttrib as a6, isSizeAttrib as a7, type Size as a8, type Align as a9, sint8 as aA, sint8x2 as aB, sint8x4 as aC, unorm8 as aD, unorm8x2 as aE, unorm8x4 as aF, snorm8 as aG, snorm8x2 as aH, snorm8x4 as aI, uint16 as aJ, uint16x2 as aK, uint16x4 as aL, sint16 as aM, sint16x2 as aN, sint16x4 as aO, unorm16 as aP, unorm16x2 as aQ, unorm16x4 as aR, snorm16 as aS, snorm16x2 as aT, snorm16x4 as aU, float16 as aV, float16x2 as aW, float16x4 as aX, float32 as aY, float32x2 as aZ, float32x3 as a_, type Builtin as aa, type Interpolate as ab, type v2f as ac, type v2i as ad, type v2u as ae, type v3f as af, type v3i as ag, type v3u as ah, type v4f as ai, type v4i as aj, type v4u as ak, struct as al, type LooseDecorated as am, type AnyLooseData as an, isDisarray as ao, isUnstruct as ap, isLooseDecorated as aq, isData as ar, isLooseData as as, type FormatToWGSLType as at, type TgpuVertexFormatData as au, formatToWGSLType as av, packedFormats as aw, uint8 as ax, uint8x2 as ay, uint8x4 as az, type I32 as b, uint32 as b0, uint32x2 as b1, uint32x3 as b2, uint32x4 as b3, sint32 as b4, sint32x2 as b5, sint32x3 as b6, sint32x4 as b7, unorm10_10_10_2 as b8, unorm8x4_bgra as b9, type PackedData as ba, type InterpolationType as bb, type LooseTypeLiteral as bc, type PerspectiveOrLinearInterpolationType as bd, type PerspectiveOrLinearInterpolatableData as be, type FlatInterpolationType as bf, type FlatInterpolatableData as bg, type VecKind as bh, type vBaseForMat as bi, type v2h as bj, type v3h as bk, type v4h as bl, 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 };
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 };
@@ -313,12 +313,18 @@ type InferPartial<T> = T extends {
313
313
  } ? TRepr : T extends {
314
314
  readonly '~repr': infer TRepr;
315
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>;
316
319
  type InferRecord<T extends Record<string | number | symbol, unknown>> = {
317
320
  [Key in keyof T]: Infer<T[Key]>;
318
321
  };
319
322
  type InferPartialRecord<T extends Record<string | number | symbol, unknown>> = {
320
323
  [Key in keyof T]: InferPartial<T[Key]>;
321
324
  };
325
+ type InferGPURecord<T extends Record<string | number | symbol, unknown>> = {
326
+ [Key in keyof T]: InferGPU<T[Key]>;
327
+ };
322
328
  type MemIdentity<T> = T extends {
323
329
  readonly '~memIdent': infer TMemIdent extends AnyData;
324
330
  } ? TMemIdent : T;
@@ -341,6 +347,8 @@ interface WgslStruct<TProps extends Record<string, BaseData> = Record<string, Ba
341
347
  /** Type-token, not available at runtime */
342
348
  readonly '~repr': Prettify<InferRecord<TProps>>;
343
349
  /** Type-token, not available at runtime */
350
+ readonly '~gpuRepr': InferGPURecord<TProps>;
351
+ /** Type-token, not available at runtime */
344
352
  readonly '~memIdent': WgslStruct<MemIdentityRecord<TProps>>;
345
353
  /** Type-token, not available at runtime */
346
354
  readonly '~reprPartial': Prettify<Partial<InferPartialRecord<TProps>>>;
@@ -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
- interface PtrFn<TInner = BaseData> {
1095
- readonly type: 'ptrFn';
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", "ptrFn", "atomic", "decorated"];
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 | PtrFn | Atomic | Decorated;
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 isPtrFn<T extends PtrFn>(schema: T | unknown): schema is T;
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 { isWgslStruct as $, type AnyWgslData as A, type BaseData as B, type AnyVecInstance as C, type Decorated as D, type AnyMatInstance as E, type F32 as F, type Bool as G, type PtrFn as H, type Infer as I, type Mat2x2f as J, type KindToDefaultFormatMap as K, type Location as L, type Mutable as M, type Mat3x3f as N, type OmitProps as O, type Prettify as P, type Mat4x4f as Q, type m2x2f as R, type m3x3f as S, type TgpuNamable as T, type U32 as U, type Vec2f as V, type WgslStruct as W, type m4x4f as X, type Atomic as Y, isWgslData as Z, isWgslArray as _, type F16 as a, float32x4 as a$, isPtrFn as a0, isAtomic as a1, isDecorated as a2, isAlignAttrib as a3, isBuiltinAttrib as a4, isLocationAttrib as a5, isInterpolateAttrib as a6, isSizeAttrib as a7, type Size as a8, type Align as a9, sint8 as aA, sint8x2 as aB, sint8x4 as aC, unorm8 as aD, unorm8x2 as aE, unorm8x4 as aF, snorm8 as aG, snorm8x2 as aH, snorm8x4 as aI, uint16 as aJ, uint16x2 as aK, uint16x4 as aL, sint16 as aM, sint16x2 as aN, sint16x4 as aO, unorm16 as aP, unorm16x2 as aQ, unorm16x4 as aR, snorm16 as aS, snorm16x2 as aT, snorm16x4 as aU, float16 as aV, float16x2 as aW, float16x4 as aX, float32 as aY, float32x2 as aZ, float32x3 as a_, type Builtin as aa, type Interpolate as ab, type v2f as ac, type v2i as ad, type v2u as ae, type v3f as af, type v3i as ag, type v3u as ah, type v4f as ai, type v4i as aj, type v4u as ak, struct as al, type LooseDecorated as am, type AnyLooseData as an, isDisarray as ao, isUnstruct as ap, isLooseDecorated as aq, isData as ar, isLooseData as as, type FormatToWGSLType as at, type TgpuVertexFormatData as au, formatToWGSLType as av, packedFormats as aw, uint8 as ax, uint8x2 as ay, uint8x4 as az, type I32 as b, uint32 as b0, uint32x2 as b1, uint32x3 as b2, uint32x4 as b3, sint32 as b4, sint32x2 as b5, sint32x3 as b6, sint32x4 as b7, unorm10_10_10_2 as b8, unorm8x4_bgra as b9, type PackedData as ba, type InterpolationType as bb, type LooseTypeLiteral as bc, type PerspectiveOrLinearInterpolationType as bd, type PerspectiveOrLinearInterpolatableData as be, type FlatInterpolationType as bf, type FlatInterpolatableData as bg, type VecKind as bh, type vBaseForMat as bi, type v2h as bj, type v3h as bk, type v4h as bl, 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 };
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 };
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var C=(e,t,s)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,tt= exports.a =(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&C(e,s,t[s]);if(G)for(var s of G(t))I.call(t,s)&&C(e,s,t[s]);return e},et= exports.b =(e,t)=>X(e,Y(t));var r=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);var $="Invariant failed";function N(e,t){if(e)return;throw new Error($)}var D=class e extends Error{constructor(s,i){let h=i.map(n=>`- ${n}`);h.length>20&&(h=[...h.slice(0,11),"...",...h.slice(-10)]);super(`Resolution of the following tree failed:
2
- ${h.join(`
3
- `)}`);this.cause=s;this.trace=i;Object.setPrototypeOf(this,e.prototype)}appendToTrace(s){let i=[s,...this.trace];return new e(this.cause,i)}},F= exports.f =class e extends Error{constructor(s){super(`Missing value for '${s}'`);this.slot=s;Object.setPrototypeOf(this,e.prototype)}},K= exports.g =class e extends Error{constructor(t){var s;super(`Buffer '${(s=t.label)!=null?s:"<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,e.prototype)}},U= exports.h =class e extends Error{constructor(t,s){super(`The function '${t!=null?t:"<unnamed>"}' is missing links to the following external values: ${s}.`),Object.setPrototypeOf(this,e.prototype)}},L= exports.i =class e extends Error{constructor(t){super(`Missing bind groups for layouts: '${[...t].map(s=>{var i;return(i=s.label)!=null?i:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,e.prototype)}},W= exports.j =class e extends Error{constructor(t){super(`Missing vertex buffers for layouts: '${[...t].map(s=>{var i;return(i=s.label)!=null?i:"<unnamed>"}).join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,e.prototype)}};var T=null;function nt(e,t){N(T===null,"Cannot nest context providers"),T=e;try{return t()}finally{T=null}}function rt(){return T}var k=()=>T!==null;var v=class extends Array{"~resolve"(){return`${this.kind}(${this.join(", ")})`}toString(){return this["~resolve"]()}get xx(){return new this._Vec2(this[0],this[0])}get xy(){return new this._Vec2(this[0],this[1])}get xz(){return new this._Vec2(this[0],this[2])}get xw(){return new this._Vec2(this[0],this[3])}get yx(){return new this._Vec2(this[1],this[0])}get yy(){return new this._Vec2(this[1],this[1])}get yz(){return new this._Vec2(this[1],this[2])}get yw(){return new this._Vec2(this[1],this[3])}get zx(){return new this._Vec2(this[2],this[0])}get zy(){return new this._Vec2(this[2],this[1])}get zz(){return new this._Vec2(this[2],this[2])}get zw(){return new this._Vec2(this[2],this[3])}get wx(){return new this._Vec2(this[3],this[0])}get wy(){return new this._Vec2(this[3],this[1])}get wz(){return new this._Vec2(this[3],this[2])}get ww(){return new this._Vec2(this[3],this[3])}get xxx(){return new this._Vec3(this[0],this[0],this[0])}get xxy(){return new this._Vec3(this[0],this[0],this[1])}get xxz(){return new this._Vec3(this[0],this[0],this[2])}get xxw(){return new this._Vec3(this[0],this[0],this[3])}get xyx(){return new this._Vec3(this[0],this[1],this[0])}get xyy(){return new this._Vec3(this[0],this[1],this[1])}get xyz(){return new this._Vec3(this[0],this[1],this[2])}get xyw(){return new this._Vec3(this[0],this[1],this[3])}get xzx(){return new this._Vec3(this[0],this[2],this[0])}get xzy(){return new this._Vec3(this[0],this[2],this[1])}get xzz(){return new this._Vec3(this[0],this[2],this[2])}get xzw(){return new this._Vec3(this[0],this[2],this[3])}get xwx(){return new this._Vec3(this[0],this[3],this[0])}get xwy(){return new this._Vec3(this[0],this[3],this[1])}get xwz(){return new this._Vec3(this[0],this[3],this[2])}get xww(){return new this._Vec3(this[0],this[3],this[3])}get yxx(){return new this._Vec3(this[1],this[0],this[0])}get yxy(){return new this._Vec3(this[1],this[0],this[1])}get yxz(){return new this._Vec3(this[1],this[0],this[2])}get yxw(){return new this._Vec3(this[1],this[0],this[3])}get yyx(){return new this._Vec3(this[1],this[1],this[0])}get yyy(){return new this._Vec3(this[1],this[1],this[1])}get yyz(){return new this._Vec3(this[1],this[1],this[2])}get yyw(){return new this._Vec3(this[1],this[1],this[3])}get yzx(){return new this._Vec3(this[1],this[2],this[0])}get yzy(){return new this._Vec3(this[1],this[2],this[1])}get yzz(){return new this._Vec3(this[1],this[2],this[2])}get yzw(){return new this._Vec3(this[1],this[2],this[3])}get ywx(){return new this._Vec3(this[1],this[3],this[0])}get ywy(){return new this._Vec3(this[1],this[3],this[1])}get ywz(){return new this._Vec3(this[1],this[3],this[2])}get yww(){return new this._Vec3(this[1],this[3],this[3])}get zxx(){return new this._Vec3(this[2],this[0],this[0])}get zxy(){return new this._Vec3(this[2],this[0],this[1])}get zxz(){return new this._Vec3(this[2],this[0],this[2])}get zxw(){return new this._Vec3(this[2],this[0],this[3])}get zyx(){return new this._Vec3(this[2],this[1],this[0])}get zyy(){return new this._Vec3(this[2],this[1],this[1])}get zyz(){return new this._Vec3(this[2],this[1],this[2])}get zyw(){return new this._Vec3(this[2],this[1],this[3])}get zzx(){return new this._Vec3(this[2],this[2],this[0])}get zzy(){return new this._Vec3(this[2],this[2],this[1])}get zzz(){return new this._Vec3(this[2],this[2],this[2])}get zzw(){return new this._Vec3(this[2],this[2],this[3])}get zwx(){return new this._Vec3(this[2],this[3],this[0])}get zwy(){return new this._Vec3(this[2],this[3],this[1])}get zwz(){return new this._Vec3(this[2],this[3],this[2])}get zww(){return new this._Vec3(this[2],this[3],this[3])}get wxx(){return new this._Vec3(this[3],this[0],this[0])}get wxy(){return new this._Vec3(this[3],this[0],this[1])}get wxz(){return new this._Vec3(this[3],this[0],this[2])}get wxw(){return new this._Vec3(this[3],this[0],this[3])}get wyx(){return new this._Vec3(this[3],this[1],this[0])}get wyy(){return new this._Vec3(this[3],this[1],this[1])}get wyz(){return new this._Vec3(this[3],this[1],this[2])}get wyw(){return new this._Vec3(this[3],this[1],this[3])}get wzx(){return new this._Vec3(this[3],this[2],this[0])}get wzy(){return new this._Vec3(this[3],this[2],this[1])}get wzz(){return new this._Vec3(this[3],this[2],this[2])}get wzw(){return new this._Vec3(this[3],this[2],this[3])}get wwx(){return new this._Vec3(this[3],this[3],this[0])}get wwy(){return new this._Vec3(this[3],this[3],this[1])}get wwz(){return new this._Vec3(this[3],this[3],this[2])}get www(){return new this._Vec3(this[3],this[3],this[3])}get xxxx(){return new this._Vec4(this[0],this[0],this[0],this[0])}get xxxy(){return new this._Vec4(this[0],this[0],this[0],this[1])}get xxxz(){return new this._Vec4(this[0],this[0],this[0],this[2])}get xxxw(){return new this._Vec4(this[0],this[0],this[0],this[3])}get xxyx(){return new this._Vec4(this[0],this[0],this[1],this[0])}get xxyy(){return new this._Vec4(this[0],this[0],this[1],this[1])}get xxyz(){return new this._Vec4(this[0],this[0],this[1],this[2])}get xxyw(){return new this._Vec4(this[0],this[0],this[1],this[3])}get xxzx(){return new this._Vec4(this[0],this[0],this[2],this[0])}get xxzy(){return new this._Vec4(this[0],this[0],this[2],this[1])}get xxzz(){return new this._Vec4(this[0],this[0],this[2],this[2])}get xxzw(){return new this._Vec4(this[0],this[0],this[2],this[3])}get xxwx(){return new this._Vec4(this[0],this[0],this[3],this[0])}get xxwy(){return new this._Vec4(this[0],this[0],this[3],this[1])}get xxwz(){return new this._Vec4(this[0],this[0],this[3],this[2])}get xxww(){return new this._Vec4(this[0],this[0],this[3],this[3])}get xyxx(){return new this._Vec4(this[0],this[1],this[0],this[0])}get xyxy(){return new this._Vec4(this[0],this[1],this[0],this[1])}get xyxz(){return new this._Vec4(this[0],this[1],this[0],this[2])}get xyxw(){return new this._Vec4(this[0],this[1],this[0],this[3])}get xyyx(){return new this._Vec4(this[0],this[1],this[1],this[0])}get xyyy(){return new this._Vec4(this[0],this[1],this[1],this[1])}get xyyz(){return new this._Vec4(this[0],this[1],this[1],this[2])}get xyyw(){return new this._Vec4(this[0],this[1],this[1],this[3])}get xyzx(){return new this._Vec4(this[0],this[1],this[2],this[0])}get xyzy(){return new this._Vec4(this[0],this[1],this[2],this[1])}get xyzz(){return new this._Vec4(this[0],this[1],this[2],this[2])}get xyzw(){return new this._Vec4(this[0],this[1],this[2],this[3])}get xywx(){return new this._Vec4(this[0],this[1],this[3],this[0])}get xywy(){return new this._Vec4(this[0],this[1],this[3],this[1])}get xywz(){return new this._Vec4(this[0],this[1],this[3],this[2])}get xyww(){return new this._Vec4(this[0],this[1],this[3],this[3])}get xzxx(){return new this._Vec4(this[0],this[2],this[0],this[0])}get xzxy(){return new this._Vec4(this[0],this[2],this[0],this[1])}get xzxz(){return new this._Vec4(this[0],this[2],this[0],this[2])}get xzxw(){return new this._Vec4(this[0],this[2],this[0],this[3])}get xzyx(){return new this._Vec4(this[0],this[2],this[1],this[0])}get xzyy(){return new this._Vec4(this[0],this[2],this[1],this[1])}get xzyz(){return new this._Vec4(this[0],this[2],this[1],this[2])}get xzyw(){return new this._Vec4(this[0],this[2],this[1],this[3])}get xzzx(){return new this._Vec4(this[0],this[2],this[2],this[0])}get xzzy(){return new this._Vec4(this[0],this[2],this[2],this[1])}get xzzz(){return new this._Vec4(this[0],this[2],this[2],this[2])}get xzzw(){return new this._Vec4(this[0],this[2],this[2],this[3])}get xzwx(){return new this._Vec4(this[0],this[2],this[3],this[0])}get xzwy(){return new this._Vec4(this[0],this[2],this[3],this[1])}get xzwz(){return new this._Vec4(this[0],this[2],this[3],this[2])}get xzww(){return new this._Vec4(this[0],this[2],this[3],this[3])}get xwxx(){return new this._Vec4(this[0],this[3],this[0],this[0])}get xwxy(){return new this._Vec4(this[0],this[3],this[0],this[1])}get xwxz(){return new this._Vec4(this[0],this[3],this[0],this[2])}get xwxw(){return new this._Vec4(this[0],this[3],this[0],this[3])}get xwyx(){return new this._Vec4(this[0],this[3],this[1],this[0])}get xwyy(){return new this._Vec4(this[0],this[3],this[1],this[1])}get xwyz(){return new this._Vec4(this[0],this[3],this[1],this[2])}get xwyw(){return new this._Vec4(this[0],this[3],this[1],this[3])}get xwzx(){return new this._Vec4(this[0],this[3],this[2],this[0])}get xwzy(){return new this._Vec4(this[0],this[3],this[2],this[1])}get xwzz(){return new this._Vec4(this[0],this[3],this[2],this[2])}get xwzw(){return new this._Vec4(this[0],this[3],this[2],this[3])}get xwwx(){return new this._Vec4(this[0],this[3],this[3],this[0])}get xwwy(){return new this._Vec4(this[0],this[3],this[3],this[1])}get xwwz(){return new this._Vec4(this[0],this[3],this[3],this[2])}get xwww(){return new this._Vec4(this[0],this[3],this[3],this[3])}get yxxx(){return new this._Vec4(this[1],this[0],this[0],this[0])}get yxxy(){return new this._Vec4(this[1],this[0],this[0],this[1])}get yxxz(){return new this._Vec4(this[1],this[0],this[0],this[2])}get yxxw(){return new this._Vec4(this[1],this[0],this[0],this[3])}get yxyx(){return new this._Vec4(this[1],this[0],this[1],this[0])}get yxyy(){return new this._Vec4(this[1],this[0],this[1],this[1])}get yxyz(){return new this._Vec4(this[1],this[0],this[1],this[2])}get yxyw(){return new this._Vec4(this[1],this[0],this[1],this[3])}get yxzx(){return new this._Vec4(this[1],this[0],this[2],this[0])}get yxzy(){return new this._Vec4(this[1],this[0],this[2],this[1])}get yxzz(){return new this._Vec4(this[1],this[0],this[2],this[2])}get yxzw(){return new this._Vec4(this[1],this[0],this[2],this[3])}get yxwx(){return new this._Vec4(this[1],this[0],this[3],this[0])}get yxwy(){return new this._Vec4(this[1],this[0],this[3],this[1])}get yxwz(){return new this._Vec4(this[1],this[0],this[3],this[2])}get yxww(){return new this._Vec4(this[1],this[0],this[3],this[3])}get yyxx(){return new this._Vec4(this[1],this[1],this[0],this[0])}get yyxy(){return new this._Vec4(this[1],this[1],this[0],this[1])}get yyxz(){return new this._Vec4(this[1],this[1],this[0],this[2])}get yyxw(){return new this._Vec4(this[1],this[1],this[0],this[3])}get yyyx(){return new this._Vec4(this[1],this[1],this[1],this[0])}get yyyy(){return new this._Vec4(this[1],this[1],this[1],this[1])}get yyyz(){return new this._Vec4(this[1],this[1],this[1],this[2])}get yyyw(){return new this._Vec4(this[1],this[1],this[1],this[3])}get yyzx(){return new this._Vec4(this[1],this[1],this[2],this[0])}get yyzy(){return new this._Vec4(this[1],this[1],this[2],this[1])}get yyzz(){return new this._Vec4(this[1],this[1],this[2],this[2])}get yyzw(){return new this._Vec4(this[1],this[1],this[2],this[3])}get yywx(){return new this._Vec4(this[1],this[1],this[3],this[0])}get yywy(){return new this._Vec4(this[1],this[1],this[3],this[1])}get yywz(){return new this._Vec4(this[1],this[1],this[3],this[2])}get yyww(){return new this._Vec4(this[1],this[1],this[3],this[3])}get yzxx(){return new this._Vec4(this[1],this[2],this[0],this[0])}get yzxy(){return new this._Vec4(this[1],this[2],this[0],this[1])}get yzxz(){return new this._Vec4(this[1],this[2],this[0],this[2])}get yzxw(){return new this._Vec4(this[1],this[2],this[0],this[3])}get yzyx(){return new this._Vec4(this[1],this[2],this[1],this[0])}get yzyy(){return new this._Vec4(this[1],this[2],this[1],this[1])}get yzyz(){return new this._Vec4(this[1],this[2],this[1],this[2])}get yzyw(){return new this._Vec4(this[1],this[2],this[1],this[3])}get yzzx(){return new this._Vec4(this[1],this[2],this[2],this[0])}get yzzy(){return new this._Vec4(this[1],this[2],this[2],this[1])}get yzzz(){return new this._Vec4(this[1],this[2],this[2],this[2])}get yzzw(){return new this._Vec4(this[1],this[2],this[2],this[3])}get yzwx(){return new this._Vec4(this[1],this[2],this[3],this[0])}get yzwy(){return new this._Vec4(this[1],this[2],this[3],this[1])}get yzwz(){return new this._Vec4(this[1],this[2],this[3],this[2])}get yzww(){return new this._Vec4(this[1],this[2],this[3],this[3])}get ywxx(){return new this._Vec4(this[1],this[3],this[0],this[0])}get ywxy(){return new this._Vec4(this[1],this[3],this[0],this[1])}get ywxz(){return new this._Vec4(this[1],this[3],this[0],this[2])}get ywxw(){return new this._Vec4(this[1],this[3],this[0],this[3])}get ywyx(){return new this._Vec4(this[1],this[3],this[1],this[0])}get ywyy(){return new this._Vec4(this[1],this[3],this[1],this[1])}get ywyz(){return new this._Vec4(this[1],this[3],this[1],this[2])}get ywyw(){return new this._Vec4(this[1],this[3],this[1],this[3])}get ywzx(){return new this._Vec4(this[1],this[3],this[2],this[0])}get ywzy(){return new this._Vec4(this[1],this[3],this[2],this[1])}get ywzz(){return new this._Vec4(this[1],this[3],this[2],this[2])}get ywzw(){return new this._Vec4(this[1],this[3],this[2],this[3])}get ywwx(){return new this._Vec4(this[1],this[3],this[3],this[0])}get ywwy(){return new this._Vec4(this[1],this[3],this[3],this[1])}get ywwz(){return new this._Vec4(this[1],this[3],this[3],this[2])}get ywww(){return new this._Vec4(this[1],this[3],this[3],this[3])}get zxxx(){return new this._Vec4(this[2],this[0],this[0],this[0])}get zxxy(){return new this._Vec4(this[2],this[0],this[0],this[1])}get zxxz(){return new this._Vec4(this[2],this[0],this[0],this[2])}get zxxw(){return new this._Vec4(this[2],this[0],this[0],this[3])}get zxyx(){return new this._Vec4(this[2],this[0],this[1],this[0])}get zxyy(){return new this._Vec4(this[2],this[0],this[1],this[1])}get zxyz(){return new this._Vec4(this[2],this[0],this[1],this[2])}get zxyw(){return new this._Vec4(this[2],this[0],this[1],this[3])}get zxzx(){return new this._Vec4(this[2],this[0],this[2],this[0])}get zxzy(){return new this._Vec4(this[2],this[0],this[2],this[1])}get zxzz(){return new this._Vec4(this[2],this[0],this[2],this[2])}get zxzw(){return new this._Vec4(this[2],this[0],this[2],this[3])}get zxwx(){return new this._Vec4(this[2],this[0],this[3],this[0])}get zxwy(){return new this._Vec4(this[2],this[0],this[3],this[1])}get zxwz(){return new this._Vec4(this[2],this[0],this[3],this[2])}get zxww(){return new this._Vec4(this[2],this[0],this[3],this[3])}get zyxx(){return new this._Vec4(this[2],this[1],this[0],this[0])}get zyxy(){return new this._Vec4(this[2],this[1],this[0],this[1])}get zyxz(){return new this._Vec4(this[2],this[1],this[0],this[2])}get zyxw(){return new this._Vec4(this[2],this[1],this[0],this[3])}get zyyx(){return new this._Vec4(this[2],this[1],this[1],this[0])}get zyyy(){return new this._Vec4(this[2],this[1],this[1],this[1])}get zyyz(){return new this._Vec4(this[2],this[1],this[1],this[2])}get zyyw(){return new this._Vec4(this[2],this[1],this[1],this[3])}get zyzx(){return new this._Vec4(this[2],this[1],this[2],this[0])}get zyzy(){return new this._Vec4(this[2],this[1],this[2],this[1])}get zyzz(){return new this._Vec4(this[2],this[1],this[2],this[2])}get zyzw(){return new this._Vec4(this[2],this[1],this[2],this[3])}get zywx(){return new this._Vec4(this[2],this[1],this[3],this[0])}get zywy(){return new this._Vec4(this[2],this[1],this[3],this[1])}get zywz(){return new this._Vec4(this[2],this[1],this[3],this[2])}get zyww(){return new this._Vec4(this[2],this[1],this[3],this[3])}get zzxx(){return new this._Vec4(this[2],this[2],this[0],this[0])}get zzxy(){return new this._Vec4(this[2],this[2],this[0],this[1])}get zzxz(){return new this._Vec4(this[2],this[2],this[0],this[2])}get zzxw(){return new this._Vec4(this[2],this[2],this[0],this[3])}get zzyx(){return new this._Vec4(this[2],this[2],this[1],this[0])}get zzyy(){return new this._Vec4(this[2],this[2],this[1],this[1])}get zzyz(){return new this._Vec4(this[2],this[2],this[1],this[2])}get zzyw(){return new this._Vec4(this[2],this[2],this[1],this[3])}get zzzx(){return new this._Vec4(this[2],this[2],this[2],this[0])}get zzzy(){return new this._Vec4(this[2],this[2],this[2],this[1])}get zzzz(){return new this._Vec4(this[2],this[2],this[2],this[2])}get zzzw(){return new this._Vec4(this[2],this[2],this[2],this[3])}get zzwx(){return new this._Vec4(this[2],this[2],this[3],this[0])}get zzwy(){return new this._Vec4(this[2],this[2],this[3],this[1])}get zzwz(){return new this._Vec4(this[2],this[2],this[3],this[2])}get zzww(){return new this._Vec4(this[2],this[2],this[3],this[3])}get zwxx(){return new this._Vec4(this[2],this[3],this[0],this[0])}get zwxy(){return new this._Vec4(this[2],this[3],this[0],this[1])}get zwxz(){return new this._Vec4(this[2],this[3],this[0],this[2])}get zwxw(){return new this._Vec4(this[2],this[3],this[0],this[3])}get zwyx(){return new this._Vec4(this[2],this[3],this[1],this[0])}get zwyy(){return new this._Vec4(this[2],this[3],this[1],this[1])}get zwyz(){return new this._Vec4(this[2],this[3],this[1],this[2])}get zwyw(){return new this._Vec4(this[2],this[3],this[1],this[3])}get zwzx(){return new this._Vec4(this[2],this[3],this[2],this[0])}get zwzy(){return new this._Vec4(this[2],this[3],this[2],this[1])}get zwzz(){return new this._Vec4(this[2],this[3],this[2],this[2])}get zwzw(){return new this._Vec4(this[2],this[3],this[2],this[3])}get zwwx(){return new this._Vec4(this[2],this[3],this[3],this[0])}get zwwy(){return new this._Vec4(this[2],this[3],this[3],this[1])}get zwwz(){return new this._Vec4(this[2],this[3],this[3],this[2])}get zwww(){return new this._Vec4(this[2],this[3],this[3],this[3])}get wxxx(){return new this._Vec4(this[3],this[0],this[0],this[0])}get wxxy(){return new this._Vec4(this[3],this[0],this[0],this[1])}get wxxz(){return new this._Vec4(this[3],this[0],this[0],this[2])}get wxxw(){return new this._Vec4(this[3],this[0],this[0],this[3])}get wxyx(){return new this._Vec4(this[3],this[0],this[1],this[0])}get wxyy(){return new this._Vec4(this[3],this[0],this[1],this[1])}get wxyz(){return new this._Vec4(this[3],this[0],this[1],this[2])}get wxyw(){return new this._Vec4(this[3],this[0],this[1],this[3])}get wxzx(){return new this._Vec4(this[3],this[0],this[2],this[0])}get wxzy(){return new this._Vec4(this[3],this[0],this[2],this[1])}get wxzz(){return new this._Vec4(this[3],this[0],this[2],this[2])}get wxzw(){return new this._Vec4(this[3],this[0],this[2],this[3])}get wxwx(){return new this._Vec4(this[3],this[0],this[3],this[0])}get wxwy(){return new this._Vec4(this[3],this[0],this[3],this[1])}get wxwz(){return new this._Vec4(this[3],this[0],this[3],this[2])}get wxww(){return new this._Vec4(this[3],this[0],this[3],this[3])}get wyxx(){return new this._Vec4(this[3],this[1],this[0],this[0])}get wyxy(){return new this._Vec4(this[3],this[1],this[0],this[1])}get wyxz(){return new this._Vec4(this[3],this[1],this[0],this[2])}get wyxw(){return new this._Vec4(this[3],this[1],this[0],this[3])}get wyyx(){return new this._Vec4(this[3],this[1],this[1],this[0])}get wyyy(){return new this._Vec4(this[3],this[1],this[1],this[1])}get wyyz(){return new this._Vec4(this[3],this[1],this[1],this[2])}get wyyw(){return new this._Vec4(this[3],this[1],this[1],this[3])}get wyzx(){return new this._Vec4(this[3],this[1],this[2],this[0])}get wyzy(){return new this._Vec4(this[3],this[1],this[2],this[1])}get wyzz(){return new this._Vec4(this[3],this[1],this[2],this[2])}get wyzw(){return new this._Vec4(this[3],this[1],this[2],this[3])}get wywx(){return new this._Vec4(this[3],this[1],this[3],this[0])}get wywy(){return new this._Vec4(this[3],this[1],this[3],this[1])}get wywz(){return new this._Vec4(this[3],this[1],this[3],this[2])}get wyww(){return new this._Vec4(this[3],this[1],this[3],this[3])}get wzxx(){return new this._Vec4(this[3],this[2],this[0],this[0])}get wzxy(){return new this._Vec4(this[3],this[2],this[0],this[1])}get wzxz(){return new this._Vec4(this[3],this[2],this[0],this[2])}get wzxw(){return new this._Vec4(this[3],this[2],this[0],this[3])}get wzyx(){return new this._Vec4(this[3],this[2],this[1],this[0])}get wzyy(){return new this._Vec4(this[3],this[2],this[1],this[1])}get wzyz(){return new this._Vec4(this[3],this[2],this[1],this[2])}get wzyw(){return new this._Vec4(this[3],this[2],this[1],this[3])}get wzzx(){return new this._Vec4(this[3],this[2],this[2],this[0])}get wzzy(){return new this._Vec4(this[3],this[2],this[2],this[1])}get wzzz(){return new this._Vec4(this[3],this[2],this[2],this[2])}get wzzw(){return new this._Vec4(this[3],this[2],this[2],this[3])}get wzwx(){return new this._Vec4(this[3],this[2],this[3],this[0])}get wzwy(){return new this._Vec4(this[3],this[2],this[3],this[1])}get wzwz(){return new this._Vec4(this[3],this[2],this[3],this[2])}get wzww(){return new this._Vec4(this[3],this[2],this[3],this[3])}get wwxx(){return new this._Vec4(this[3],this[3],this[0],this[0])}get wwxy(){return new this._Vec4(this[3],this[3],this[0],this[1])}get wwxz(){return new this._Vec4(this[3],this[3],this[0],this[2])}get wwxw(){return new this._Vec4(this[3],this[3],this[0],this[3])}get wwyx(){return new this._Vec4(this[3],this[3],this[1],this[0])}get wwyy(){return new this._Vec4(this[3],this[3],this[1],this[1])}get wwyz(){return new this._Vec4(this[3],this[3],this[1],this[2])}get wwyw(){return new this._Vec4(this[3],this[3],this[1],this[3])}get wwzx(){return new this._Vec4(this[3],this[3],this[2],this[0])}get wwzy(){return new this._Vec4(this[3],this[3],this[2],this[1])}get wwzz(){return new this._Vec4(this[3],this[3],this[2],this[2])}get wwzw(){return new this._Vec4(this[3],this[3],this[2],this[3])}get wwwx(){return new this._Vec4(this[3],this[3],this[3],this[0])}get wwwy(){return new this._Vec4(this[3],this[3],this[3],this[1])}get wwwz(){return new this._Vec4(this[3],this[3],this[3],this[2])}get wwww(){return new this._Vec4(this[3],this[3],this[3],this[3])}},c=class extends v{constructor(s,i){var h;super(2);r(this,0);r(this,1);this[0]=s!=null?s:0,this[1]=(h=i!=null?i:s)!=null?h:0}get x(){return this[0]}get y(){return this[1]}set x(s){this[0]=s}set y(s){this[1]=s}},g=class extends v{constructor(s,i,h){var n,w;super(3);r(this,0);r(this,1);r(this,2);this[0]=s!=null?s:0,this[1]=(n=i!=null?i:s)!=null?n:0,this[2]=(w=h!=null?h:s)!=null?w:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(s){this[0]=s}set y(s){this[1]=s}set z(s){this[2]=s}},y=class extends v{constructor(s,i,h,n){var w,P,A;super(4);r(this,0);r(this,1);r(this,2);r(this,3);this[0]=s!=null?s:0,this[1]=(w=i!=null?i:s)!=null?w:0,this[2]=(P=h!=null?h:s)!=null?P:0,this[3]=(A=n!=null?n:s)!=null?A:0}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(s){this[0]=s}set y(s){this[1]=s}set z(s){this[2]=s}set w(s){this[3]=s}},x=class e extends c{get kind(){return"vec2f"}get _Vec2(){return e}get _Vec3(){return m}get _Vec4(){return p}},o=class e extends c{get kind(){return"vec2h"}get _Vec2(){return e}get _Vec3(){return z}get _Vec4(){return b}},V=class e extends c{get kind(){return"vec2i"}get _Vec2(){return e}get _Vec3(){return a}get _Vec4(){return f}},_=class e extends c{get kind(){return"vec2u"}get _Vec2(){return e}get _Vec3(){return l}get _Vec4(){return d}},m=class e extends g{get kind(){return"vec3f"}get _Vec2(){return x}get _Vec3(){return e}get _Vec4(){return p}},z=class e extends g{get kind(){return"vec3h"}get _Vec2(){return o}get _Vec3(){return e}get _Vec4(){return b}},a=class e extends g{get kind(){return"vec3i"}get _Vec2(){return V}get _Vec3(){return e}get _Vec4(){return f}},l=class e extends g{get kind(){return"vec3u"}get _Vec2(){return _}get _Vec3(){return e}get _Vec4(){return d}},p=class e extends y{get kind(){return"vec4f"}get _Vec2(){return x}get _Vec3(){return m}get _Vec4(){return e}},b=class e extends y{get kind(){return"vec4h"}get _Vec2(){return o}get _Vec3(){return z}get _Vec4(){return e}},f=class e extends y{get kind(){return"vec4i"}get _Vec2(){return V}get _Vec3(){return a}get _Vec4(){return e}},d=class e extends y{get kind(){return"vec4u"}get _Vec2(){return _}get _Vec3(){return l}get _Vec4(){return e}};function u(e){let{kind:t,length:s}=new e;return Object.assign((...h)=>{let n=h;if(k())return`${t}(${n.join(", ")})`;if(n.length<=1||n.length===s)return new e(...n);throw new Error(`'${t}' constructor called with invalid number of arguments.`)},{type:t,"~repr":void 0})}var q=u(x),xt= exports.o =u(o),ot= exports.p =u(V),Vt= exports.q =u(_),H= exports.r =u(m),_t= exports.s =u(z),mt= exports.t =u(a),zt= exports.u =u(l),J= exports.v =u(p),at= exports.w =u(b),lt= exports.x =u(f),pt= exports.y =u(d);function E(e){let t={"~repr":void 0,type:e.type,label:e.type};return Object.assign((...i)=>{if(k())return`${t.type}(${i.join(", ")})`;let h=[];for(let n of i)if(typeof n=="number")h.push(n);else for(let w=0;w<n.length;++w)h.push(n[w]);for(let n=h.length;n<e.columns*e.rows;++n)h.push(0);return e.makeFromElements(...h)},t)}var O=class{constructor(...t){r(this,"columns");r(this,"length",4);this.columns=[this.makeColumn(t[0],t[1]),this.makeColumn(t[2],t[3])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[1].x}get 3(){return this.columns[1].y}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[1].x=t}set 3(t){this.columns[1].y=t}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,s)=>this[s]).join(", ")})`}},j=class extends O{constructor(){super(...arguments);r(this,"kind","mat2x2f")}makeColumn(s,i){return q(s,i)}},M=class{constructor(...t){r(this,"columns");r(this,"length",12);this.columns=[this.makeColumn(t[0],t[1],t[2]),this.makeColumn(t[3],t[4],t[5]),this.makeColumn(t[6],t[7],t[8])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return 0}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return 0}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return 0}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){}"~resolve"(){return`${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`}},S=class extends M{constructor(){super(...arguments);r(this,"kind","mat3x3f")}makeColumn(s,i,h){return H(s,i,h)}},B=class{constructor(...t){r(this,"columns");r(this,"length",16);this.columns=[this.makeColumn(t[0],t[1],t[2],t[3]),this.makeColumn(t[4],t[5],t[6],t[7]),this.makeColumn(t[8],t[9],t[10],t[11]),this.makeColumn(t[12],t[13],t[14],t[15])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return this.columns[0].w}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return this.columns[1].w}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return this.columns[2].w}get 12(){return this.columns[3].x}get 13(){return this.columns[3].y}get 14(){return this.columns[3].z}get 15(){return this.columns[3].w}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){this.columns[0].w=t}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){this.columns[1].w=t}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){this.columns[2].w=t}set 12(t){this.columns[3].x=t}set 13(t){this.columns[3].y=t}set 14(t){this.columns[3].z=t}set 15(t){this.columns[3].w=t}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,s)=>this[s]).join(", ")})`}},R=class extends B{constructor(){super(...arguments);r(this,"kind","mat4x4f")}makeColumn(s,i,h,n){return J(s,i,h,n)}},Tt= exports.z =E({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...e)=>new j(...e)}),vt= exports.A =E({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...e)=>new S(...e)}),kt= exports.B =E({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...e)=>new R(...e)});function Ct(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,s)=>e[s])}exports.a = tt; exports.b = et; exports.c = r; exports.d = N; exports.e = D; exports.f = F; exports.g = K; exports.h = U; exports.i = L; exports.j = W; exports.k = nt; exports.l = rt; exports.m = k; exports.n = q; exports.o = xt; exports.p = ot; exports.q = Vt; exports.r = H; exports.s = _t; exports.t = mt; exports.u = zt; exports.v = J; exports.w = at; exports.x = lt; exports.y = pt; exports.z = Tt; exports.A = vt; exports.B = kt; exports.C = Ct;
4
- //# sourceMappingURL=chunk-7X4KDNDZ.cjs.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk7X4KDNDZcjs = require('./chunk-7X4KDNDZ.cjs');var _typedbinary = require('typed-binary'); var _typedbinary2 = _interopRequireDefault(_typedbinary);var re={type:"bool"},ne=e=>_chunk7X4KDNDZcjs.m.call(void 0, )?`u32(${e})`:typeof e=="boolean"?e?1:0:Number.isInteger(e)?((e<0||e>4294967295)&&console.warn(`u32 value ${e} overflowed`),(e&4294967295)>>>0):Math.max(0,Math.min(4294967295,Math.floor(e))),y= exports.u =Object.assign(ne,{type:"u32"}),oe=e=>{if(_chunk7X4KDNDZcjs.m.call(void 0, ))return`i32(${e})`;if(typeof e=="boolean")return e?1:0;if(Number.isInteger(e))return(e<-2147483648||e>2147483647)&&console.warn(`i32 value ${e} overflowed`),(e|0)&4294967295;let t=e<0?Math.ceil(e):Math.floor(e);return Math.max(-2147483648,Math.min(2147483647,t))},h= exports.v =Object.assign(oe,{type:"i32"}),ae=e=>{if(_chunk7X4KDNDZcjs.m.call(void 0, ))return`f32(${e})`;if(typeof e=="boolean")return e?1:0;let t=new Float32Array(1);return t[0]=e,t[0]},x= exports.w =Object.assign(ae,{type:"f32"}),ie=e=>{if(_chunk7X4KDNDZcjs.m.call(void 0, ))return`f16(${e})`;if(typeof e=="boolean")return e?1:0;let t=new ArrayBuffer(2);return _typedbinary2.default.f16.write(new _typedbinary2.default.BufferWriter(t),e),_typedbinary2.default.f16.read(new _typedbinary2.default.BufferReader(t))},ye= exports.x =Object.assign(ie,{type:"f16"});var le=["bool","f32","f16","i32","u32","vec2f","vec2h","vec2i","vec2u","vec3f","vec3h","vec3i","vec3u","vec4f","vec4h","vec4i","vec4u","mat2x2f","mat3x3f","mat4x4f","struct","array","ptrFn","atomic","decorated"];function S(e){return le.includes(e==null?void 0:e.type)}function k(e){return(e==null?void 0:e.type)==="array"}function L(e){return(e==null?void 0:e.type)==="struct"}function xe(e){return(e==null?void 0:e.type)==="ptrFn"}function se(e){return(e==null?void 0:e.type)==="atomic"}function P(e){return(e==null?void 0:e.type)==="@align"}function _(e){return(e==null?void 0:e.type)==="@size"}function R(e){return(e==null?void 0:e.type)==="@location"}function ue(e){return(e==null?void 0:e.type)==="@interpolate"}function $(e){return(e==null?void 0:e.type)==="@builtin"}function m(e){return(e==null?void 0:e.type)==="decorated"}function de(e){let t=n=>n;return Object.setPrototypeOf(t,me),t.propTypes=e,t}var me={type:"struct",_label:void 0,get label(){return this._label},$name(e){return this._label=e,this},toString(){var e;return`struct:${(e=this.label)!=null?e:"<unnamed>"}`}};var b=(e,t)=>{let n=t-1,a=~n;return e&n?(e&a)+t:e};var Q=["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"],Re= exports.m ={f32:"float32",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",f16:"float16",vec2h:"float16x2",vec4h:"float16x4",u32:"uint32",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",i32:"sint32",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4"};var Te=["unstruct","disarray","loose-decorated",...Q];function C(e){return Te.includes(e==null?void 0:e.type)}function w(e){return(e==null?void 0:e.type)==="disarray"}function z(e){return(e==null?void 0:e.type)==="unstruct"}function d(e){return(e==null?void 0:e.type)==="loose-decorated"}function g(e){var t,n;return(n=(t=e.attribs)==null?void 0:t.find(P))==null?void 0:n.value}function X(e){var t,n;return(n=(t=e.attribs)==null?void 0:t.find(_))==null?void 0:n.value}function Ge(e){var t,n;return(n=(t=e.attribs)==null?void 0:t.find(R))==null?void 0:n.value}function ce(e){return S(e)||C(e)}var r=class{constructor(t){this.type=t;_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr")}},fe= exports.A ={uint8:y,uint8x2:_chunk7X4KDNDZcjs.q,uint8x4:_chunk7X4KDNDZcjs.y,sint8:h,sint8x2:_chunk7X4KDNDZcjs.p,sint8x4:_chunk7X4KDNDZcjs.x,unorm8:x,unorm8x2:_chunk7X4KDNDZcjs.n,unorm8x4:_chunk7X4KDNDZcjs.v,snorm8:x,snorm8x2:_chunk7X4KDNDZcjs.n,snorm8x4:_chunk7X4KDNDZcjs.v,uint16:y,uint16x2:_chunk7X4KDNDZcjs.q,uint16x4:_chunk7X4KDNDZcjs.y,sint16:h,sint16x2:_chunk7X4KDNDZcjs.p,sint16x4:_chunk7X4KDNDZcjs.x,unorm16:x,unorm16x2:_chunk7X4KDNDZcjs.n,unorm16x4:_chunk7X4KDNDZcjs.v,snorm16:x,snorm16x2:_chunk7X4KDNDZcjs.n,snorm16x4:_chunk7X4KDNDZcjs.v,float16:x,float16x2:_chunk7X4KDNDZcjs.n,float16x4:_chunk7X4KDNDZcjs.v,float32:x,float32x2:_chunk7X4KDNDZcjs.n,float32x3:_chunk7X4KDNDZcjs.r,float32x4:_chunk7X4KDNDZcjs.v,uint32:y,uint32x2:_chunk7X4KDNDZcjs.q,uint32x3:_chunk7X4KDNDZcjs.u,uint32x4:_chunk7X4KDNDZcjs.y,sint32:h,sint32x2:_chunk7X4KDNDZcjs.p,sint32x3:_chunk7X4KDNDZcjs.t,sint32x4:_chunk7X4KDNDZcjs.x,"unorm10-10-10-2":_chunk7X4KDNDZcjs.v,"unorm8x4-bgra":_chunk7X4KDNDZcjs.v},Y= exports.B =Object.keys(fe),qe= exports.C =new r("uint8"),Qe= exports.D =new r("uint8x2"),Xe= exports.E =new r("uint8x4"),Ye= exports.F =new r("sint8"),Ze= exports.G =new r("sint8x2"),et= exports.H =new r("sint8x4"),tt= exports.I =new r("unorm8"),rt= exports.J =new r("unorm8x2"),nt= exports.K =new r("unorm8x4"),ot= exports.L =new r("snorm8"),at= exports.M =new r("snorm8x2"),it= exports.N =new r("snorm8x4"),yt= exports.O =new r("uint16"),lt= exports.P =new r("uint16x2"),xt= exports.Q =new r("uint16x4"),st= exports.R =new r("sint16"),ut= exports.S =new r("sint16x2"),pt= exports.T =new r("sint16x4"),dt= exports.U =new r("unorm16"),mt= exports.V =new r("unorm16x2"),Tt= exports.W =new r("unorm16x4"),ct= exports.X =new r("snorm16"),ft= exports.Y =new r("snorm16x2"),bt= exports.Z =new r("snorm16x4"),wt= exports._ =new r("float16"),zt= exports.$ =new r("float16x2"),gt= exports.aa =new r("float16x4"),vt= exports.ba =new r("float32"),Dt= exports.ca =new r("float32x2"),It= exports.da =new r("float32x3"),At= exports.ea =new r("float32x4"),Vt= exports.fa =new r("uint32"),Bt= exports.ga =new r("uint32x2"),Ft= exports.ha =new r("uint32x3"),ht= exports.ia =new r("uint32x4"),St= exports.ja =new r("sint32"),kt= exports.ka =new r("sint32x2"),Lt= exports.la =new r("sint32x3"),Pt= exports.ma =new r("sint32x4"),_t= exports.na =new r("unorm10-10-10-2"),Wt= exports.oa =new r("unorm8x4-bgra");var be={bool:4,f32:4,f16:2,i32:4,u32:4,vec2f:8,vec2h:4,vec2i:8,vec2u:8,vec3f:16,vec3h:8,vec3i:16,vec3u:16,vec4f:16,vec4h:8,vec4i:16,vec4u:16,mat2x2f:8,mat3x3f:16,mat4x4f:16,atomic:4};function we(e){var a,p,D;let t=e==null?void 0:e.type,n=be[t];if(n!==void 0)return n;if(L(e))return Object.values(e.propTypes).map(s).reduce((T,q)=>T>q?T:q);if(k(e))return s(e.elementType);if(z(e)){let T=Object.values(e.propTypes)[0];return T&&(a=g(T))!=null?a:1}if(w(e))return(p=g(e.elementType))!=null?p:1;if(m(e)||d(e))return(D=g(e))!=null?D:s(e.inner);if(Y.includes(t))return 1;throw new Error(`Cannot determine alignment of data: ${JSON.stringify(e)}`)}function ze(e){var t,n;if(z(e)){let a=Object.values(e.propTypes)[0];return a?v(a):1}return w(e)?v(e.elementType):d(e)?(t=g(e))!=null?t:v(e.inner):(n=g(e))!=null?n:1}var Z=new WeakMap,ee=new WeakMap;function s(e){let t=Z.get(e);return t===void 0&&(t=we(e),Z.set(e,t)),t}function v(e){let t=ee.get(e);return t===void 0&&(t=ze(e),ee.set(e,t)),t}function ge(e){return s(e)}var ve={bool:4,f32:4,f16:2,i32:4,u32:4,vec2f:8,vec2h:4,vec2i:8,vec2u:8,vec3f:12,vec3h:6,vec3i:12,vec3u:12,vec4f:16,vec4h:8,vec4i:16,vec4u:16,mat2x2f:16,mat3x3f:48,mat4x4f:64,uint8:1,uint8x2:2,uint8x4:4,sint8:1,sint8x2:2,sint8x4:4,unorm8:1,unorm8x2:2,unorm8x4:4,snorm8:1,snorm8x2:2,snorm8x4:4,uint16:2,uint16x2:4,uint16x4:8,sint16:2,sint16x2:4,sint16x4:8,unorm16:2,unorm16x2:4,unorm16x4:8,snorm16:2,snorm16x2:4,snorm16x4:8,float16:2,float16x2:4,float16x4:8,float32:4,float32x2:8,float32x3:12,float32x4:16,uint32:4,uint32x2:8,uint32x3:12,uint32x4:16,sint32:4,sint32x2:8,sint32x3:12,sint32x4:16,"unorm10-10-10-2":4,"unorm8x4-bgra":4,atomic:4};function De(e){let t=0;for(let n of Object.values(e.propTypes)){if(Number.isNaN(t))throw new Error("Only the last property of a struct can be unbounded");if(t=b(t,s(n)),t+=u(n),Number.isNaN(t)&&n.type!=="array")throw new Error("Cannot nest unbounded struct within another struct")}return b(t,s(e))}function Ie(e){let t=0;for(let n of Object.values(e.propTypes)){let a=v(n);t=b(t,a),t+=u(n)}return t}function Ae(e){var n;let t=ve[e==null?void 0:e.type];if(t!==void 0)return t;if(L(e))return De(e);if(z(e))return Ie(e);if(k(e)){if(e.elementCount===0)return Number.NaN;let a=s(e.elementType);return b(u(e.elementType),a)*e.elementCount}if(w(e)){let a=v(e.elementType);return b(u(e.elementType),a)*e.elementCount}if(m(e)||d(e))return(n=X(e))!=null?n:u(e.inner);throw new Error(`Cannot determine size of data: ${e}`)}var te=new WeakMap;function u(e){let t=te.get(e);return t===void 0&&(t=Ae(e),te.set(e,t)),t}function Ve(e){return u(e)}function G(e,t){return new j(e,t)}var j=class{constructor(t,n){this.elementType=t;this.elementCount=n;_chunk7X4KDNDZcjs.c.call(void 0, this,"type","array");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~reprPartial");_chunk7X4KDNDZcjs.c.call(void 0, this,"~memIdent");if(Number.isNaN(u(t)))throw new Error("Cannot nest runtime sized arrays.");if(!Number.isInteger(n)||n<0)throw new Error(`Cannot create array schema with invalid element count: ${n}.`)}toString(){return`arrayOf(${this.elementType})`}};function Be(e){return{type:"ptrFn",inner:e}}function Fe(e,t){return new K(e,t)}var K=class{constructor(t,n){this.elementType=t;this.elementCount=n;_chunk7X4KDNDZcjs.c.call(void 0, this,"type","disarray");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~reprPartial");if(!Number.isInteger(n)||n<0)throw new Error(`Cannot create disarray schema with invalid element count: ${n}.`)}};function he(e){return new H(e)}var H=class{constructor(t){this.propTypes=t;_chunk7X4KDNDZcjs.c.call(void 0, this,"_label");_chunk7X4KDNDZcjs.c.call(void 0, this,"type","unstruct");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~reprPartial")}get label(){return this._label}$name(t){return this._label=t,this}};function Se(e){return new J(e)}var J=class{constructor(t){this.inner=t;_chunk7X4KDNDZcjs.c.call(void 0, this,"type","atomic");_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");_chunk7X4KDNDZcjs.c.call(void 0, this,"~memIdent")}};function i(e,t){return m(e)?new U(e.inner,[t,...e.attribs]):d(e)?new O(e.inner,[t,...e.attribs]):C(e)?new O(e,[t]):new U(e,[t])}function ke(e,t){return i(t,{type:"@align",value:e})}function Le(e,t){return i(t,{type:"@size",value:e})}function Pe(e,t){return i(t,{type:"@location",value:e})}function _e(e,t){return i(t,{type:"@interpolate",value:e})}function We(e){return(m(e)||d(e))&&e.attribs.find($)!==void 0}function yr(e){return!m(e)&&!d(e)?"":e.attribs.map(t=>`${t.type}(${t.value}) `).join("")}var M=class{constructor(t,n){this.inner=t;this.attribs=n;_chunk7X4KDNDZcjs.c.call(void 0, this,"~repr");var D,T;let a=(D=n.find(P))==null?void 0:D.value,p=(T=n.find(_))==null?void 0:T.value;if(a!==void 0){if(a<=0)throw new Error(`Custom data alignment must be a positive number, got: ${a}.`);if(Math.log2(a)%1!==0)throw new Error(`Alignment has to be a power of 2, got: ${a}.`);if(S(this.inner)&&a%s(this.inner)!==0)throw new Error(`Custom alignment has to be a multiple of the standard data alignment. Got: ${a}, expected multiple of: ${s(this.inner)}.`)}if(p!==void 0){if(p<u(this.inner))throw new Error(`Custom data size cannot be smaller then the standard data size. Got: ${p}, expected at least: ${u(this.inner)}.`);if(p<=0)throw new Error(`Custom data size must be a positive number. Got: ${p}.`)}}},U=class extends M{constructor(){super(...arguments);_chunk7X4KDNDZcjs.c.call(void 0, this,"type","decorated");_chunk7X4KDNDZcjs.c.call(void 0, this,"~memIdent")}},O=class extends M{constructor(){super(...arguments);_chunk7X4KDNDZcjs.c.call(void 0, this,"type","loose-decorated")}};var Ce={vertexIndex:i(y,{type:"@builtin",value:"vertex_index"}),instanceIndex:i(y,{type:"@builtin",value:"instance_index"}),position:i(_chunk7X4KDNDZcjs.v,{type:"@builtin",value:"position"}),clipDistances:i(G(y,8),{type:"@builtin",value:"clip_distances"}),frontFacing:i(x,{type:"@builtin",value:"front_facing"}),fragDepth:i(x,{type:"@builtin",value:"frag_depth"}),sampleIndex:i(y,{type:"@builtin",value:"sample_index"}),sampleMask:i(y,{type:"@builtin",value:"sample_mask"}),localInvocationId:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"local_invocation_id"}),localInvocationIndex:i(y,{type:"@builtin",value:"local_invocation_index"}),globalInvocationId:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"global_invocation_id"}),workgroupId:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"workgroup_id"}),numWorkgroups:i(_chunk7X4KDNDZcjs.u,{type:"@builtin",value:"num_workgroups"}),subgroupInvocationId:i(y,{type:"@builtin",value:"subgroup_invocation_id"}),subgroupSize:i(y,{type:"@builtin",value:"subgroup_size"})};exports.a = S; exports.b = k; exports.c = L; exports.d = xe; exports.e = se; exports.f = P; exports.g = _; exports.h = R; exports.i = ue; exports.j = $; exports.k = m; exports.l = Q; exports.m = Re; exports.n = C; exports.o = w; exports.p = z; exports.q = d; exports.r = Ge; exports.s = ce; exports.t = re; exports.u = y; exports.v = h; exports.w = x; exports.x = ye; exports.y = de; exports.z = b; exports.A = fe; exports.B = Y; exports.C = qe; exports.D = Qe; exports.E = Xe; exports.F = Ye; exports.G = Ze; exports.H = et; exports.I = tt; exports.J = rt; exports.K = nt; exports.L = ot; exports.M = at; exports.N = it; exports.O = yt; exports.P = lt; exports.Q = xt; exports.R = st; exports.S = ut; exports.T = pt; exports.U = dt; exports.V = mt; exports.W = Tt; exports.X = ct; exports.Y = ft; exports.Z = bt; exports._ = wt; exports.$ = zt; exports.aa = gt; exports.ba = vt; exports.ca = Dt; exports.da = It; exports.ea = At; exports.fa = Vt; exports.ga = Bt; exports.ha = Ft; exports.ia = ht; exports.ja = St; exports.ka = kt; exports.la = Lt; exports.ma = Pt; exports.na = _t; exports.oa = Wt; exports.pa = s; exports.qa = v; exports.ra = ge; exports.sa = u; exports.ta = Ve; exports.ua = G; exports.va = Be; exports.wa = Fe; exports.xa = he; exports.ya = Se; exports.za = i; exports.Aa = ke; exports.Ba = Le; exports.Ca = Pe; exports.Da = _e; exports.Ea = We; exports.Fa = yr; exports.Ga = Ce;
2
- //# sourceMappingURL=chunk-C6C35PDM.cjs.map