typegpu 0.10.0 → 0.10.2
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-BYypO7fO.js → _virtual/_rolldown/runtime.js} +1 -1
- package/builtin.d.ts +50 -0
- package/builtin.js +37 -0
- package/common/fullScreenTriangle.d.ts +26 -0
- package/common/fullScreenTriangle.js +36 -0
- package/common/index.d.ts +2 -3
- package/common/index.js +3 -4
- package/core/buffer/buffer.d.ts +74 -0
- package/core/buffer/buffer.js +197 -0
- package/core/buffer/bufferShorthand.d.ts +48 -0
- package/core/buffer/bufferShorthand.js +49 -0
- package/core/buffer/bufferUsage.d.ts +45 -0
- package/core/buffer/bufferUsage.js +163 -0
- package/core/constant/tgpuConstant.d.ts +28 -0
- package/core/constant/tgpuConstant.js +67 -0
- package/core/declare/tgpuDeclare.d.ts +18 -0
- package/core/declare/tgpuDeclare.js +40 -0
- package/core/function/autoIO.d.ts +37 -0
- package/core/function/autoIO.js +87 -0
- package/core/function/comptime.d.ts +39 -0
- package/core/function/comptime.js +51 -0
- package/core/function/createCallableSchema.js +42 -0
- package/core/function/dualImpl.js +54 -0
- package/core/function/extractArgs.js +204 -0
- package/core/function/fnCore.js +79 -0
- package/core/function/fnTypes.d.ts +34 -0
- package/core/function/ioSchema.d.ts +10 -0
- package/core/function/ioSchema.js +30 -0
- package/core/function/shelllessImpl.d.ts +28 -0
- package/core/function/shelllessImpl.js +23 -0
- package/core/function/templateUtils.js +13 -0
- package/core/function/tgpuComputeFn.d.ts +49 -0
- package/core/function/tgpuComputeFn.js +62 -0
- package/core/function/tgpuFn.d.ts +52 -0
- package/core/function/tgpuFn.js +170 -0
- package/core/function/tgpuFragmentFn.d.ts +68 -0
- package/core/function/tgpuFragmentFn.js +68 -0
- package/core/function/tgpuVertexFn.d.ts +55 -0
- package/core/function/tgpuVertexFn.js +65 -0
- package/core/pipeline/applyPipelineState.js +37 -0
- package/core/pipeline/computePipeline.d.ts +58 -0
- package/core/pipeline/computePipeline.js +226 -0
- package/core/pipeline/connectAttachmentToShader.js +26 -0
- package/core/pipeline/connectTargetsToShader.js +29 -0
- package/core/pipeline/limitsOverflow.js +13 -0
- package/core/pipeline/renderPipeline.d.ts +266 -0
- package/core/pipeline/renderPipeline.js +471 -0
- package/core/pipeline/timeable.d.ts +23 -0
- package/core/pipeline/timeable.js +61 -0
- package/core/pipeline/typeGuards.js +29 -0
- package/core/querySet/querySet.d.ts +22 -0
- package/core/querySet/querySet.js +103 -0
- package/core/rawCodeSnippet/tgpuRawCodeSnippet.d.ts +59 -0
- package/core/rawCodeSnippet/tgpuRawCodeSnippet.js +96 -0
- package/core/resolve/externals.d.ts +10 -0
- package/core/resolve/externals.js +58 -0
- package/core/resolve/namespace.d.ts +38 -0
- package/core/resolve/namespace.js +41 -0
- package/core/resolve/resolveData.js +146 -0
- package/core/resolve/stitch.js +25 -0
- package/core/resolve/tgpuResolve.d.ts +151 -0
- package/core/resolve/tgpuResolve.js +68 -0
- package/core/root/configurableImpl.js +18 -0
- package/core/root/init.d.ts +69 -0
- package/core/root/init.js +457 -0
- package/core/root/rootTypes.d.ts +622 -0
- package/core/sampler/sampler.d.ts +35 -0
- package/core/sampler/sampler.js +116 -0
- package/core/simulate/tgpuSimulate.d.ts +36 -0
- package/core/simulate/tgpuSimulate.js +76 -0
- package/core/slot/accessor.d.ts +13 -0
- package/core/slot/accessor.js +97 -0
- package/core/slot/internalSlots.js +7 -0
- package/core/slot/lazy.d.ts +6 -0
- package/core/slot/lazy.js +42 -0
- package/core/slot/slot.d.ts +6 -0
- package/core/slot/slot.js +40 -0
- package/core/slot/slotTypes.d.ts +92 -0
- package/core/slot/slotTypes.js +21 -0
- package/core/texture/externalTexture.d.ts +12 -0
- package/core/texture/externalTexture.js +48 -0
- package/core/texture/texture.d.ts +118 -0
- package/core/texture/texture.js +312 -0
- package/core/texture/textureFormats.d.ts +29 -0
- package/core/texture/textureFormats.js +99 -0
- package/core/texture/textureProps.d.ts +11 -0
- package/core/texture/textureUtils.js +224 -0
- package/core/texture/usageExtension.d.ts +21 -0
- package/core/texture/usageExtension.js +21 -0
- package/core/unroll/tgpuUnroll.d.ts +13 -0
- package/core/unroll/tgpuUnroll.js +36 -0
- package/core/valueProxyUtils.js +44 -0
- package/core/variable/tgpuVariable.d.ts +38 -0
- package/core/variable/tgpuVariable.js +101 -0
- package/core/vertexLayout/connectAttributesToShader.js +59 -0
- package/core/vertexLayout/vertexAttribute.d.ts +29 -0
- package/core/vertexLayout/vertexLayout.d.ts +19 -0
- package/core/vertexLayout/vertexLayout.js +103 -0
- package/data/alignIO.js +15 -0
- package/data/alignmentOf.d.ts +10 -0
- package/data/alignmentOf.js +88 -0
- package/data/array.d.ts +28 -0
- package/data/array.js +48 -0
- package/data/atomic.d.ts +15 -0
- package/data/atomic.js +25 -0
- package/data/attributes.d.ts +121 -0
- package/data/attributes.js +145 -0
- package/data/autoStruct.d.ts +3 -0
- package/data/autoStruct.js +83 -0
- package/data/compiledIO.js +231 -0
- package/data/dataIO.js +549 -0
- package/data/dataTypes.d.ts +115 -0
- package/data/dataTypes.js +97 -0
- package/data/deepEqual.d.ts +25 -0
- package/data/deepEqual.js +58 -0
- package/data/disarray.d.ts +34 -0
- package/data/disarray.js +52 -0
- package/data/getLongestContiguousPrefix.d.ts +10 -0
- package/data/getLongestContiguousPrefix.js +15 -0
- package/data/index.d.ts +26 -4
- package/data/index.js +27 -7
- package/data/instanceToSchema.d.ts +33 -0
- package/data/isContiguous.d.ts +10 -0
- package/data/isContiguous.js +15 -0
- package/data/matrix.d.ts +126 -0
- package/data/matrix.js +517 -0
- package/data/numberOps.js +24 -0
- package/data/numeric.d.ts +81 -0
- package/data/numeric.js +234 -0
- package/data/offsetUtils.d.ts +33 -0
- package/data/offsetUtils.js +167 -0
- package/data/offsets.js +36 -0
- package/data/partialIO.js +68 -0
- package/data/ptr.d.ts +12 -0
- package/data/ptr.js +46 -0
- package/data/ref.d.ts +37 -0
- package/data/ref.js +96 -0
- package/data/sampler.d.ts +107 -0
- package/data/sampler.js +26 -0
- package/data/schemaCallWrapper.js +32 -0
- package/data/schemaMemoryLayout.js +200 -0
- package/data/sizeOf.d.ts +10 -0
- package/data/sizeOf.js +15 -0
- package/data/snippet.d.ts +26 -0
- package/data/snippet.js +61 -0
- package/data/struct.d.ts +17 -0
- package/data/struct.js +46 -0
- package/data/texture.d.ts +292 -0
- package/{texture-Dg5ybJro.js → data/texture.js} +6 -3
- package/data/unstruct.d.ts +24 -0
- package/data/unstruct.js +43 -0
- package/data/vector.d.ts +191 -0
- package/data/vector.js +247 -0
- package/data/vectorImpl.js +516 -0
- package/data/vectorOps.js +664 -0
- package/data/vertexFormatData.d.ts +190 -0
- package/data/vertexFormatData.js +110 -0
- package/data/wgslTypes.d.ts +896 -0
- package/data/wgslTypes.js +215 -0
- package/errors.d.ts +44 -0
- package/errors.js +128 -0
- package/execMode.js +51 -0
- package/extension.d.ts +11 -0
- package/extension.js +18 -0
- package/getGPUValue.js +9 -0
- package/index.d.ts +40 -243
- package/index.js +19 -6318
- package/indexNamedExports.d.ts +38 -0
- package/mathUtils.js +13 -0
- package/memo.js +22 -0
- package/nameRegistry.d.ts +30 -0
- package/nameRegistry.js +449 -0
- package/package.js +5 -0
- package/package.json +23 -23
- package/resolutionCtx.d.ts +29 -0
- package/resolutionCtx.js +546 -0
- package/shared/env.js +13 -0
- package/shared/generators.js +14 -0
- package/shared/meta.d.ts +39 -0
- package/shared/meta.js +63 -0
- package/shared/repr.d.ts +108 -0
- package/shared/stringify.js +22 -0
- package/shared/symbols.d.ts +61 -0
- package/shared/symbols.js +71 -0
- package/shared/utilityTypes.d.ts +29 -0
- package/shared/utilityTypes.js +7 -0
- package/shared/vertexFormat.d.ts +70 -0
- package/shared/vertexFormat.js +64 -0
- package/std/array.d.ts +7 -0
- package/std/array.js +27 -0
- package/std/atomic.d.ts +19 -0
- package/std/atomic.js +113 -0
- package/std/bitcast.d.ts +10 -0
- package/std/bitcast.js +43 -0
- package/std/boolean.d.ts +127 -0
- package/std/boolean.js +274 -0
- package/std/derivative.d.ts +16 -0
- package/std/derivative.js +89 -0
- package/std/discard.d.ts +6 -0
- package/std/discard.js +16 -0
- package/std/extensions.d.ts +8 -0
- package/std/extensions.js +14 -0
- package/std/index.d.ts +15 -3
- package/std/index.js +16 -5
- package/std/matrix.d.ts +41 -0
- package/std/matrix.js +87 -0
- package/std/numeric.d.ts +254 -0
- package/std/numeric.js +847 -0
- package/std/operators.d.ts +48 -0
- package/std/operators.js +153 -0
- package/std/packing.d.ts +26 -0
- package/std/packing.js +86 -0
- package/std/subgroup.d.ts +47 -0
- package/std/subgroup.js +220 -0
- package/std/texture.d.ts +108 -0
- package/std/texture.js +197 -0
- package/tgpu.js +44 -0
- package/tgpuBindGroupLayout.d.ts +161 -0
- package/tgpuBindGroupLayout.js +271 -0
- package/tgpuUnstable.d.ts +48 -0
- package/tgpuUnstable.js +66 -0
- package/tgsl/accessIndex.js +45 -0
- package/tgsl/accessProp.js +113 -0
- package/tgsl/consoleLog/deserializers.js +117 -0
- package/tgsl/consoleLog/logGenerator.js +86 -0
- package/tgsl/consoleLog/serializers.js +225 -0
- package/tgsl/consoleLog/types.d.ts +54 -0
- package/tgsl/consoleLog/types.js +12 -0
- package/tgsl/conversion.js +200 -0
- package/tgsl/forOfUtils.js +45 -0
- package/tgsl/generationHelpers.d.ts +37 -0
- package/tgsl/generationHelpers.js +67 -0
- package/tgsl/math.js +45 -0
- package/tgsl/shaderGenerator.d.ts +18 -0
- package/tgsl/shellless.d.ts +11 -0
- package/tgsl/shellless.js +53 -0
- package/tgsl/wgslGenerator.js +585 -0
- package/types.d.ts +255 -0
- package/types.js +43 -0
- package/unwrapper.d.ts +27 -0
- package/wgslExtensions.d.ts +5 -0
- package/wgslExtensions.js +18 -0
- package/builtin-ClEnM-Ye.js +0 -818
- package/builtin-ClEnM-Ye.js.map +0 -1
- package/common/index.d.ts.map +0 -1
- package/common/index.js.map +0 -1
- package/data/index.d.ts.map +0 -1
- package/data/index.js.map +0 -1
- package/deepEqual-yZXvaV2C.js +0 -413
- package/deepEqual-yZXvaV2C.js.map +0 -1
- package/extensions-0SFbU9FH.js +0 -2032
- package/extensions-0SFbU9FH.js.map +0 -1
- package/fullScreenTriangle-MdLGaAMR.js +0 -543
- package/fullScreenTriangle-MdLGaAMR.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/indexNamedExports-Cdy7USiY.d.ts +0 -5696
- package/indexNamedExports-Cdy7USiY.d.ts.map +0 -1
- package/operators-HTxa_0k9.js +0 -4156
- package/operators-HTxa_0k9.js.map +0 -1
- package/std/index.d.ts.map +0 -1
- package/std/index.js.map +0 -1
- package/texture-Dg5ybJro.js.map +0 -1
package/std/matrix.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DualFn } from "../types.js";
|
|
2
|
+
import { m4x4f, v3f } from "../data/wgslTypes.js";
|
|
3
|
+
|
|
4
|
+
//#region src/std/matrix.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Translates the given 4-by-4 matrix by the given vector.
|
|
7
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
8
|
+
* @param {v3f} vector - The vector by which to translate the matrix.
|
|
9
|
+
* @returns {m4x4f} The translated matrix.
|
|
10
|
+
*/
|
|
11
|
+
declare const translate4: DualFn<(matrix: m4x4f, vector: v3f) => m4x4f>;
|
|
12
|
+
/**
|
|
13
|
+
* Scales the given 4-by-4 matrix in each dimension by an amount given by the corresponding entry in the given vector.
|
|
14
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
15
|
+
* @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.
|
|
16
|
+
* @returns {m4x4f} The scaled matrix.
|
|
17
|
+
*/
|
|
18
|
+
declare const scale4: DualFn<(matrix: m4x4f, vector: v3f) => m4x4f>;
|
|
19
|
+
/**
|
|
20
|
+
* Rotates the given 4-by-4 matrix around the x-axis by the given angle.
|
|
21
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
22
|
+
* @param {number} angle - The angle by which to rotate (in radians).
|
|
23
|
+
* @returns {m4x4f} The rotated matrix.
|
|
24
|
+
*/
|
|
25
|
+
declare const rotateX4: DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
|
|
26
|
+
/**
|
|
27
|
+
* Rotates the given 4-by-4 matrix around the y-axis by the given angle.
|
|
28
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
29
|
+
* @param {number} angle - The angle by which to rotate (in radians).
|
|
30
|
+
* @returns {m4x4f} The rotated matrix.
|
|
31
|
+
*/
|
|
32
|
+
declare const rotateY4: DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
|
|
33
|
+
/**
|
|
34
|
+
* Rotates the given 4-by-4 matrix around the z-axis by the given angle.
|
|
35
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
36
|
+
* @param {number} angle - The angle by which to rotate (in radians).
|
|
37
|
+
* @returns {m4x4f} The rotated matrix.
|
|
38
|
+
*/
|
|
39
|
+
declare const rotateZ4: DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { rotateX4, rotateY4, rotateZ4, scale4, translate4 };
|
package/std/matrix.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { $gpuCallable } from "../shared/symbols.js";
|
|
2
|
+
import { stitch } from "../core/resolve/stitch.js";
|
|
3
|
+
import { f32 } from "../data/numeric.js";
|
|
4
|
+
import { vec3f } from "../data/vector.js";
|
|
5
|
+
import { dualImpl } from "../core/function/dualImpl.js";
|
|
6
|
+
import { mat4x4f, rotationX4, rotationY4, rotationZ4, scaling4, translation4 } from "../data/matrix.js";
|
|
7
|
+
import { mul } from "./operators.js";
|
|
8
|
+
|
|
9
|
+
//#region src/std/matrix.ts
|
|
10
|
+
const gpuTranslation4 = translation4[$gpuCallable].call.bind(translation4);
|
|
11
|
+
const gpuScaling4 = scaling4[$gpuCallable].call.bind(scaling4);
|
|
12
|
+
const gpuRotationX4 = rotationX4[$gpuCallable].call.bind(rotationX4);
|
|
13
|
+
const gpuRotationY4 = rotationY4[$gpuCallable].call.bind(rotationY4);
|
|
14
|
+
const gpuRotationZ4 = rotationZ4[$gpuCallable].call.bind(rotationZ4);
|
|
15
|
+
/**
|
|
16
|
+
* Translates the given 4-by-4 matrix by the given vector.
|
|
17
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
18
|
+
* @param {v3f} vector - The vector by which to translate the matrix.
|
|
19
|
+
* @returns {m4x4f} The translated matrix.
|
|
20
|
+
*/
|
|
21
|
+
const translate4 = dualImpl({
|
|
22
|
+
name: "translate4",
|
|
23
|
+
normalImpl: (matrix, vector) => mul(translation4(vector), matrix),
|
|
24
|
+
signature: {
|
|
25
|
+
argTypes: [mat4x4f, vec3f],
|
|
26
|
+
returnType: mat4x4f
|
|
27
|
+
},
|
|
28
|
+
codegenImpl: (ctx, [matrix, vector]) => stitch`(${gpuTranslation4(ctx, [vector])} * ${matrix})`
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Scales the given 4-by-4 matrix in each dimension by an amount given by the corresponding entry in the given vector.
|
|
32
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
33
|
+
* @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.
|
|
34
|
+
* @returns {m4x4f} The scaled matrix.
|
|
35
|
+
*/
|
|
36
|
+
const scale4 = dualImpl({
|
|
37
|
+
name: "scale4",
|
|
38
|
+
normalImpl: (matrix, vector) => mul(scaling4(vector), matrix),
|
|
39
|
+
signature: {
|
|
40
|
+
argTypes: [mat4x4f, vec3f],
|
|
41
|
+
returnType: mat4x4f
|
|
42
|
+
},
|
|
43
|
+
codegenImpl: (ctx, [matrix, vector]) => stitch`(${gpuScaling4(ctx, [vector])} * ${matrix})`
|
|
44
|
+
});
|
|
45
|
+
const rotateSignature = {
|
|
46
|
+
argTypes: [mat4x4f, f32],
|
|
47
|
+
returnType: mat4x4f
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Rotates the given 4-by-4 matrix around the x-axis by the given angle.
|
|
51
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
52
|
+
* @param {number} angle - The angle by which to rotate (in radians).
|
|
53
|
+
* @returns {m4x4f} The rotated matrix.
|
|
54
|
+
*/
|
|
55
|
+
const rotateX4 = dualImpl({
|
|
56
|
+
name: "rotateX4",
|
|
57
|
+
normalImpl: (matrix, angle) => mul(rotationX4(angle), matrix),
|
|
58
|
+
signature: rotateSignature,
|
|
59
|
+
codegenImpl: (ctx, [matrix, angle]) => stitch`(${gpuRotationX4(ctx, [angle])} * ${matrix})`
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Rotates the given 4-by-4 matrix around the y-axis by the given angle.
|
|
63
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
64
|
+
* @param {number} angle - The angle by which to rotate (in radians).
|
|
65
|
+
* @returns {m4x4f} The rotated matrix.
|
|
66
|
+
*/
|
|
67
|
+
const rotateY4 = dualImpl({
|
|
68
|
+
name: "rotateY4",
|
|
69
|
+
normalImpl: (matrix, angle) => mul(rotationY4(angle), matrix),
|
|
70
|
+
signature: rotateSignature,
|
|
71
|
+
codegenImpl: (ctx, [matrix, angle]) => stitch`(${gpuRotationY4(ctx, [angle])} * ${matrix})`
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Rotates the given 4-by-4 matrix around the z-axis by the given angle.
|
|
75
|
+
* @param {m4x4f} matrix - The matrix to be modified.
|
|
76
|
+
* @param {number} angle - The angle by which to rotate (in radians).
|
|
77
|
+
* @returns {m4x4f} The rotated matrix.
|
|
78
|
+
*/
|
|
79
|
+
const rotateZ4 = dualImpl({
|
|
80
|
+
name: "rotateZ4",
|
|
81
|
+
normalImpl: (matrix, angle) => mul(rotationZ4(angle), matrix),
|
|
82
|
+
signature: rotateSignature,
|
|
83
|
+
codegenImpl: (ctx, [matrix, angle]) => stitch`(${gpuRotationZ4(ctx, [angle])} * ${matrix})`
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { rotateX4, rotateY4, rotateZ4, scale4, translate4 };
|
package/std/numeric.d.ts
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { DualFn } from "../types.js";
|
|
2
|
+
import { AbstractFloat, AbstractInt, AnyFloat32VecInstance, AnyFloatVecInstance, AnyIntegerVecInstance, AnyMatInstance, AnyNumericVecInstance, AnySignedVecInstance, F16, F32, I32, Vec2f, Vec2h, Vec2i, Vec3f, Vec3h, Vec3i, Vec4f, Vec4h, Vec4i, WgslStruct, v2f, v2h, v2i, v3f, v3h, v3i, v4f, v4h, v4i } from "../data/wgslTypes.js";
|
|
3
|
+
import { Infer } from "../shared/repr.js";
|
|
4
|
+
|
|
5
|
+
//#region src/std/numeric.d.ts
|
|
6
|
+
type NumVec = AnyNumericVecInstance;
|
|
7
|
+
declare function cpuAbs(value: number): number;
|
|
8
|
+
declare function cpuAbs<T extends NumVec | number>(value: T): T;
|
|
9
|
+
declare const abs: DualFn<typeof cpuAbs>;
|
|
10
|
+
declare function cpuAcos(value: number): number;
|
|
11
|
+
declare function cpuAcos<T extends AnyFloatVecInstance>(value: T): T;
|
|
12
|
+
declare const acos: DualFn<typeof cpuAcos>;
|
|
13
|
+
declare function cpuAcosh(value: number): number;
|
|
14
|
+
declare function cpuAcosh<T extends AnyFloatVecInstance>(value: T): T;
|
|
15
|
+
declare const acosh: DualFn<typeof cpuAcosh>;
|
|
16
|
+
declare function cpuAsin(value: number): number;
|
|
17
|
+
declare function cpuAsin<T extends AnyFloatVecInstance>(value: T): T;
|
|
18
|
+
declare const asin: DualFn<typeof cpuAsin>;
|
|
19
|
+
declare function cpuAsinh(value: number): number;
|
|
20
|
+
declare function cpuAsinh<T extends AnyFloatVecInstance>(value: T): T;
|
|
21
|
+
declare const asinh: DualFn<typeof cpuAsinh>;
|
|
22
|
+
declare function cpuAtan(value: number): number;
|
|
23
|
+
declare function cpuAtan<T extends AnyFloatVecInstance>(value: T): T;
|
|
24
|
+
declare const atan: DualFn<typeof cpuAtan>;
|
|
25
|
+
declare function cpuAtanh(value: number): number;
|
|
26
|
+
declare function cpuAtanh<T extends AnyFloatVecInstance>(value: T): T;
|
|
27
|
+
declare const atanh: DualFn<typeof cpuAtanh>;
|
|
28
|
+
declare function cpuAtan2(y: number, x: number): number;
|
|
29
|
+
declare function cpuAtan2<T extends AnyFloatVecInstance>(y: T, x: T): T;
|
|
30
|
+
declare const atan2: DualFn<typeof cpuAtan2>;
|
|
31
|
+
declare function cpuCeil(value: number): number;
|
|
32
|
+
declare function cpuCeil<T extends AnyFloatVecInstance>(value: T): T;
|
|
33
|
+
declare const ceil: DualFn<typeof cpuCeil>;
|
|
34
|
+
declare function cpuClamp(value: number, low: number, high: number): number;
|
|
35
|
+
declare function cpuClamp<T extends NumVec | number>(value: T, low: T, high: T): T;
|
|
36
|
+
declare const clamp: DualFn<typeof cpuClamp>;
|
|
37
|
+
declare function cpuCos(value: number): number;
|
|
38
|
+
declare function cpuCos<T extends AnyFloatVecInstance>(value: T): T;
|
|
39
|
+
declare const cos: DualFn<typeof cpuCos>;
|
|
40
|
+
declare function cpuCosh(value: number): number;
|
|
41
|
+
declare function cpuCosh<T extends AnyFloatVecInstance>(value: T): T;
|
|
42
|
+
declare const cosh: DualFn<typeof cpuCosh>;
|
|
43
|
+
declare function cpuCountLeadingZeros(value: number): number;
|
|
44
|
+
declare function cpuCountLeadingZeros<T extends AnyIntegerVecInstance>(value: T): T;
|
|
45
|
+
declare const countLeadingZeros: DualFn<typeof cpuCountLeadingZeros>;
|
|
46
|
+
declare function cpuCountOneBits(value: number): number;
|
|
47
|
+
declare function cpuCountOneBits<T extends AnyIntegerVecInstance>(value: T): T;
|
|
48
|
+
declare const countOneBits: DualFn<typeof cpuCountOneBits>;
|
|
49
|
+
declare function cpuCountTrailingZeros(value: number): number;
|
|
50
|
+
declare function cpuCountTrailingZeros<T extends AnyIntegerVecInstance>(value: T): T;
|
|
51
|
+
declare const countTrailingZeros: DualFn<typeof cpuCountTrailingZeros>;
|
|
52
|
+
declare const cross: DualFn<(<T extends v3f | v3h>(a: T, b: T) => T)>;
|
|
53
|
+
declare function cpuDegrees(value: number): number;
|
|
54
|
+
declare function cpuDegrees<T extends AnyFloatVecInstance>(value: T): T;
|
|
55
|
+
declare const degrees: DualFn<typeof cpuDegrees>;
|
|
56
|
+
declare const determinant: DualFn<(value: AnyMatInstance) => number>;
|
|
57
|
+
declare function cpuDistance(a: number, b: number): number;
|
|
58
|
+
declare function cpuDistance<T extends AnyFloatVecInstance>(a: T, b: T): number;
|
|
59
|
+
declare const distance: DualFn<typeof cpuDistance>;
|
|
60
|
+
declare const dot: DualFn<(<T extends NumVec>(lhs: T, rhs: T) => number)>;
|
|
61
|
+
declare const dot4U8Packed: DualFn<(e1: number, e2: number) => number>;
|
|
62
|
+
declare const dot4I8Packed: DualFn<(e1: number, e2: number) => number>;
|
|
63
|
+
declare function cpuExp(value: number): number;
|
|
64
|
+
declare function cpuExp<T extends AnyFloatVecInstance>(value: T): T;
|
|
65
|
+
declare const exp: DualFn<typeof cpuExp>;
|
|
66
|
+
declare function cpuExp2(value: number): number;
|
|
67
|
+
declare function cpuExp2<T extends AnyFloatVecInstance>(value: T): T;
|
|
68
|
+
declare const exp2: DualFn<typeof cpuExp2>;
|
|
69
|
+
declare function cpuExtractBits(e: number, offset: number, count: number): number;
|
|
70
|
+
declare function cpuExtractBits<T extends AnyIntegerVecInstance>(e: T, offset: number, count: number): T;
|
|
71
|
+
declare const extractBits: DualFn<typeof cpuExtractBits>;
|
|
72
|
+
declare const faceForward: DualFn<(<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T) => T)>;
|
|
73
|
+
declare function cpuFirstLeadingBit(value: number): number;
|
|
74
|
+
declare function cpuFirstLeadingBit<T extends AnyIntegerVecInstance>(value: T): T;
|
|
75
|
+
declare const firstLeadingBit: DualFn<typeof cpuFirstLeadingBit>;
|
|
76
|
+
declare function cpuFirstTrailingBit(value: number): number;
|
|
77
|
+
declare function cpuFirstTrailingBit<T extends AnyIntegerVecInstance>(value: T): T;
|
|
78
|
+
declare const firstTrailingBit: DualFn<typeof cpuFirstTrailingBit>;
|
|
79
|
+
declare function cpuFloor(value: number): number;
|
|
80
|
+
declare function cpuFloor<T extends AnyFloatVecInstance>(value: T): T;
|
|
81
|
+
declare const floor: DualFn<typeof cpuFloor>;
|
|
82
|
+
declare function cpuFma(e1: number, e2: number, e3: number): number;
|
|
83
|
+
declare function cpuFma<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T): T;
|
|
84
|
+
declare const fma: DualFn<typeof cpuFma>;
|
|
85
|
+
declare function cpuFract(value: number): number;
|
|
86
|
+
declare function cpuFract<T extends AnyFloatVecInstance>(value: T): T;
|
|
87
|
+
declare const fract: DualFn<typeof cpuFract>;
|
|
88
|
+
declare const FrexpResults: {
|
|
89
|
+
readonly f32: WgslStruct<{
|
|
90
|
+
fract: F32;
|
|
91
|
+
exp: I32;
|
|
92
|
+
}>;
|
|
93
|
+
readonly f16: WgslStruct<{
|
|
94
|
+
fract: F16;
|
|
95
|
+
exp: I32;
|
|
96
|
+
}>;
|
|
97
|
+
readonly abstractFloat: WgslStruct<{
|
|
98
|
+
fract: AbstractFloat;
|
|
99
|
+
exp: AbstractInt;
|
|
100
|
+
}>;
|
|
101
|
+
readonly vec2f: WgslStruct<{
|
|
102
|
+
fract: Vec2f;
|
|
103
|
+
exp: Vec2i;
|
|
104
|
+
}>;
|
|
105
|
+
readonly vec3f: WgslStruct<{
|
|
106
|
+
fract: Vec3f;
|
|
107
|
+
exp: Vec3i;
|
|
108
|
+
}>;
|
|
109
|
+
readonly vec4f: WgslStruct<{
|
|
110
|
+
fract: Vec4f;
|
|
111
|
+
exp: Vec4i;
|
|
112
|
+
}>;
|
|
113
|
+
readonly vec2h: WgslStruct<{
|
|
114
|
+
fract: Vec2h;
|
|
115
|
+
exp: Vec2i;
|
|
116
|
+
}>;
|
|
117
|
+
readonly vec3h: WgslStruct<{
|
|
118
|
+
fract: Vec3h;
|
|
119
|
+
exp: Vec3i;
|
|
120
|
+
}>;
|
|
121
|
+
readonly vec4h: WgslStruct<{
|
|
122
|
+
fract: Vec4h;
|
|
123
|
+
exp: Vec4i;
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
126
|
+
type FrexpOverload = {
|
|
127
|
+
(value: number): Infer<(typeof FrexpResults)['f32']>;
|
|
128
|
+
<T extends AnyFloatVecInstance>(value: T): Infer<(typeof FrexpResults)[T['kind']]>;
|
|
129
|
+
};
|
|
130
|
+
declare const frexp: DualFn<FrexpOverload>;
|
|
131
|
+
declare function cpuInsertBits(e: number, newbits: number, offset: number, count: number): number;
|
|
132
|
+
declare function cpuInsertBits<T extends AnyIntegerVecInstance>(e: T, newbits: T, offset: number, count: number): T;
|
|
133
|
+
declare const insertBits: DualFn<typeof cpuInsertBits>;
|
|
134
|
+
declare function cpuInverseSqrt(value: number): number;
|
|
135
|
+
declare function cpuInverseSqrt<T extends AnyFloatVecInstance>(value: T): T;
|
|
136
|
+
declare const inverseSqrt: DualFn<typeof cpuInverseSqrt>;
|
|
137
|
+
declare function cpuLdexp(e1: number, e2: number): number;
|
|
138
|
+
declare function cpuLdexp<T extends v2f | v2h>(e1: T, e2: v2i): T;
|
|
139
|
+
declare function cpuLdexp<T extends v3f | v3h>(e1: T, e2: v3i): T;
|
|
140
|
+
declare function cpuLdexp<T extends v4f | v4h>(e1: T, e2: v4i): T;
|
|
141
|
+
declare const ldexp: DualFn<typeof cpuLdexp>;
|
|
142
|
+
declare function cpuLength(value: number): number;
|
|
143
|
+
declare function cpuLength<T extends AnyFloatVecInstance>(value: T): number;
|
|
144
|
+
declare const length: DualFn<typeof cpuLength>;
|
|
145
|
+
declare function cpuLog(value: number): number;
|
|
146
|
+
declare function cpuLog<T extends AnyFloatVecInstance>(value: T): T;
|
|
147
|
+
declare const log: DualFn<typeof cpuLog>;
|
|
148
|
+
declare function cpuLog2(value: number): number;
|
|
149
|
+
declare function cpuLog2<T extends AnyFloatVecInstance>(value: T): T;
|
|
150
|
+
declare const log2: DualFn<typeof cpuLog2>;
|
|
151
|
+
type VariadicOverload = {
|
|
152
|
+
(fst: number, ...rest: number[]): number;
|
|
153
|
+
<T extends NumVec>(fst: T, ...rest: T[]): T;
|
|
154
|
+
};
|
|
155
|
+
declare const max: DualFn<VariadicOverload>;
|
|
156
|
+
declare const min: DualFn<VariadicOverload>;
|
|
157
|
+
declare function cpuMix(e1: number, e2: number, e3: number): number;
|
|
158
|
+
declare function cpuMix<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: number): T;
|
|
159
|
+
declare function cpuMix<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: T): T;
|
|
160
|
+
declare const mix: DualFn<typeof cpuMix>;
|
|
161
|
+
declare const ModfResult: {
|
|
162
|
+
readonly f32: WgslStruct<{
|
|
163
|
+
fract: F32;
|
|
164
|
+
whole: F32;
|
|
165
|
+
}>;
|
|
166
|
+
readonly f16: WgslStruct<{
|
|
167
|
+
fract: F16;
|
|
168
|
+
whole: F16;
|
|
169
|
+
}>;
|
|
170
|
+
readonly abstractFloat: WgslStruct<{
|
|
171
|
+
fract: AbstractFloat;
|
|
172
|
+
whole: AbstractFloat;
|
|
173
|
+
}>;
|
|
174
|
+
readonly vec2f: WgslStruct<{
|
|
175
|
+
fract: Vec2f;
|
|
176
|
+
whole: Vec2f;
|
|
177
|
+
}>;
|
|
178
|
+
readonly vec3f: WgslStruct<{
|
|
179
|
+
fract: Vec3f;
|
|
180
|
+
whole: Vec3f;
|
|
181
|
+
}>;
|
|
182
|
+
readonly vec4f: WgslStruct<{
|
|
183
|
+
fract: Vec4f;
|
|
184
|
+
whole: Vec4f;
|
|
185
|
+
}>;
|
|
186
|
+
readonly vec2h: WgslStruct<{
|
|
187
|
+
fract: Vec2h;
|
|
188
|
+
whole: Vec2h;
|
|
189
|
+
}>;
|
|
190
|
+
readonly vec3h: WgslStruct<{
|
|
191
|
+
fract: Vec3h;
|
|
192
|
+
whole: Vec3h;
|
|
193
|
+
}>;
|
|
194
|
+
readonly vec4h: WgslStruct<{
|
|
195
|
+
fract: Vec4h;
|
|
196
|
+
whole: Vec4h;
|
|
197
|
+
}>;
|
|
198
|
+
};
|
|
199
|
+
type ModfOverload = {
|
|
200
|
+
(value: number): Infer<(typeof ModfResult)['f32']>;
|
|
201
|
+
<T extends AnyFloatVecInstance>(value: T): Infer<(typeof ModfResult)[T['kind']]>;
|
|
202
|
+
};
|
|
203
|
+
declare const modf: ModfOverload;
|
|
204
|
+
declare const normalize: DualFn<(<T extends AnyFloatVecInstance>(v: T) => T)>;
|
|
205
|
+
declare function powCpu(base: number, exponent: number): number;
|
|
206
|
+
declare function powCpu<T extends AnyFloatVecInstance>(base: T, exponent: T): T;
|
|
207
|
+
declare const pow: DualFn<typeof powCpu>;
|
|
208
|
+
declare function cpuQuantizeToF16(value: number): number;
|
|
209
|
+
declare function cpuQuantizeToF16<T extends AnyFloat32VecInstance>(value: T): T;
|
|
210
|
+
declare const quantizeToF16: DualFn<typeof cpuQuantizeToF16>;
|
|
211
|
+
declare function cpuRadians(value: number): number;
|
|
212
|
+
declare function cpuRadians<T extends AnyFloatVecInstance | number>(value: T): T;
|
|
213
|
+
declare const radians: DualFn<typeof cpuRadians>;
|
|
214
|
+
declare const reflect: DualFn<(<T extends AnyFloatVecInstance>(e1: T, e2: T) => T)>;
|
|
215
|
+
declare const refract: DualFn<(<T extends AnyFloatVecInstance>(e1: T, e2: T, e3: number) => T)>;
|
|
216
|
+
declare function cpuReverseBits(value: number): number;
|
|
217
|
+
declare function cpuReverseBits<T extends AnyIntegerVecInstance>(value: T): T;
|
|
218
|
+
declare const reverseBits: DualFn<typeof cpuReverseBits>;
|
|
219
|
+
declare function cpuRound(value: number): number;
|
|
220
|
+
declare function cpuRound<T extends AnyFloatVecInstance>(value: T): T;
|
|
221
|
+
declare const round: DualFn<typeof cpuRound>;
|
|
222
|
+
declare function cpuSaturate(value: number): number;
|
|
223
|
+
declare function cpuSaturate<T extends AnyFloatVecInstance>(value: T): T;
|
|
224
|
+
declare const saturate: DualFn<typeof cpuSaturate>;
|
|
225
|
+
declare function cpuSign(e: number): number;
|
|
226
|
+
declare function cpuSign<T extends AnySignedVecInstance>(e: T): T;
|
|
227
|
+
declare const sign: DualFn<typeof cpuSign>;
|
|
228
|
+
declare function cpuSin(value: number): number;
|
|
229
|
+
declare function cpuSin<T extends AnyFloatVecInstance>(value: T): T;
|
|
230
|
+
declare const sin: DualFn<typeof cpuSin>;
|
|
231
|
+
declare function cpuSinh(value: number): number;
|
|
232
|
+
declare function cpuSinh<T extends AnyFloatVecInstance>(value: T): T;
|
|
233
|
+
declare const sinh: DualFn<typeof cpuSinh>;
|
|
234
|
+
declare function cpuSmoothstep(edge0: number, edge1: number, x: number): number;
|
|
235
|
+
declare function cpuSmoothstep<T extends AnyFloatVecInstance>(edge0: T, edge1: T, x: T): T;
|
|
236
|
+
declare const smoothstep: DualFn<typeof cpuSmoothstep>;
|
|
237
|
+
declare function cpuSqrt(value: number): number;
|
|
238
|
+
declare function cpuSqrt<T extends AnyFloatVecInstance>(value: T): T;
|
|
239
|
+
declare const sqrt: DualFn<typeof cpuSqrt>;
|
|
240
|
+
declare function cpuStep(edge: number, x: number): number;
|
|
241
|
+
declare function cpuStep<T extends AnyFloatVecInstance | number>(edge: T, x: T): T;
|
|
242
|
+
declare const step: DualFn<typeof cpuStep>;
|
|
243
|
+
declare function cpuTan(value: number): number;
|
|
244
|
+
declare function cpuTan<T extends AnyFloatVecInstance>(value: T): T;
|
|
245
|
+
declare const tan: DualFn<typeof cpuTan>;
|
|
246
|
+
declare function cpuTanh(value: number): number;
|
|
247
|
+
declare function cpuTanh<T extends AnyFloatVecInstance>(value: T): T;
|
|
248
|
+
declare const tanh: DualFn<typeof cpuTanh>;
|
|
249
|
+
declare const transpose: DualFn<(<T extends AnyMatInstance>(e: T) => T)>;
|
|
250
|
+
declare function cpuTrunc(value: number): number;
|
|
251
|
+
declare function cpuTrunc<T extends AnyFloatVecInstance>(value: T): T;
|
|
252
|
+
declare const trunc: DualFn<typeof cpuTrunc>;
|
|
253
|
+
//#endregion
|
|
254
|
+
export { abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, clamp, cos, cosh, countLeadingZeros, countOneBits, countTrailingZeros, cross, degrees, determinant, distance, dot, dot4I8Packed, dot4U8Packed, exp, exp2, extractBits, faceForward, firstLeadingBit, firstTrailingBit, floor, fma, fract, frexp, insertBits, inverseSqrt, ldexp, length, log, log2, max, min, mix, modf, normalize, pow, quantizeToF16, radians, reflect, refract, reverseBits, round, saturate, sign, sin, sinh, smoothstep, sqrt, step, tan, tanh, transpose, trunc };
|