typegpu 0.9.0 → 0.10.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.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/builtin-ClEnM-Ye.js +818 -0
  3. package/builtin-ClEnM-Ye.js.map +1 -0
  4. package/chunk-BYypO7fO.js +18 -0
  5. package/common/index.d.ts +8 -23
  6. package/common/index.d.ts.map +1 -0
  7. package/common/index.js +7 -5
  8. package/common/index.js.map +1 -1
  9. package/data/index.d.ts +7 -401
  10. package/data/index.d.ts.map +1 -0
  11. package/data/index.js +164 -1
  12. package/data/index.js.map +1 -1
  13. package/deepEqual-yZXvaV2C.js +413 -0
  14. package/deepEqual-yZXvaV2C.js.map +1 -0
  15. package/extensions-0SFbU9FH.js +2032 -0
  16. package/extensions-0SFbU9FH.js.map +1 -0
  17. package/fullScreenTriangle-MdLGaAMR.js +543 -0
  18. package/fullScreenTriangle-MdLGaAMR.js.map +1 -0
  19. package/index.d.ts +124 -310
  20. package/index.d.ts.map +1 -0
  21. package/index.js +6282 -153
  22. package/index.js.map +1 -1
  23. package/indexNamedExports-Cdy7USiY.d.ts +5696 -0
  24. package/indexNamedExports-Cdy7USiY.d.ts.map +1 -0
  25. package/operators-HTxa_0k9.js +4156 -0
  26. package/operators-HTxa_0k9.js.map +1 -0
  27. package/package.json +3 -2
  28. package/std/index.d.ts +7 -621
  29. package/std/index.d.ts.map +1 -0
  30. package/std/index.js +165 -1
  31. package/std/index.js.map +1 -1
  32. package/texture-Dg5ybJro.js +205 -0
  33. package/texture-Dg5ybJro.js.map +1 -0
  34. package/chunk-5ABKYSJD.js +0 -2
  35. package/chunk-5ABKYSJD.js.map +0 -1
  36. package/chunk-D5UYO3OX.js +0 -3
  37. package/chunk-D5UYO3OX.js.map +0 -1
  38. package/chunk-EHLRP4V2.js +0 -2
  39. package/chunk-EHLRP4V2.js.map +0 -1
  40. package/chunk-LMPPDGRD.js +0 -2
  41. package/chunk-LMPPDGRD.js.map +0 -1
  42. package/chunk-MBB2XFH6.js +0 -2
  43. package/chunk-MBB2XFH6.js.map +0 -1
  44. package/chunk-SHSILTWI.js +0 -10
  45. package/chunk-SHSILTWI.js.map +0 -1
  46. package/comptime-DKpw1IVu.d.ts +0 -28
  47. package/matrix-C4IFKU1R.d.ts +0 -123
  48. package/tgpuConstant-BOn7U_lv.d.ts +0 -4031
