typegpu 0.5.8 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunk-APTRHY5Y.js +41 -0
- package/chunk-APTRHY5Y.js.map +1 -0
- package/chunk-RC26P3MP.cjs +2 -0
- package/chunk-RC26P3MP.cjs.map +1 -0
- package/chunk-RK6TMFVW.js +2 -0
- package/chunk-RK6TMFVW.js.map +1 -0
- package/chunk-S62QJDM6.js +2 -0
- package/chunk-S62QJDM6.js.map +1 -0
- package/chunk-TG4A6AM3.cjs +2 -0
- package/chunk-TG4A6AM3.cjs.map +1 -0
- package/chunk-UMHCZDPA.cjs +41 -0
- package/chunk-UMHCZDPA.cjs.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.cjs.map +1 -1
- package/data/index.d.cts +30 -77
- package/data/index.d.ts +30 -77
- package/data/index.js +1 -1
- package/index.cjs +21 -20
- package/index.cjs.map +1 -1
- package/index.d.cts +65 -12
- package/index.d.ts +65 -12
- package/index.js +21 -20
- package/index.js.map +1 -1
- package/matrix-BN6ObiMv.d.cts +122 -0
- package/matrix-S8W4dk8I.d.ts +122 -0
- package/package.json +1 -1
- package/std/index.cjs +1 -1
- package/std/index.cjs.map +1 -1
- package/std/index.d.cts +69 -2
- package/std/index.d.ts +69 -2
- package/std/index.js +1 -1
- package/std/index.js.map +1 -1
- package/{tgpuComputeFn-S61HxwW-.d.ts → tgpuComputeFn-DOUjhQua.d.cts} +402 -127
- package/{tgpuComputeFn-S61HxwW-.d.cts → tgpuComputeFn-DOUjhQua.d.ts} +402 -127
- package/chunk-7ACLI4JY.cjs +0 -2
- package/chunk-7ACLI4JY.cjs.map +0 -1
- package/chunk-L7HIBZAX.js +0 -4
- package/chunk-L7HIBZAX.js.map +0 -1
- package/chunk-SFECI7OX.js +0 -2
- package/chunk-SFECI7OX.js.map +0 -1
- package/chunk-SLWTVY6K.js +0 -2
- package/chunk-SLWTVY6K.js.map +0 -1
- package/chunk-TF6YPHJS.cjs +0 -2
- package/chunk-TF6YPHJS.cjs.map +0 -1
- package/chunk-V4CSEIB2.cjs +0 -4
- package/chunk-V4CSEIB2.cjs.map +0 -1
- /package/{LICENSE.md → LICENSE} +0 -0
package/data/index.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRC26P3MPcjs = require('../chunk-RC26P3MP.cjs');var _chunkUMHCZDPAcjs = require('../chunk-UMHCZDPA.cjs');exports.Void = _chunkUMHCZDPAcjs.C; exports.align = _chunkRC26P3MPcjs.Y; exports.alignmentOf = _chunkRC26P3MPcjs.U; exports.arrayOf = _chunkRC26P3MPcjs.X; exports.atomic = _chunkRC26P3MPcjs.ga; exports.bool = _chunkUMHCZDPAcjs.la; exports.builtin = _chunkRC26P3MPcjs.ha; exports.disarrayOf = _chunkRC26P3MPcjs.ea; exports.f16 = _chunkUMHCZDPAcjs.qa; exports.f32 = _chunkUMHCZDPAcjs.pa; exports.float16 = _chunkRC26P3MPcjs.B; exports.float16x2 = _chunkRC26P3MPcjs.C; exports.float16x4 = _chunkRC26P3MPcjs.D; exports.float32 = _chunkRC26P3MPcjs.E; exports.float32x2 = _chunkRC26P3MPcjs.F; exports.float32x3 = _chunkRC26P3MPcjs.G; exports.float32x4 = _chunkRC26P3MPcjs.H; exports.formatToWGSLType = _chunkRC26P3MPcjs.b; exports.i32 = _chunkUMHCZDPAcjs.oa; exports.interpolate = _chunkRC26P3MPcjs.$; exports.isAlignAttrib = _chunkUMHCZDPAcjs.R; exports.isAtomic = _chunkUMHCZDPAcjs.Q; exports.isBuiltin = _chunkRC26P3MPcjs.aa; exports.isBuiltinAttrib = _chunkUMHCZDPAcjs.V; exports.isData = _chunkUMHCZDPAcjs.da; exports.isDecorated = _chunkUMHCZDPAcjs.W; exports.isDisarray = _chunkUMHCZDPAcjs.Z; exports.isInterpolateAttrib = _chunkUMHCZDPAcjs.U; exports.isLocationAttrib = _chunkUMHCZDPAcjs.T; exports.isLooseData = _chunkUMHCZDPAcjs.Y; exports.isLooseDecorated = _chunkUMHCZDPAcjs.$; exports.isPtr = _chunkUMHCZDPAcjs.P; exports.isSizeAttrib = _chunkUMHCZDPAcjs.S; exports.isUnstruct = _chunkUMHCZDPAcjs._; exports.isWgslArray = _chunkUMHCZDPAcjs.N; exports.isWgslData = _chunkUMHCZDPAcjs.M; exports.isWgslStruct = _chunkUMHCZDPAcjs.O; exports.location = _chunkRC26P3MPcjs._; exports.mat2x2f = _chunkUMHCZDPAcjs.Pa; exports.mat3x3f = _chunkUMHCZDPAcjs.Qa; exports.mat4x4f = _chunkUMHCZDPAcjs.Ra; exports.matToArray = _chunkUMHCZDPAcjs.Sa; exports.packedFormats = _chunkRC26P3MPcjs.c; exports.ptrFn = _chunkUMHCZDPAcjs.Ta; exports.ptrHandle = _chunkUMHCZDPAcjs.Ya; exports.ptrPrivate = _chunkUMHCZDPAcjs.Ua; exports.ptrStorage = _chunkUMHCZDPAcjs.Wa; exports.ptrUniform = _chunkUMHCZDPAcjs.Xa; exports.ptrWorkgroup = _chunkUMHCZDPAcjs.Va; exports.sint16 = _chunkRC26P3MPcjs.s; exports.sint16x2 = _chunkRC26P3MPcjs.t; exports.sint16x4 = _chunkRC26P3MPcjs.u; exports.sint32 = _chunkRC26P3MPcjs.M; exports.sint32x2 = _chunkRC26P3MPcjs.N; exports.sint32x3 = _chunkRC26P3MPcjs.O; exports.sint32x4 = _chunkRC26P3MPcjs.P; exports.sint8 = _chunkRC26P3MPcjs.g; exports.sint8x2 = _chunkRC26P3MPcjs.h; exports.sint8x4 = _chunkRC26P3MPcjs.i; exports.size = _chunkRC26P3MPcjs.Z; exports.sizeOf = _chunkRC26P3MPcjs.W; exports.snorm16 = _chunkRC26P3MPcjs.y; exports.snorm16x2 = _chunkRC26P3MPcjs.z; exports.snorm16x4 = _chunkRC26P3MPcjs.A; exports.snorm8 = _chunkRC26P3MPcjs.m; exports.snorm8x2 = _chunkRC26P3MPcjs.n; exports.snorm8x4 = _chunkRC26P3MPcjs.o; exports.struct = _chunkRC26P3MPcjs.da; exports.u16 = _chunkUMHCZDPAcjs.na; exports.u32 = _chunkUMHCZDPAcjs.ma; exports.uint16 = _chunkRC26P3MPcjs.p; exports.uint16x2 = _chunkRC26P3MPcjs.q; exports.uint16x4 = _chunkRC26P3MPcjs.r; exports.uint32 = _chunkRC26P3MPcjs.I; exports.uint32x2 = _chunkRC26P3MPcjs.J; exports.uint32x3 = _chunkRC26P3MPcjs.K; exports.uint32x4 = _chunkRC26P3MPcjs.L; exports.uint8 = _chunkRC26P3MPcjs.d; exports.uint8x2 = _chunkRC26P3MPcjs.e; exports.uint8x4 = _chunkRC26P3MPcjs.f; exports.unorm10_10_10_2 = _chunkRC26P3MPcjs.Q; exports.unorm16 = _chunkRC26P3MPcjs.v; exports.unorm16x2 = _chunkRC26P3MPcjs.w; exports.unorm16x4 = _chunkRC26P3MPcjs.x; exports.unorm8 = _chunkRC26P3MPcjs.j; exports.unorm8x2 = _chunkRC26P3MPcjs.k; exports.unorm8x4 = _chunkRC26P3MPcjs.l; exports.unorm8x4_bgra = _chunkRC26P3MPcjs.R; exports.unstruct = _chunkRC26P3MPcjs.fa; exports.vec2b = _chunkUMHCZDPAcjs.va; exports.vec2f = _chunkUMHCZDPAcjs.ra; exports.vec2h = _chunkUMHCZDPAcjs.sa; exports.vec2i = _chunkUMHCZDPAcjs.ta; exports.vec2u = _chunkUMHCZDPAcjs.ua; exports.vec3b = _chunkUMHCZDPAcjs.Aa; exports.vec3f = _chunkUMHCZDPAcjs.wa; exports.vec3h = _chunkUMHCZDPAcjs.xa; exports.vec3i = _chunkUMHCZDPAcjs.ya; exports.vec3u = _chunkUMHCZDPAcjs.za; exports.vec4b = _chunkUMHCZDPAcjs.Fa; exports.vec4f = _chunkUMHCZDPAcjs.Ba; exports.vec4h = _chunkUMHCZDPAcjs.Ca; exports.vec4i = _chunkUMHCZDPAcjs.Da; exports.vec4u = _chunkUMHCZDPAcjs.Ea;
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/data/index.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["/Users/
|
1
|
+
{"version":3,"sources":["/Users/konradreczko/TypeGPU/wigsill/packages/typegpu/dist/data/index.cjs"],"names":[],"mappings":"AAAA,kIAAwd,yDAA6Z,ylIAA89C","file":"/Users/konradreczko/TypeGPU/wigsill/packages/typegpu/dist/data/index.cjs"}
|
package/data/index.d.cts
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
export {
|
1
|
+
import { aM as Bool, aN as F16, aO as F32, aP as I32, aQ as U16, aR as U32, A as AnyWgslData, aS as WgslStruct, i as WgslArray, k as AnyData, aT as Ptr, aU as Vec2b, aV as Vec2f, aW as Vec2h, aX as Vec2i, aY as Vec2u, aZ as Vec3b, a_ as Vec3f, a$ as Vec3h, b0 as Vec3i, b1 as Vec3u, b2 as Vec4b, b3 as Vec4f, b4 as Vec4h, b5 as Vec4i, b6 as Vec4u, D as Disarray, b7 as BaseData, b8 as Unstruct, b9 as Atomic } from '../tgpuComputeFn-DOUjhQua.cjs';
|
2
|
+
export { bm as Align, bP as AnyAttribute, c0 as AnyBuiltin, bM as AnyLooseData, bn as AnyVecInstance, bo as AnyWgslStruct, bp as Builtin, c1 as BuiltinClipDistances, c2 as BuiltinFragDepth, c3 as BuiltinFrontFacing, c4 as BuiltinGlobalInvocationId, c5 as BuiltinInstanceIndex, c6 as BuiltinLocalInvocationId, c7 as BuiltinLocalInvocationIndex, c8 as BuiltinNumWorkgroups, c9 as BuiltinPosition, ca as BuiltinSampleIndex, cb as BuiltinSampleMask, cc as BuiltinVertexIndex, cd as BuiltinWorkgroupId, bq as Decorated, cg as FormatToWGSLType, bQ as HasCustomLocation, I as Infer, ce as InferGPU, cf as InferPartial, br as Interpolate, bS as IsBuiltin, bs as Location, bN as LooseDecorated, bw as Mat2x2f, bx as Mat3x3f, by as Mat4x4f, cZ as PackedData, bz as Size, ch as TgpuVertexFormatData, bl as Void, bO as align, b$ as builtin, cI as float16, cJ as float16x2, cK as float16x4, cL as float32, cM as float32x2, cN as float32x3, cO as float32x4, ci as formatToWGSLType, bR as interpolate, ba as isAlignAttrib, bb as isAtomic, bT as isBuiltin, bc as isBuiltinAttrib, bW as isData, bd as isDecorated, bX as isDisarray, be as isInterpolateAttrib, bf as isLocationAttrib, bY as isLooseData, bZ as isLooseDecorated, bg as isPtr, bh as isSizeAttrib, b_ as isUnstruct, bi as isWgslArray, bj as isWgslData, bk as isWgslStruct, bU as location, bt as m2x2f, bu as m3x3f, bv as m4x4f, cj as packedFormats, cz as sint16, cA as sint16x2, cB as sint16x4, cT as sint32, cU as sint32x2, cV as sint32x3, cW as sint32x4, cn as sint8, co as sint8x2, cp as sint8x4, bV as size, cF as snorm16, cG as snorm16x2, cH as snorm16x4, ct as snorm8, cu as snorm8x2, cv as snorm8x4, cw as uint16, cx as uint16x2, cy as uint16x4, cP as uint32, cQ as uint32x2, cR as uint32x3, cS as uint32x4, ck as uint8, cl as uint8x2, cm as uint8x4, cX as unorm10_10_10_2, cC as unorm16, cD as unorm16x2, cE as unorm16x4, cq as unorm8, cr as unorm8x2, cs as unorm8x4, cY as unorm8x4_bgra, bA as v2b, bB as v2f, bC as v2i, bD as v2u, bE as v3b, bF as v3f, bG as v3i, bH as v3u, bI as v4b, bJ as v4f, bK as v4i, bL as v4u } from '../tgpuComputeFn-DOUjhQua.cjs';
|
3
|
+
export { m as mat2x2f, a as mat3x3f, b as mat4x4f, c as matToArray } from '../matrix-BN6ObiMv.cjs';
|
3
4
|
import 'tinyest';
|
4
5
|
|
5
6
|
/**
|
6
7
|
* A schema that represents a boolean value. (equivalent to `bool` in WGSL)
|
8
|
+
*
|
9
|
+
* Can also be called to cast a value to a bool in accordance with WGSL casting rules.
|
10
|
+
*
|
11
|
+
* @example
|
12
|
+
* const value = bool(); // false
|
13
|
+
* @example
|
14
|
+
* const value = bool(0); // false
|
15
|
+
* @example
|
16
|
+
* const value = bool(-0); // false
|
17
|
+
* @example
|
18
|
+
* const value = bool(21.37); // true
|
7
19
|
*/
|
8
20
|
declare const bool: Bool;
|
9
21
|
/**
|
@@ -12,6 +24,10 @@ declare const bool: Bool;
|
|
12
24
|
* Can also be called to cast a value to an u32 in accordance with WGSL casting rules.
|
13
25
|
*
|
14
26
|
* @example
|
27
|
+
* const value = u32(); // 0
|
28
|
+
* @example
|
29
|
+
* const value = u32(7); // 7
|
30
|
+
* @example
|
15
31
|
* const value = u32(3.14); // 3
|
16
32
|
* @example
|
17
33
|
* const value = u32(-1); // 4294967295
|
@@ -19,12 +35,15 @@ declare const bool: Bool;
|
|
19
35
|
* const value = u32(-3.1); // 0
|
20
36
|
*/
|
21
37
|
declare const u32: U32;
|
38
|
+
declare const u16: U16;
|
22
39
|
/**
|
23
40
|
* A schema that represents a signed 32-bit integer value. (equivalent to `i32` in WGSL)
|
24
41
|
*
|
25
42
|
* Can also be called to cast a value to an i32 in accordance with WGSL casting rules.
|
26
43
|
*
|
27
44
|
* @example
|
45
|
+
* const value = i32(); // 0
|
46
|
+
* @example
|
28
47
|
* const value = i32(3.14); // 3
|
29
48
|
* @example
|
30
49
|
* const value = i32(-3.9); // -3
|
@@ -38,6 +57,10 @@ declare const i32: I32;
|
|
38
57
|
* Can also be called to cast a value to an f32.
|
39
58
|
*
|
40
59
|
* @example
|
60
|
+
* const value = f32(); // 0
|
61
|
+
* @example
|
62
|
+
* const value = f32(1.23); // 1.23
|
63
|
+
* @example
|
41
64
|
* const value = f32(true); // 1
|
42
65
|
*/
|
43
66
|
declare const f32: F32;
|
@@ -47,6 +70,10 @@ declare const f32: F32;
|
|
47
70
|
* Can also be called to cast a value to an f16.
|
48
71
|
*
|
49
72
|
* @example
|
73
|
+
* const value = f16(); // 0
|
74
|
+
* @example
|
75
|
+
* const value = f32(1.23); // 1.23
|
76
|
+
* @example
|
50
77
|
* const value = f16(true); // 1
|
51
78
|
* @example
|
52
79
|
* const value = f16(21877.5); // 21872
|
@@ -312,80 +339,6 @@ declare function disarrayOf<TElement extends AnyData>(elementType: TElement, cou
|
|
312
339
|
*/
|
313
340
|
declare function unstruct<TProps extends Record<string, BaseData>>(properties: TProps): Unstruct<TProps>;
|
314
341
|
|
315
|
-
/**
|
316
|
-
* Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32.
|
317
|
-
* Also a constructor function for this matrix type.
|
318
|
-
*
|
319
|
-
* @example
|
320
|
-
* const zero2x2 = mat2x2f(); // filled with zeros
|
321
|
-
*
|
322
|
-
* @example
|
323
|
-
* const mat = mat2x2f(0, 1, 2, 3);
|
324
|
-
* mat.columns[0] // vec2f(0, 1)
|
325
|
-
* mat.columns[1] // vec2f(2, 3)
|
326
|
-
*
|
327
|
-
* @example
|
328
|
-
* const mat = mat2x2f(
|
329
|
-
* vec2f(0, 1), // column 0
|
330
|
-
* vec2f(1, 2), // column 1
|
331
|
-
* );
|
332
|
-
*
|
333
|
-
* @example
|
334
|
-
* const buffer = root.createBuffer(d.mat2x2f, d.mat2x2f(0, 1, 2, 3)); // buffer holding a d.mat2x2f value, with an initial value of ((0, 1), (2, 3))
|
335
|
-
*/
|
336
|
-
declare const mat2x2f: Mat2x2f;
|
337
|
-
/**
|
338
|
-
* Schema representing mat3x3f - a matrix with 3 rows and 3 columns, with elements of type f32.
|
339
|
-
* Also a constructor function for this matrix type.
|
340
|
-
*
|
341
|
-
* @example
|
342
|
-
* const zero3x3 = mat3x3f(); // filled with zeros
|
343
|
-
*
|
344
|
-
* @example
|
345
|
-
* const mat = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8);
|
346
|
-
* mat.columns[0] // vec3f(0, 1, 2)
|
347
|
-
* mat.columns[1] // vec3f(3, 4, 5)
|
348
|
-
* mat.columns[2] // vec3f(6, 7, 8)
|
349
|
-
*
|
350
|
-
* @example
|
351
|
-
* const mat = mat3x3f(
|
352
|
-
* vec3f(0, 1, 2), // column 0
|
353
|
-
* vec3f(2, 3, 4), // column 1
|
354
|
-
* vec3f(5, 6, 7), // column 2
|
355
|
-
* );
|
356
|
-
*
|
357
|
-
* @example
|
358
|
-
* const buffer = root.createBuffer(d.mat3x3f, d.mat3x3f()); // buffer holding a d.mat3x3f value, with an initial value of mat3x3f filled with zeros
|
359
|
-
*/
|
360
|
-
declare const mat3x3f: Mat3x3f;
|
361
|
-
/**
|
362
|
-
* Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32.
|
363
|
-
* Also a constructor function for this matrix type.
|
364
|
-
*
|
365
|
-
* @example
|
366
|
-
* const zero4x4 = mat4x4f(); // filled with zeros
|
367
|
-
*
|
368
|
-
* @example
|
369
|
-
* const mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
370
|
-
* mat.columns[0] // vec4f(0, 1, 2, 3)
|
371
|
-
* mat.columns[1] // vec4f(4, 5, 6, 7)
|
372
|
-
* mat.columns[2] // vec4f(8, 9, 10, 11)
|
373
|
-
* mat.columns[3] // vec4f(12, 13, 14, 15)
|
374
|
-
*
|
375
|
-
* @example
|
376
|
-
* const mat = mat4x4f(
|
377
|
-
* vec4f(0, 1, 2, 3), // column 0
|
378
|
-
* vec4f(4, 5, 6, 7), // column 1
|
379
|
-
* vec4f(8, 9, 10, 11), // column 2
|
380
|
-
* vec4f(12, 13, 14, 15), // column 3
|
381
|
-
* );
|
382
|
-
*
|
383
|
-
* @example
|
384
|
-
* const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros
|
385
|
-
*/
|
386
|
-
declare const mat4x4f: Mat4x4f;
|
387
|
-
declare function matToArray(mat: m2x2f | m3x3f | m4x4f): number[];
|
388
|
-
|
389
342
|
/**
|
390
343
|
* Marks a concrete integer scalar type schema (u32 or i32) as a WGSL atomic.
|
391
344
|
*
|
@@ -407,4 +360,4 @@ declare function PUBLIC_sizeOf(schema: AnyData): number;
|
|
407
360
|
*/
|
408
361
|
declare function PUBLIC_alignmentOf(schema: AnyData): number;
|
409
362
|
|
410
|
-
export { AnyData, AnyWgslData, Atomic, BaseData, BaseData as BaseWgslData, Bool, Disarray, F16, F32, I32,
|
363
|
+
export { AnyData, AnyWgslData, Atomic, BaseData, BaseData as BaseWgslData, Bool, Disarray, F16, F32, I32, Ptr, U16, U32, Unstruct, Vec2b, Vec2f, Vec2h, Vec2i, Vec2u, Vec3b, Vec3f, Vec3h, Vec3i, Vec3u, Vec4b, Vec4f, Vec4h, Vec4i, Vec4u, WgslArray, WgslStruct, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, disarrayOf, f16, f32, i32, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, PUBLIC_sizeOf as sizeOf, struct, u16, u32, unstruct, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u };
|
package/data/index.d.ts
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
export {
|
1
|
+
import { aM as Bool, aN as F16, aO as F32, aP as I32, aQ as U16, aR as U32, A as AnyWgslData, aS as WgslStruct, i as WgslArray, k as AnyData, aT as Ptr, aU as Vec2b, aV as Vec2f, aW as Vec2h, aX as Vec2i, aY as Vec2u, aZ as Vec3b, a_ as Vec3f, a$ as Vec3h, b0 as Vec3i, b1 as Vec3u, b2 as Vec4b, b3 as Vec4f, b4 as Vec4h, b5 as Vec4i, b6 as Vec4u, D as Disarray, b7 as BaseData, b8 as Unstruct, b9 as Atomic } from '../tgpuComputeFn-DOUjhQua.js';
|
2
|
+
export { bm as Align, bP as AnyAttribute, c0 as AnyBuiltin, bM as AnyLooseData, bn as AnyVecInstance, bo as AnyWgslStruct, bp as Builtin, c1 as BuiltinClipDistances, c2 as BuiltinFragDepth, c3 as BuiltinFrontFacing, c4 as BuiltinGlobalInvocationId, c5 as BuiltinInstanceIndex, c6 as BuiltinLocalInvocationId, c7 as BuiltinLocalInvocationIndex, c8 as BuiltinNumWorkgroups, c9 as BuiltinPosition, ca as BuiltinSampleIndex, cb as BuiltinSampleMask, cc as BuiltinVertexIndex, cd as BuiltinWorkgroupId, bq as Decorated, cg as FormatToWGSLType, bQ as HasCustomLocation, I as Infer, ce as InferGPU, cf as InferPartial, br as Interpolate, bS as IsBuiltin, bs as Location, bN as LooseDecorated, bw as Mat2x2f, bx as Mat3x3f, by as Mat4x4f, cZ as PackedData, bz as Size, ch as TgpuVertexFormatData, bl as Void, bO as align, b$ as builtin, cI as float16, cJ as float16x2, cK as float16x4, cL as float32, cM as float32x2, cN as float32x3, cO as float32x4, ci as formatToWGSLType, bR as interpolate, ba as isAlignAttrib, bb as isAtomic, bT as isBuiltin, bc as isBuiltinAttrib, bW as isData, bd as isDecorated, bX as isDisarray, be as isInterpolateAttrib, bf as isLocationAttrib, bY as isLooseData, bZ as isLooseDecorated, bg as isPtr, bh as isSizeAttrib, b_ as isUnstruct, bi as isWgslArray, bj as isWgslData, bk as isWgslStruct, bU as location, bt as m2x2f, bu as m3x3f, bv as m4x4f, cj as packedFormats, cz as sint16, cA as sint16x2, cB as sint16x4, cT as sint32, cU as sint32x2, cV as sint32x3, cW as sint32x4, cn as sint8, co as sint8x2, cp as sint8x4, bV as size, cF as snorm16, cG as snorm16x2, cH as snorm16x4, ct as snorm8, cu as snorm8x2, cv as snorm8x4, cw as uint16, cx as uint16x2, cy as uint16x4, cP as uint32, cQ as uint32x2, cR as uint32x3, cS as uint32x4, ck as uint8, cl as uint8x2, cm as uint8x4, cX as unorm10_10_10_2, cC as unorm16, cD as unorm16x2, cE as unorm16x4, cq as unorm8, cr as unorm8x2, cs as unorm8x4, cY as unorm8x4_bgra, bA as v2b, bB as v2f, bC as v2i, bD as v2u, bE as v3b, bF as v3f, bG as v3i, bH as v3u, bI as v4b, bJ as v4f, bK as v4i, bL as v4u } from '../tgpuComputeFn-DOUjhQua.js';
|
3
|
+
export { m as mat2x2f, a as mat3x3f, b as mat4x4f, c as matToArray } from '../matrix-S8W4dk8I.js';
|
3
4
|
import 'tinyest';
|
4
5
|
|
5
6
|
/**
|
6
7
|
* A schema that represents a boolean value. (equivalent to `bool` in WGSL)
|
8
|
+
*
|
9
|
+
* Can also be called to cast a value to a bool in accordance with WGSL casting rules.
|
10
|
+
*
|
11
|
+
* @example
|
12
|
+
* const value = bool(); // false
|
13
|
+
* @example
|
14
|
+
* const value = bool(0); // false
|
15
|
+
* @example
|
16
|
+
* const value = bool(-0); // false
|
17
|
+
* @example
|
18
|
+
* const value = bool(21.37); // true
|
7
19
|
*/
|
8
20
|
declare const bool: Bool;
|
9
21
|
/**
|
@@ -12,6 +24,10 @@ declare const bool: Bool;
|
|
12
24
|
* Can also be called to cast a value to an u32 in accordance with WGSL casting rules.
|
13
25
|
*
|
14
26
|
* @example
|
27
|
+
* const value = u32(); // 0
|
28
|
+
* @example
|
29
|
+
* const value = u32(7); // 7
|
30
|
+
* @example
|
15
31
|
* const value = u32(3.14); // 3
|
16
32
|
* @example
|
17
33
|
* const value = u32(-1); // 4294967295
|
@@ -19,12 +35,15 @@ declare const bool: Bool;
|
|
19
35
|
* const value = u32(-3.1); // 0
|
20
36
|
*/
|
21
37
|
declare const u32: U32;
|
38
|
+
declare const u16: U16;
|
22
39
|
/**
|
23
40
|
* A schema that represents a signed 32-bit integer value. (equivalent to `i32` in WGSL)
|
24
41
|
*
|
25
42
|
* Can also be called to cast a value to an i32 in accordance with WGSL casting rules.
|
26
43
|
*
|
27
44
|
* @example
|
45
|
+
* const value = i32(); // 0
|
46
|
+
* @example
|
28
47
|
* const value = i32(3.14); // 3
|
29
48
|
* @example
|
30
49
|
* const value = i32(-3.9); // -3
|
@@ -38,6 +57,10 @@ declare const i32: I32;
|
|
38
57
|
* Can also be called to cast a value to an f32.
|
39
58
|
*
|
40
59
|
* @example
|
60
|
+
* const value = f32(); // 0
|
61
|
+
* @example
|
62
|
+
* const value = f32(1.23); // 1.23
|
63
|
+
* @example
|
41
64
|
* const value = f32(true); // 1
|
42
65
|
*/
|
43
66
|
declare const f32: F32;
|
@@ -47,6 +70,10 @@ declare const f32: F32;
|
|
47
70
|
* Can also be called to cast a value to an f16.
|
48
71
|
*
|
49
72
|
* @example
|
73
|
+
* const value = f16(); // 0
|
74
|
+
* @example
|
75
|
+
* const value = f32(1.23); // 1.23
|
76
|
+
* @example
|
50
77
|
* const value = f16(true); // 1
|
51
78
|
* @example
|
52
79
|
* const value = f16(21877.5); // 21872
|
@@ -312,80 +339,6 @@ declare function disarrayOf<TElement extends AnyData>(elementType: TElement, cou
|
|
312
339
|
*/
|
313
340
|
declare function unstruct<TProps extends Record<string, BaseData>>(properties: TProps): Unstruct<TProps>;
|
314
341
|
|
315
|
-
/**
|
316
|
-
* Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32.
|
317
|
-
* Also a constructor function for this matrix type.
|
318
|
-
*
|
319
|
-
* @example
|
320
|
-
* const zero2x2 = mat2x2f(); // filled with zeros
|
321
|
-
*
|
322
|
-
* @example
|
323
|
-
* const mat = mat2x2f(0, 1, 2, 3);
|
324
|
-
* mat.columns[0] // vec2f(0, 1)
|
325
|
-
* mat.columns[1] // vec2f(2, 3)
|
326
|
-
*
|
327
|
-
* @example
|
328
|
-
* const mat = mat2x2f(
|
329
|
-
* vec2f(0, 1), // column 0
|
330
|
-
* vec2f(1, 2), // column 1
|
331
|
-
* );
|
332
|
-
*
|
333
|
-
* @example
|
334
|
-
* const buffer = root.createBuffer(d.mat2x2f, d.mat2x2f(0, 1, 2, 3)); // buffer holding a d.mat2x2f value, with an initial value of ((0, 1), (2, 3))
|
335
|
-
*/
|
336
|
-
declare const mat2x2f: Mat2x2f;
|
337
|
-
/**
|
338
|
-
* Schema representing mat3x3f - a matrix with 3 rows and 3 columns, with elements of type f32.
|
339
|
-
* Also a constructor function for this matrix type.
|
340
|
-
*
|
341
|
-
* @example
|
342
|
-
* const zero3x3 = mat3x3f(); // filled with zeros
|
343
|
-
*
|
344
|
-
* @example
|
345
|
-
* const mat = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8);
|
346
|
-
* mat.columns[0] // vec3f(0, 1, 2)
|
347
|
-
* mat.columns[1] // vec3f(3, 4, 5)
|
348
|
-
* mat.columns[2] // vec3f(6, 7, 8)
|
349
|
-
*
|
350
|
-
* @example
|
351
|
-
* const mat = mat3x3f(
|
352
|
-
* vec3f(0, 1, 2), // column 0
|
353
|
-
* vec3f(2, 3, 4), // column 1
|
354
|
-
* vec3f(5, 6, 7), // column 2
|
355
|
-
* );
|
356
|
-
*
|
357
|
-
* @example
|
358
|
-
* const buffer = root.createBuffer(d.mat3x3f, d.mat3x3f()); // buffer holding a d.mat3x3f value, with an initial value of mat3x3f filled with zeros
|
359
|
-
*/
|
360
|
-
declare const mat3x3f: Mat3x3f;
|
361
|
-
/**
|
362
|
-
* Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32.
|
363
|
-
* Also a constructor function for this matrix type.
|
364
|
-
*
|
365
|
-
* @example
|
366
|
-
* const zero4x4 = mat4x4f(); // filled with zeros
|
367
|
-
*
|
368
|
-
* @example
|
369
|
-
* const mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
370
|
-
* mat.columns[0] // vec4f(0, 1, 2, 3)
|
371
|
-
* mat.columns[1] // vec4f(4, 5, 6, 7)
|
372
|
-
* mat.columns[2] // vec4f(8, 9, 10, 11)
|
373
|
-
* mat.columns[3] // vec4f(12, 13, 14, 15)
|
374
|
-
*
|
375
|
-
* @example
|
376
|
-
* const mat = mat4x4f(
|
377
|
-
* vec4f(0, 1, 2, 3), // column 0
|
378
|
-
* vec4f(4, 5, 6, 7), // column 1
|
379
|
-
* vec4f(8, 9, 10, 11), // column 2
|
380
|
-
* vec4f(12, 13, 14, 15), // column 3
|
381
|
-
* );
|
382
|
-
*
|
383
|
-
* @example
|
384
|
-
* const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros
|
385
|
-
*/
|
386
|
-
declare const mat4x4f: Mat4x4f;
|
387
|
-
declare function matToArray(mat: m2x2f | m3x3f | m4x4f): number[];
|
388
|
-
|
389
342
|
/**
|
390
343
|
* Marks a concrete integer scalar type schema (u32 or i32) as a WGSL atomic.
|
391
344
|
*
|
@@ -407,4 +360,4 @@ declare function PUBLIC_sizeOf(schema: AnyData): number;
|
|
407
360
|
*/
|
408
361
|
declare function PUBLIC_alignmentOf(schema: AnyData): number;
|
409
362
|
|
410
|
-
export { AnyData, AnyWgslData, Atomic, BaseData, BaseData as BaseWgslData, Bool, Disarray, F16, F32, I32,
|
363
|
+
export { AnyData, AnyWgslData, Atomic, BaseData, BaseData as BaseWgslData, Bool, Disarray, F16, F32, I32, Ptr, U16, U32, Unstruct, Vec2b, Vec2f, Vec2h, Vec2i, Vec2u, Vec3b, Vec3f, Vec3h, Vec3i, Vec3u, Vec4b, Vec4f, Vec4h, Vec4i, Vec4u, WgslArray, WgslStruct, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, disarrayOf, f16, f32, i32, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, PUBLIC_sizeOf as sizeOf, struct, u16, u32, unstruct, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u };
|
package/data/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{$ as
|
1
|
+
import{$ as La,A as ja,B as ka,C as la,D as ma,E as na,F as oa,G as pa,H as qa,I as ra,J as sa,K as ta,L as ua,M as va,N as wa,O as xa,P as ya,Q as za,R as Aa,U as Ba,W as Ca,X as Da,Y as Ia,Z as Ja,_ as Ka,aa as Ma,b as M,c as N,d as O,da as Na,e as P,ea as Ua,f as Q,fa as Va,g as R,ga as Wa,h as S,ha as Xa,i as T,j as U,k as V,l as W,m as X,n as Y,o as Z,p as _,q as $,r as aa,s as ba,t as ca,u as da,v as ea,w as fa,x as ga,y as ha,z as ia}from"../chunk-S62QJDM6.js";import{$ as p,Aa as G,Ba as H,C as a,Ca as I,Da as J,Ea as K,Fa as L,M as b,N as c,O as d,P as e,Pa as Ea,Q as f,Qa as Fa,R as g,Ra as Ga,S as h,Sa as Ha,T as i,Ta as Oa,U as j,Ua as Pa,V as k,Va as Qa,W as l,Wa as Ra,Xa as Sa,Y as m,Ya as Ta,Z as n,_ as o,da as q,la as r,ma as s,na as t,oa as u,pa as v,qa as w,ra as x,sa as y,ta as z,ua as A,va as B,wa as C,xa as D,ya as E,za as F}from"../chunk-APTRHY5Y.js";export{a as Void,Ia as align,Ba as alignmentOf,Da as arrayOf,Wa as atomic,r as bool,Xa as builtin,Ua as disarrayOf,w as f16,v as f32,ka as float16,la as float16x2,ma as float16x4,na as float32,oa as float32x2,pa as float32x3,qa as float32x4,M as formatToWGSLType,u as i32,La as interpolate,g as isAlignAttrib,f as isAtomic,Ma as isBuiltin,k as isBuiltinAttrib,q as isData,l as isDecorated,n as isDisarray,j as isInterpolateAttrib,i as isLocationAttrib,m as isLooseData,p as isLooseDecorated,e as isPtr,h as isSizeAttrib,o as isUnstruct,c as isWgslArray,b as isWgslData,d as isWgslStruct,Ka as location,Ea as mat2x2f,Fa as mat3x3f,Ga as mat4x4f,Ha as matToArray,N as packedFormats,Oa as ptrFn,Ta as ptrHandle,Pa as ptrPrivate,Ra as ptrStorage,Sa as ptrUniform,Qa as ptrWorkgroup,ba as sint16,ca as sint16x2,da as sint16x4,va as sint32,wa as sint32x2,xa as sint32x3,ya as sint32x4,R as sint8,S as sint8x2,T as sint8x4,Ja as size,Ca as sizeOf,ha as snorm16,ia as snorm16x2,ja as snorm16x4,X as snorm8,Y as snorm8x2,Z as snorm8x4,Na as struct,t as u16,s as u32,_ as uint16,$ as uint16x2,aa as uint16x4,ra as uint32,sa as uint32x2,ta as uint32x3,ua as uint32x4,O as uint8,P as uint8x2,Q as uint8x4,za as unorm10_10_10_2,ea as unorm16,fa as unorm16x2,ga as unorm16x4,U as unorm8,V as unorm8x2,W as unorm8x4,Aa as unorm8x4_bgra,Va as unstruct,B as vec2b,x as vec2f,y as vec2h,z as vec2i,A as vec2u,G as vec3b,C as vec3f,D as vec3h,E as vec3i,F as vec3u,L as vec4b,H as vec4f,I as vec4h,J as vec4i,K as vec4u};
|
2
2
|
//# sourceMappingURL=index.js.map
|