@@ -1,28 +0,0 @@
1
- import { dO as DualFn, e8 as TgpuNamable, e9 as $getNameForward } from './tgpuConstant-BOn7U_lv.js';
2
-
3
- type TgpuComptime<T extends (...args: never[]) => unknown> = DualFn<T> & TgpuNamable & {
4
- [$getNameForward]: unknown;
5
- };
6
- /**
7
- * Creates a version of `func` that can called safely in a TypeGPU function to
8
- * precompute and inject a value into the final shader code.
9
- *
10
- * Note how the function passed into `comptime` doesn't have to be marked with
11
- * 'use gpu'. That's because the function doesn't execute on the GPU, it gets
12
- * executed before the shader code gets sent to the GPU.
13
- *
14
- * @example
15
- * ```ts
16
- * const injectRand01 = tgpu['~unstable']
17
- * .comptime(() => Math.random());
18
- *
19
- * const getColor = (diffuse: d.v3f) => {
20
- * 'use gpu';
21
- * const albedo = hsvToRgb(injectRand01(), 1, 0.5);
22
- * return albedo.mul(diffuse);
23
- * };
24
- * ```
25
- */
26
- declare function comptime<T extends (...args: never[]) => unknown>(func: T): TgpuComptime<T>;
27
-
28
- export { type TgpuComptime as T, comptime as c };
@@ -1,123 +0,0 @@
1
- import { bE as Mat2x2f, bF as Mat3x3f, bG as Mat4x4f, bB as m2x2f, bC as m3x3f, bD as m4x4f, dO as DualFn, bN as v3f } from './tgpuConstant-BOn7U_lv.js';
2
- import { T as TgpuComptime } from './comptime-DKpw1IVu.js';
3
-
4
- /**
5
- * Returns a 2-by-2 identity matrix.
6
- * @returns {m2x2f} The result matrix.
7
- */
8
- declare const identity2: TgpuComptime<() => m2x2f>;
9
- /**
10
- * Returns a 3-by-3 identity matrix.
11
- * @returns {m3x3f} The result matrix.
12
- */
13
- declare const identity3: TgpuComptime<() => m3x3f>;
14
- /**
15
- * Returns a 4-by-4 identity matrix.
16
- * @returns {m4x4f} The result matrix.
17
- */
18
- declare const identity4: TgpuComptime<() => m4x4f>;
19
- /**
20
- * Creates a 4-by-4 matrix which translates by the given vector v.
21
- * @param {v3f} vector - The vector by which to translate.
22
- * @returns {m4x4f} The translation matrix.
23
- */
24
- declare const translation4: DualFn<(vector: v3f) => m4x4f>;
25
- /**
26
- * Creates a 4-by-4 matrix which scales in each dimension by an amount given by the corresponding entry in the given vector.
27
- * @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.
28
- * @returns {m4x4f} The scaling matrix.
29
- */
30
- declare const scaling4: DualFn<(vector: v3f) => m4x4f>;
31
- /**
32
- * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.
33
- * @param {number} angle - The angle by which to rotate (in radians).
34
- * @returns {m4x4f} The rotation matrix.
35
- */
36
- declare const rotationX4: DualFn<(a: number) => m4x4f>;
37
- /**
38
- * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.
39
- * @param {number} angle - The angle by which to rotate (in radians).
40
- * @returns {m4x4f} The rotation matrix.
41
- */
42
- declare const rotationY4: DualFn<(a: number) => m4x4f>;
43
- /**
44
- * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.
45
- * @param {number} angle - The angle by which to rotate (in radians).
46
- * @returns {m4x4f} The rotation matrix.
47
- */
48
- declare const rotationZ4: DualFn<(a: number) => m4x4f>;
49
- /**
50
- * Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32.
51
- * Also a constructor function for this matrix type.
52
- *
53
- * @example
54
- * const zero2x2 = mat2x2f(); // filled with zeros
55
- *
56
- * @example
57
- * const mat = mat2x2f(0, 1, 2, 3);
58
- * mat.columns[0] // vec2f(0, 1)
59
- * mat.columns[1] // vec2f(2, 3)
60
- *
61
- * @example
62
- * const mat = mat2x2f(
63
- * vec2f(0, 1), // column 0
64
- * vec2f(1, 2), // column 1
65
- * );
66
- *
67
- * @example
68
- * 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))
69
- */
70
- declare const mat2x2f: Mat2x2f;
71
- /**
72
- * Schema representing mat3x3f - a matrix with 3 rows and 3 columns, with elements of type f32.
73
- * Also a constructor function for this matrix type.
74
- *
75
- * @example
76
- * const zero3x3 = mat3x3f(); // filled with zeros
77
- *
78
- * @example
79
- * const mat = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8);
80
- * mat.columns[0] // vec3f(0, 1, 2)
81
- * mat.columns[1] // vec3f(3, 4, 5)
82
- * mat.columns[2] // vec3f(6, 7, 8)
83
- *
84
- * @example
85
- * const mat = mat3x3f(
86
- * vec3f(0, 1, 2), // column 0
87
- * vec3f(2, 3, 4), // column 1
88
- * vec3f(5, 6, 7), // column 2
89
- * );
90
- *
91
- * @example
92
- * const buffer = root.createBuffer(d.mat3x3f, d.mat3x3f()); // buffer holding a d.mat3x3f value, with an initial value of mat3x3f filled with zeros
93
- */
94
- declare const mat3x3f: Mat3x3f;
95
- /**
96
- * Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32.
97
- * Also a constructor function for this matrix type.
98
- *
99
- * @example
100
- * const zero4x4 = mat4x4f(); // filled with zeros
101
- *
102
- * @example
103
- * const mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
104
- * mat.columns[0] // vec4f(0, 1, 2, 3)
105
- * mat.columns[1] // vec4f(4, 5, 6, 7)
106
- * mat.columns[2] // vec4f(8, 9, 10, 11)
107
- * mat.columns[3] // vec4f(12, 13, 14, 15)
108
- *
109
- * @example
110
- * const mat = mat4x4f(
111
- * vec4f(0, 1, 2, 3), // column 0
112
- * vec4f(4, 5, 6, 7), // column 1
113
- * vec4f(8, 9, 10, 11), // column 2
114
- * vec4f(12, 13, 14, 15), // column 3
115
- * );
116
- *
117
- * @example
118
- * const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros
119
- */
120
- declare const mat4x4f: Mat4x4f;
121
- declare function matToArray(mat: m2x2f | m3x3f | m4x4f): number[];
122
-
123
- export { mat3x3f as a, mat4x4f as b, matToArray as c, identity3 as d, identity4 as e, rotationY4 as f, rotationZ4 as g, identity2 as i, mat2x2f as m, rotationX4 as r, scaling4 as s, translation4 as t };