typegpu 0.11.1 → 0.11.3
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/_virtual/{_rolldown/runtime.js → rolldown_runtime.js} +4 -4
- package/builtin.js +3 -1
- package/common/fullScreenTriangle.d.ts +6 -1
- package/common/fullScreenTriangle.js +3 -1
- package/common/index.js +5 -3
- package/common/writeSoA.js +3 -1
- package/core/buffer/buffer.d.ts +3 -0
- package/core/buffer/buffer.js +5 -3
- package/core/buffer/bufferShorthand.d.ts +2 -0
- package/core/buffer/bufferShorthand.js +3 -1
- package/core/buffer/bufferUsage.d.ts +2 -0
- package/core/buffer/bufferUsage.js +3 -1
- package/core/constant/tgpuConstant.d.ts +2 -1
- package/core/constant/tgpuConstant.js +3 -1
- package/core/declare/tgpuDeclare.js +3 -1
- package/core/function/autoIO.d.ts +3 -0
- package/core/function/autoIO.js +5 -3
- package/core/function/comptime.js +3 -1
- package/core/function/createCallableSchema.js +3 -1
- package/core/function/dualImpl.js +3 -1
- package/core/function/entryInputRouter.js +13 -17
- package/core/function/extractArgs.js +2 -1
- package/core/function/fnCore.js +17 -11
- package/core/function/fnTypes.d.ts +2 -0
- package/core/function/ioSchema.d.ts +1 -0
- package/core/function/ioSchema.js +3 -1
- package/core/function/shelllessImpl.d.ts +1 -0
- package/core/function/shelllessImpl.js +4 -2
- package/core/function/templateUtils.js +2 -1
- package/core/function/tgpuComputeFn.d.ts +1 -0
- package/core/function/tgpuComputeFn.js +4 -2
- package/core/function/tgpuFn.d.ts +1 -0
- package/core/function/tgpuFn.js +17 -15
- package/core/function/tgpuFragmentFn.js +4 -2
- package/core/function/tgpuVertexFn.js +4 -2
- package/core/pipeline/applyPipelineState.js +3 -1
- package/core/pipeline/computePipeline.d.ts +4 -0
- package/core/pipeline/computePipeline.js +8 -6
- package/core/pipeline/connectAttachmentToShader.js +3 -1
- package/core/pipeline/connectTargetsToShader.js +3 -1
- package/core/pipeline/limitsOverflow.js +2 -1
- package/core/pipeline/pipelineUtils.js +6 -4
- package/core/pipeline/renderPipeline.js +21 -19
- package/core/pipeline/timeable.d.ts +2 -0
- package/core/pipeline/timeable.js +3 -1
- package/core/pipeline/typeGuards.js +3 -1
- package/core/querySet/querySet.d.ts +2 -0
- package/core/querySet/querySet.js +3 -1
- package/core/rawCodeSnippet/tgpuRawCodeSnippet.d.ts +1 -0
- package/core/rawCodeSnippet/tgpuRawCodeSnippet.js +3 -1
- package/core/resolve/externals.d.ts +3 -0
- package/core/resolve/externals.js +7 -5
- package/core/resolve/namespace.js +6 -4
- package/core/resolve/resolveData.js +3 -1
- package/core/resolve/stitch.js +3 -1
- package/core/resolve/tgpuResolve.js +7 -5
- package/core/root/configurableImpl.js +3 -1
- package/core/root/init.d.ts +10 -2
- package/core/root/init.js +4 -2
- package/core/root/rootTypes.d.ts +11 -11
- package/core/sampler/sampler.d.ts +4 -0
- package/core/sampler/sampler.js +3 -1
- package/core/simulate/tgpuSimulate.js +6 -4
- package/core/slot/accessor.d.ts +4 -0
- package/core/slot/accessor.js +3 -1
- package/core/slot/internalSlots.js +3 -1
- package/core/slot/lazy.js +3 -1
- package/core/slot/slot.js +3 -1
- package/core/slot/slotTypes.js +3 -1
- package/core/texture/externalTexture.d.ts +6 -0
- package/core/texture/externalTexture.js +3 -1
- package/core/texture/texture.d.ts +4 -0
- package/core/texture/texture.js +6 -4
- package/core/texture/textureFormats.js +3 -1
- package/core/texture/textureUtils.js +3 -1
- package/core/texture/usageExtension.js +3 -1
- package/core/unroll/tgpuUnroll.d.ts +3 -1
- package/core/unroll/tgpuUnroll.js +3 -1
- package/core/valueProxyUtils.js +7 -5
- package/core/variable/tgpuVariable.d.ts +3 -1
- package/core/variable/tgpuVariable.js +3 -1
- package/core/vertexLayout/connectAttributesToShader.js +3 -1
- package/core/vertexLayout/vertexAttribute.d.ts +1 -0
- package/core/vertexLayout/vertexLayout.js +7 -5
- package/data/alignIO.js +3 -1
- package/data/alignmentOf.d.ts +2 -0
- package/data/alignmentOf.js +3 -1
- package/data/array.js +3 -1
- package/data/atomic.d.ts +1 -0
- package/data/atomic.js +3 -1
- package/data/attributes.js +7 -5
- package/data/autoStruct.d.ts +3 -1
- package/data/autoStruct.js +3 -1
- package/data/compiledIO.js +39 -37
- package/data/dataIO.js +22 -20
- package/data/dataTypes.d.ts +9 -4
- package/data/dataTypes.js +3 -1
- package/data/deepEqual.d.ts +1 -0
- package/data/deepEqual.js +3 -1
- package/data/disarray.d.ts +3 -1
- package/data/disarray.js +3 -1
- package/data/getLongestContiguousPrefix.d.ts +2 -0
- package/data/getLongestContiguousPrefix.js +3 -1
- package/data/index.d.ts +3 -3
- package/data/index.js +5 -6
- package/data/isContiguous.d.ts +2 -0
- package/data/isContiguous.js +3 -1
- package/data/matrix.d.ts +11 -8
- package/data/matrix.js +3 -1
- package/data/numberOps.js +2 -1
- package/data/numeric.d.ts +1 -0
- package/data/numeric.js +19 -15
- package/data/offsetUtils.d.ts +1 -0
- package/data/offsetUtils.js +3 -1
- package/data/offsets.js +5 -3
- package/data/partialIO.js +3 -1
- package/data/ptr.d.ts +1 -0
- package/data/ptr.js +3 -1
- package/data/ref.d.ts +3 -0
- package/data/ref.js +5 -3
- package/data/sampler.js +3 -1
- package/data/schemaCallWrapper.js +3 -1
- package/data/schemaMemoryLayout.js +3 -1
- package/data/sizeOf.d.ts +2 -0
- package/data/sizeOf.js +3 -1
- package/data/snippet.d.ts +1 -6
- package/data/snippet.js +3 -1
- package/data/struct.d.ts +1 -0
- package/data/struct.js +3 -1
- package/data/texture.js +3 -1
- package/data/unstruct.d.ts +1 -0
- package/data/unstruct.js +3 -1
- package/data/vector.d.ts +1 -0
- package/data/vector.js +3 -1
- package/data/vectorImpl.js +3 -1
- package/data/vectorOps.js +3 -1
- package/data/vertexFormatData.js +3 -1
- package/data/wgslTypes.d.ts +4 -0
- package/data/wgslTypes.js +3 -1
- package/errors.d.ts +1 -0
- package/errors.js +3 -1
- package/execMode.js +3 -1
- package/extension.d.ts +1 -0
- package/extension.js +3 -1
- package/getGPUValue.js +3 -1
- package/index.js +3 -4
- package/indexNamedExports.d.ts +1 -0
- package/mathUtils.js +2 -1
- package/memo.js +2 -1
- package/nameRegistry.js +3 -1
- package/package.js +3 -2
- package/package.json +1 -1
- package/resolutionCtx.d.ts +11 -0
- package/resolutionCtx.js +86 -87
- package/shared/env.js +2 -1
- package/shared/generators.js +2 -1
- package/shared/meta.js +3 -1
- package/shared/repr.d.ts +1 -0
- package/shared/stringify.js +3 -1
- package/shared/symbols.js +42 -10
- package/shared/utilityTypes.js +2 -1
- package/shared/vertexFormat.js +2 -1
- package/std/array.d.ts +1 -1
- package/std/array.js +3 -1
- package/std/atomic.d.ts +12 -12
- package/std/atomic.js +3 -1
- package/std/bitcast.d.ts +2 -2
- package/std/bitcast.js +3 -1
- package/std/boolean.d.ts +15 -14
- package/std/boolean.js +3 -1
- package/std/derivative.d.ts +9 -9
- package/std/derivative.js +3 -1
- package/std/discard.d.ts +1 -1
- package/std/discard.js +3 -1
- package/std/extensions.d.ts +3 -1
- package/std/extensions.js +3 -1
- package/std/index.js +5 -3
- package/std/matrix.d.ts +6 -5
- package/std/matrix.js +3 -1
- package/std/numeric.d.ts +132 -78
- package/std/numeric.js +7 -5
- package/std/operators.d.ts +8 -8
- package/std/operators.js +7 -5
- package/std/packing.d.ts +5 -4
- package/std/packing.js +3 -1
- package/std/range.d.ts +3 -1
- package/std/range.js +3 -1
- package/std/subgroup.d.ts +21 -21
- package/std/subgroup.js +3 -1
- package/std/texture.d.ts +11 -11
- package/std/texture.js +9 -7
- package/tgpu.js +5 -3
- package/tgpuBindGroupLayout.d.ts +11 -7
- package/tgpuBindGroupLayout.js +3 -1
- package/tgpuUnstable.js +5 -3
- package/tgsl/accessIndex.js +5 -3
- package/tgsl/accessProp.js +10 -3
- package/tgsl/consoleLog/deserializers.js +3 -1
- package/tgsl/consoleLog/logGenerator.js +18 -9
- package/tgsl/consoleLog/serializers.js +3 -1
- package/tgsl/consoleLog/types.d.ts +3 -0
- package/tgsl/consoleLog/types.js +2 -1
- package/tgsl/conversion.js +18 -6
- package/tgsl/forOfUtils.js +17 -7
- package/tgsl/generationHelpers.d.ts +1 -0
- package/tgsl/generationHelpers.js +3 -4
- package/tgsl/math.js +3 -1
- package/tgsl/shaderGenerator.d.ts +3 -2
- package/tgsl/shaderGenerator_members.d.ts +15 -2
- package/tgsl/shaderGenerator_members.js +5 -3
- package/tgsl/shellless.js +3 -1
- package/tgsl/wgslGenerator.d.ts +3 -1
- package/tgsl/wgslGenerator.js +54 -44
- package/types.d.ts +11 -7
- package/types.js +3 -1
- package/wgslExtensions.js +2 -1
package/core/root/init.js
CHANGED
|
@@ -23,6 +23,7 @@ import { INTERNAL_createComputePipeline } from "../pipeline/computePipeline.js";
|
|
|
23
23
|
import { isVertexLayout } from "../vertexLayout/vertexLayout.js";
|
|
24
24
|
import { INTERNAL_createRenderPipeline } from "../pipeline/renderPipeline.js";
|
|
25
25
|
import { allEq } from "../../std/boolean.js";
|
|
26
|
+
|
|
26
27
|
//#region src/core/root/init.ts
|
|
27
28
|
/**
|
|
28
29
|
* Changes the given array to a vec of 3 numbers, filling missing values with 1.
|
|
@@ -122,7 +123,7 @@ var WithBindingImpl = class WithBindingImpl {
|
|
|
122
123
|
sizeUniform,
|
|
123
124
|
wrappedCallback
|
|
124
125
|
});
|
|
125
|
-
return new TgpuGuardedComputePipelineImpl(root, this.createComputePipeline({ compute: mainCompute }), sizeUniform, workgroupSize);
|
|
126
|
+
return new TgpuGuardedComputePipelineImpl(root, (() => this.createComputePipeline({ compute: mainCompute }))(), sizeUniform, workgroupSize);
|
|
126
127
|
}
|
|
127
128
|
withVertex(entryFn, attribs) {
|
|
128
129
|
return new WithVertexImpl(this.#getRoot(), this.#slotBindings, {
|
|
@@ -460,5 +461,6 @@ function initFromDevice(options) {
|
|
|
460
461
|
const { device, unstable_names: names = "strict", unstable_logOptions } = options ?? {};
|
|
461
462
|
return new TgpuRootImpl(device, names, false, unstable_logOptions ?? {}, options?.shaderGenerator);
|
|
462
463
|
}
|
|
464
|
+
|
|
463
465
|
//#endregion
|
|
464
|
-
export { init, initFromDevice };
|
|
466
|
+
export { init, initFromDevice };
|
package/core/root/rootTypes.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ interface TgpuGuardedComputePipeline<TArgs extends number[] = number[]> extends
|
|
|
62
62
|
interface WithCompute {
|
|
63
63
|
createPipeline(): TgpuComputePipeline;
|
|
64
64
|
}
|
|
65
|
-
type OptionalArgs<T> = T extends Record<string, never> | undefined ? [] | [T] : [T];
|
|
65
|
+
type OptionalArgs<T$1> = T$1 extends Record<string, never> | undefined ? [] | [T$1] : [T$1];
|
|
66
66
|
/**
|
|
67
67
|
* TODO: Remove in favor of createRenderPipeline's validation
|
|
68
68
|
*/
|
|
@@ -100,9 +100,9 @@ interface WithFragment<Targets extends FragmentOutConstrained = FragmentOutConst
|
|
|
100
100
|
createPipeline(): TgpuRenderPipeline<Targets>;
|
|
101
101
|
}
|
|
102
102
|
interface Withable<TSelf> {
|
|
103
|
-
with<T>(slot: TgpuSlot<T>, value: Eventual<T>): TSelf;
|
|
104
|
-
with<T extends BaseData>(accessor: TgpuAccessor<T>, value: TgpuAccessor.In<NoInfer<T>>): TSelf;
|
|
105
|
-
with<T extends BaseData>(accessor: TgpuMutableAccessor<T>, value: TgpuMutableAccessor.In<NoInfer<T>>): TSelf;
|
|
103
|
+
with<T$1>(slot: TgpuSlot<T$1>, value: Eventual<T$1>): TSelf;
|
|
104
|
+
with<T$1 extends BaseData>(accessor: TgpuAccessor<T$1>, value: TgpuAccessor.In<NoInfer<T$1>>): TSelf;
|
|
105
|
+
with<T$1 extends BaseData>(accessor: TgpuMutableAccessor<T$1>, value: TgpuMutableAccessor.In<NoInfer<T$1>>): TSelf;
|
|
106
106
|
}
|
|
107
107
|
interface Withable_Deprecated<TSelf> {
|
|
108
108
|
/**
|
|
@@ -110,19 +110,19 @@ interface Withable_Deprecated<TSelf> {
|
|
|
110
110
|
* @param slot
|
|
111
111
|
* @param value
|
|
112
112
|
*/
|
|
113
|
-
with<T>(slot: TgpuSlot<T>, value: Eventual<T>): TSelf;
|
|
113
|
+
with<T$1>(slot: TgpuSlot<T$1>, value: Eventual<T$1>): TSelf;
|
|
114
114
|
/**
|
|
115
115
|
* @deprecated This feature is stable, remove the `['~unstable']`
|
|
116
116
|
* @param slot
|
|
117
117
|
* @param value
|
|
118
118
|
*/
|
|
119
|
-
with<T extends BaseData>(accessor: TgpuAccessor<T>, value: TgpuAccessor.In<NoInfer<T>>): TSelf;
|
|
119
|
+
with<T$1 extends BaseData>(accessor: TgpuAccessor<T$1>, value: TgpuAccessor.In<NoInfer<T$1>>): TSelf;
|
|
120
120
|
/**
|
|
121
121
|
* @deprecated This feature is stable, remove the `['~unstable']`
|
|
122
122
|
* @param slot
|
|
123
123
|
* @param value
|
|
124
124
|
*/
|
|
125
|
-
with<T extends BaseData>(accessor: TgpuMutableAccessor<T>, value: TgpuMutableAccessor.In<NoInfer<T>>): TSelf;
|
|
125
|
+
with<T$1 extends BaseData>(accessor: TgpuMutableAccessor<T$1>, value: TgpuMutableAccessor.In<NoInfer<T$1>>): TSelf;
|
|
126
126
|
}
|
|
127
127
|
interface Configurable extends Withable<Configurable> {
|
|
128
128
|
readonly bindings: [slot: TgpuSlot<unknown>, value: unknown][];
|
|
@@ -134,9 +134,9 @@ interface Configurable extends Withable<Configurable> {
|
|
|
134
134
|
* @example d.builtin.position => d.Void
|
|
135
135
|
* @example { a: d.v4f, $fragDepth: number } => { a: d.Vec4f }
|
|
136
136
|
*/
|
|
137
|
-
type NormalizeOutput<T> = T extends {
|
|
137
|
+
type NormalizeOutput<T$1> = T$1 extends {
|
|
138
138
|
readonly [$internal]: unknown;
|
|
139
|
-
} | number | boolean ? [OmitBuiltins<InstanceToSchema<T>>] extends [never] ? Void : OmitBuiltins<InstanceToSchema<T>> : { [K in keyof OmitBuiltins<T>]: InstanceToSchema<OmitBuiltins<T>[K]> };
|
|
139
|
+
} | number | boolean ? [OmitBuiltins<InstanceToSchema<T$1>>] extends [never] ? Void : OmitBuiltins<InstanceToSchema<T$1>> : { [K in keyof OmitBuiltins<T$1>]: InstanceToSchema<OmitBuiltins<T$1>[K]> };
|
|
140
140
|
interface WithBinding extends Withable<WithBinding> {
|
|
141
141
|
/** @deprecated Use `root.createComputePipeline` instead. */
|
|
142
142
|
withCompute<ComputeIn extends IORecord<AnyComputeBuiltin>>(entryFn: TgpuComputeFn<ComputeIn>): WithCompute;
|
|
@@ -241,7 +241,7 @@ type SrgbVariants = {
|
|
|
241
241
|
'astc-12x10-unorm': 'astc-12x10-unorm-srgb';
|
|
242
242
|
'astc-12x12-unorm': 'astc-12x12-unorm-srgb';
|
|
243
243
|
};
|
|
244
|
-
type SrgbVariantOrSelf<T extends GPUTextureFormat> = T extends keyof SrgbVariants ? (SrgbVariants[T] | T)[] | undefined : T extends `${infer Base}-srgb` ? Base extends keyof SrgbVariants ? (T | SrgbVariants[Base])[] | undefined : T[] | undefined : T[] | undefined;
|
|
244
|
+
type SrgbVariantOrSelf<T$1 extends GPUTextureFormat> = T$1 extends keyof SrgbVariants ? (SrgbVariants[T$1] | T$1)[] | undefined : T$1 extends `${infer Base}-srgb` ? Base extends keyof SrgbVariants ? (T$1 | SrgbVariants[Base])[] | undefined : T$1[] | undefined : T$1[] | undefined;
|
|
245
245
|
type CreateTextureOptions<TSize, TFormat extends GPUTextureFormat, TMipLevelCount extends number, TSampleCount extends number, TViewFormats extends GPUTextureFormat[], TDimension extends GPUTextureDimension> = {
|
|
246
246
|
/**
|
|
247
247
|
* The width, height, and depth or layer count of the texture.
|
|
@@ -561,7 +561,7 @@ interface TgpuRoot extends Unwrapper, WithBinding {
|
|
|
561
561
|
* @param count The number of queries in the set.
|
|
562
562
|
* @param rawQuerySet An optional pre-existing GPUQuerySet to use instead of creating a new one.
|
|
563
563
|
*/
|
|
564
|
-
createQuerySet<T extends GPUQueryType>(type: T, count: number, rawQuerySet?: GPUQuerySet): TgpuQuerySet<T>;
|
|
564
|
+
createQuerySet<T$1 extends GPUQueryType>(type: T$1, count: number, rawQuerySet?: GPUQuerySet): TgpuQuerySet<T$1>;
|
|
565
565
|
/**
|
|
566
566
|
* Creates a group of resources that can be bound to a shader based on a specified layout.
|
|
567
567
|
*
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { TgpuNamable } from "../../shared/meta.js";
|
|
2
2
|
import { $gpuValueOf, $internal } from "../../shared/symbols.js";
|
|
3
3
|
import { WgslComparisonSampler, WgslSampler } from "../../data/sampler.js";
|
|
4
|
+
import "../../data/snippet.js";
|
|
5
|
+
import "../../unwrapper.js";
|
|
6
|
+
import "../../tgpuBindGroupLayout.js";
|
|
7
|
+
import "../../types.js";
|
|
4
8
|
import { Infer } from "../../shared/repr.js";
|
|
5
9
|
|
|
6
10
|
//#region src/core/sampler/sampler.d.ts
|
package/core/sampler/sampler.js
CHANGED
|
@@ -4,6 +4,7 @@ import { snip } from "../../data/snippet.js";
|
|
|
4
4
|
import { inCodegenMode } from "../../execMode.js";
|
|
5
5
|
import { valueProxyHandler } from "../valueProxyUtils.js";
|
|
6
6
|
import { comparisonSampler, sampler } from "../../data/sampler.js";
|
|
7
|
+
|
|
7
8
|
//#region src/core/sampler/sampler.ts
|
|
8
9
|
function INTERNAL_createSampler(props, branch) {
|
|
9
10
|
return new TgpuFixedSamplerImpl(sampler(), props, branch);
|
|
@@ -112,5 +113,6 @@ var TgpuFixedSamplerImpl = class {
|
|
|
112
113
|
return `${this.resourceType}:${getName(this) ?? "<unnamed>"}`;
|
|
113
114
|
}
|
|
114
115
|
};
|
|
116
|
+
|
|
115
117
|
//#endregion
|
|
116
|
-
export { INTERNAL_createComparisonSampler, INTERNAL_createSampler, TgpuLaidOutSamplerImpl, isComparisonSampler, isSampler };
|
|
118
|
+
export { INTERNAL_createComparisonSampler, INTERNAL_createSampler, TgpuLaidOutSamplerImpl, isComparisonSampler, isSampler };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SimulationState } from "../../types.js";
|
|
2
2
|
import { getResolutionCtx, provideCtx } from "../../execMode.js";
|
|
3
3
|
import { namespace } from "../resolve/namespace.js";
|
|
4
|
-
import
|
|
4
|
+
import wgslGenerator_default from "../../tgsl/wgslGenerator.js";
|
|
5
5
|
import { ResolutionCtxImpl } from "../../resolutionCtx.js";
|
|
6
|
+
|
|
6
7
|
//#region src/core/simulate/tgpuSimulate.ts
|
|
7
8
|
/**
|
|
8
9
|
* Runs the provided callback in a simulated environment, giving
|
|
@@ -29,7 +30,7 @@ import { ResolutionCtxImpl } from "../../resolutionCtx.js";
|
|
|
29
30
|
function simulate(callback) {
|
|
30
31
|
const ctx = getResolutionCtx() ?? new ResolutionCtxImpl({
|
|
31
32
|
namespace: namespace(),
|
|
32
|
-
shaderGenerator:
|
|
33
|
+
shaderGenerator: wgslGenerator_default
|
|
33
34
|
});
|
|
34
35
|
const workgroups = [
|
|
35
36
|
1,
|
|
@@ -49,7 +50,7 @@ function simulate(callback) {
|
|
|
49
50
|
const buffers = /* @__PURE__ */ new Map();
|
|
50
51
|
const workgroupVars = Array.from({ length: workgroups[0] }, () => Array.from({ length: workgroups[1] }, () => Array.from({ length: workgroups[2] }, () => /* @__PURE__ */ new Map())));
|
|
51
52
|
const privateVars = Array.from({ length: threads[0] }, () => Array.from({ length: threads[1] }, () => Array.from({ length: threads[2] }, () => /* @__PURE__ */ new Map())));
|
|
52
|
-
const simStates = Array.from({ length: threads[0] }, (_, i) => Array.from({ length: threads[1] }, (_, j) => Array.from({ length: threads[2] }, (_, k) => {
|
|
53
|
+
const simStates = Array.from({ length: threads[0] }, (_, i) => Array.from({ length: threads[1] }, (_$1, j) => Array.from({ length: threads[2] }, (_$2, k) => {
|
|
53
54
|
const wi = Math.floor(i / workgroupSize[0]);
|
|
54
55
|
const wj = Math.floor(j / workgroupSize[1]);
|
|
55
56
|
const wk = Math.floor(k / workgroupSize[2]);
|
|
@@ -70,5 +71,6 @@ function simulate(callback) {
|
|
|
70
71
|
ctx.popMode("simulate");
|
|
71
72
|
}
|
|
72
73
|
}
|
|
74
|
+
|
|
73
75
|
//#endregion
|
|
74
|
-
export { simulate };
|
|
76
|
+
export { simulate };
|
package/core/slot/accessor.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import "../../data/snippet.js";
|
|
1
2
|
import { TgpuAccessor, TgpuMutableAccessor } from "./slotTypes.js";
|
|
2
3
|
import { UnwrapRuntimeConstructor } from "../../tgpuBindGroupLayout.js";
|
|
4
|
+
import "../../types.js";
|
|
5
|
+
import "../../data/wgslTypes.js";
|
|
6
|
+
import "../../shared/repr.js";
|
|
3
7
|
import { AnyData } from "../../data/dataTypes.js";
|
|
4
8
|
|
|
5
9
|
//#region src/core/slot/accessor.d.ts
|
package/core/slot/accessor.js
CHANGED
|
@@ -8,6 +8,7 @@ import { schemaCallWrapper } from "../../data/schemaCallWrapper.js";
|
|
|
8
8
|
import { getGpuValueRecursively, valueProxyHandler } from "../valueProxyUtils.js";
|
|
9
9
|
import { isTgpuFn } from "../function/tgpuFn.js";
|
|
10
10
|
import { slot } from "./slot.js";
|
|
11
|
+
|
|
11
12
|
//#region src/core/slot/accessor.ts
|
|
12
13
|
function accessor(schemaOrConstructor, defaultValue) {
|
|
13
14
|
return new TgpuAccessorImpl(schemaOrConstructor, defaultValue);
|
|
@@ -91,5 +92,6 @@ var TgpuMutableAccessorImpl = class extends AccessorBase {
|
|
|
91
92
|
throw new Error("`tgpu.mutableAccessor` relies on GPU resources and cannot be accessed outside of a compute dispatch or draw call");
|
|
92
93
|
}
|
|
93
94
|
};
|
|
95
|
+
|
|
94
96
|
//#endregion
|
|
95
|
-
export { accessor, mutableAccessor };
|
|
97
|
+
export { accessor, mutableAccessor };
|
package/core/slot/lazy.js
CHANGED
|
@@ -2,6 +2,7 @@ import { $gpuValueOf, $internal, $providing } from "../../shared/symbols.js";
|
|
|
2
2
|
import { isAccessor, isMutableAccessor } from "./slotTypes.js";
|
|
3
3
|
import { getResolutionCtx } from "../../execMode.js";
|
|
4
4
|
import { getGpuValueRecursively } from "../valueProxyUtils.js";
|
|
5
|
+
|
|
5
6
|
//#region src/core/slot/lazy.ts
|
|
6
7
|
function lazy(compute) {
|
|
7
8
|
if (getResolutionCtx()) throw new Error("Cannot create tgpu.lazy objects during shader resolution.");
|
|
@@ -36,5 +37,6 @@ var TgpuLazyImpl = class TgpuLazyImpl {
|
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
TgpuLazyImpl.prototype.resourceType = "lazy";
|
|
40
|
+
|
|
39
41
|
//#endregion
|
|
40
|
-
export { lazy };
|
|
42
|
+
export { lazy };
|
package/core/slot/slot.js
CHANGED
|
@@ -2,6 +2,7 @@ import { $gpuValueOf, $internal } from "../../shared/symbols.js";
|
|
|
2
2
|
import { getName, setName } from "../../shared/meta.js";
|
|
3
3
|
import { getResolutionCtx } from "../../execMode.js";
|
|
4
4
|
import { getGpuValueRecursively } from "../valueProxyUtils.js";
|
|
5
|
+
|
|
5
6
|
//#region src/core/slot/slot.ts
|
|
6
7
|
function slot(defaultValue) {
|
|
7
8
|
return new TgpuSlotImpl(defaultValue);
|
|
@@ -35,5 +36,6 @@ var TgpuSlotImpl = class {
|
|
|
35
36
|
return this.value;
|
|
36
37
|
}
|
|
37
38
|
};
|
|
39
|
+
|
|
38
40
|
//#endregion
|
|
39
|
-
export { slot };
|
|
41
|
+
export { slot };
|
package/core/slot/slotTypes.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { $providing } from "../../shared/symbols.js";
|
|
2
|
+
|
|
2
3
|
//#region src/core/slot/slotTypes.ts
|
|
3
4
|
function isSlot(value) {
|
|
4
5
|
return value?.resourceType === "slot";
|
|
@@ -15,5 +16,6 @@ function isAccessor(value) {
|
|
|
15
16
|
function isMutableAccessor(value) {
|
|
16
17
|
return value?.resourceType === "mutable-accessor";
|
|
17
18
|
}
|
|
19
|
+
|
|
18
20
|
//#endregion
|
|
19
|
-
export { isAccessor, isLazy, isMutableAccessor, isProviding, isSlot };
|
|
21
|
+
export { isAccessor, isLazy, isMutableAccessor, isProviding, isSlot };
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import "../../data/snippet.js";
|
|
2
|
+
import "../../tgpuBindGroupLayout.js";
|
|
3
|
+
import "../../types.js";
|
|
4
|
+
import "../../data/texture.js";
|
|
5
|
+
import "../../shared/repr.js";
|
|
6
|
+
|
|
1
7
|
//#region src/core/texture/externalTexture.d.ts
|
|
2
8
|
interface TgpuExternalTexture {
|
|
3
9
|
readonly resourceType: 'external-texture';
|
|
@@ -4,6 +4,7 @@ import { snip } from "../../data/snippet.js";
|
|
|
4
4
|
import { inCodegenMode } from "../../execMode.js";
|
|
5
5
|
import { valueProxyHandler } from "../valueProxyUtils.js";
|
|
6
6
|
import { textureExternal } from "../../data/texture.js";
|
|
7
|
+
|
|
7
8
|
//#region src/core/texture/externalTexture.ts
|
|
8
9
|
var TgpuExternalTextureImpl = class {
|
|
9
10
|
resourceType = "external-texture";
|
|
@@ -43,5 +44,6 @@ var TgpuExternalTextureImpl = class {
|
|
|
43
44
|
return `textureExternal:${getName(this) ?? "<unnamed>"}`;
|
|
44
45
|
}
|
|
45
46
|
};
|
|
47
|
+
|
|
46
48
|
//#endregion
|
|
47
|
-
export { TgpuExternalTextureImpl };
|
|
49
|
+
export { TgpuExternalTextureImpl };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { TgpuNamable } from "../../shared/meta.js";
|
|
2
2
|
import { $gpuValueOf, $internal } from "../../shared/symbols.js";
|
|
3
3
|
import { Default, TypedArray, UnionToIntersection } from "../../shared/utilityTypes.js";
|
|
4
|
+
import "../../data/snippet.js";
|
|
4
5
|
import { TextureProps } from "./textureProps.js";
|
|
5
6
|
import { AllowedUsages, LiteralToExtensionMap } from "./usageExtension.js";
|
|
7
|
+
import "../../tgpuBindGroupLayout.js";
|
|
8
|
+
import "../root/rootTypes.js";
|
|
9
|
+
import "../../types.js";
|
|
6
10
|
import { F32 } from "../../data/wgslTypes.js";
|
|
7
11
|
import { TextureFormats, ViewDimensionToDimension } from "./textureFormats.js";
|
|
8
12
|
import { TextureSchemaForDescriptor, WgslStorageTexture, WgslTexture } from "../../data/texture.js";
|
package/core/texture/texture.js
CHANGED
|
@@ -6,6 +6,7 @@ import { valueProxyHandler } from "../valueProxyUtils.js";
|
|
|
6
6
|
import { isWgslStorageTexture, textureDescriptorToSchema } from "../../data/texture.js";
|
|
7
7
|
import { getTextureFormatInfo } from "./textureFormats.js";
|
|
8
8
|
import { generateTextureMipmaps, getImageSourceDimensions, resampleImage } from "./textureUtils.js";
|
|
9
|
+
|
|
9
10
|
//#region src/core/texture/texture.ts
|
|
10
11
|
function getDescriptorForProps(props) {
|
|
11
12
|
return {
|
|
@@ -203,13 +204,13 @@ var TgpuFixedTextureViewImpl = class {
|
|
|
203
204
|
this.#descriptor = descriptor;
|
|
204
205
|
this[$internal] = { unwrap: () => {
|
|
205
206
|
if (!this.#view) {
|
|
206
|
-
const schema = this.schema;
|
|
207
|
-
const format = isWgslStorageTexture(schema) ? schema.format : this.#baseTexture.props.format;
|
|
207
|
+
const schema$1 = this.schema;
|
|
208
|
+
const format = isWgslStorageTexture(schema$1) ? schema$1.format : this.#baseTexture.props.format;
|
|
208
209
|
this.#view = this.#baseTexture[$internal].unwrap().createView({
|
|
209
210
|
...this.#descriptor,
|
|
210
211
|
label: getName(this) ?? "<unnamed>",
|
|
211
212
|
format: this.#descriptor?.format ?? format,
|
|
212
|
-
dimension: schema.dimension
|
|
213
|
+
dimension: schema$1.dimension
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
216
|
return this.#view;
|
|
@@ -310,5 +311,6 @@ var TgpuTextureRenderViewImpl = class {
|
|
|
310
311
|
} };
|
|
311
312
|
}
|
|
312
313
|
};
|
|
314
|
+
|
|
313
315
|
//#endregion
|
|
314
|
-
export { INTERNAL_createTexture, TgpuLaidOutTextureViewImpl, isTexture, isTextureView };
|
|
316
|
+
export { INTERNAL_createTexture, TgpuLaidOutTextureViewImpl, isTexture, isTextureView };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { f32, i32, u32 } from "../../data/numeric.js";
|
|
2
2
|
import { vec4f, vec4i, vec4u } from "../../data/vector.js";
|
|
3
|
+
|
|
3
4
|
//#region src/core/texture/textureFormats.ts
|
|
4
5
|
const DEPTH_ASPECT_NON_COPYABLE = {
|
|
5
6
|
channelType: f32,
|
|
@@ -93,5 +94,6 @@ function getEffectiveSampleTypes(device, format) {
|
|
|
93
94
|
if (FLOAT32_FORMATS.has(format) && !device.features.has("float32-filterable")) return ["unfilterable-float"];
|
|
94
95
|
return getTextureFormatInfo(format).sampleTypes;
|
|
95
96
|
}
|
|
97
|
+
|
|
96
98
|
//#endregion
|
|
97
|
-
export { getEffectiveSampleTypes, getTextureFormatInfo };
|
|
99
|
+
export { getEffectiveSampleTypes, getTextureFormatInfo };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getEffectiveSampleTypes, getTextureFormatInfo } from "./textureFormats.js";
|
|
2
|
+
|
|
2
3
|
//#region src/core/texture/textureUtils.ts
|
|
3
4
|
function getImageSourceDimensions(source) {
|
|
4
5
|
const { videoWidth, videoHeight } = source;
|
|
@@ -218,5 +219,6 @@ function resampleImage(device, targetTexture, image, layer = 0) {
|
|
|
218
219
|
inputTexture.destroy();
|
|
219
220
|
renderTexture.destroy();
|
|
220
221
|
}
|
|
222
|
+
|
|
221
223
|
//#endregion
|
|
222
|
-
export { clearTextureUtilsCache, generateTextureMipmaps, getImageSourceDimensions, resampleImage };
|
|
224
|
+
export { clearTextureUtilsCache, generateTextureMipmaps, getImageSourceDimensions, resampleImage };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getName } from "../../shared/meta.js";
|
|
2
|
+
|
|
2
3
|
//#region src/core/texture/usageExtension.ts
|
|
3
4
|
function isUsableAsSampled(value) {
|
|
4
5
|
return !!value?.usableAsSampled;
|
|
@@ -15,5 +16,6 @@ var NotSampledError = class NotSampledError extends Error {
|
|
|
15
16
|
Object.setPrototypeOf(this, NotSampledError.prototype);
|
|
16
17
|
}
|
|
17
18
|
};
|
|
19
|
+
|
|
18
20
|
//#endregion
|
|
19
|
-
export { NotSampledError, isUsableAsRender, isUsableAsSampled };
|
|
21
|
+
export { NotSampledError, isUsableAsRender, isUsableAsSampled };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { $internal } from "../../shared/symbols.js";
|
|
2
|
+
import "../../data/snippet.js";
|
|
2
3
|
import { GPUCallable } from "../../types.js";
|
|
3
4
|
|
|
4
5
|
//#region src/core/unroll/tgpuUnroll.d.ts
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Marks an iterable to be unrolled by the shader generator when used in a for loop.
|
|
7
9
|
*
|
|
@@ -61,7 +63,7 @@ import { GPUCallable } from "../../types.js";
|
|
|
61
63
|
* }
|
|
62
64
|
* ```
|
|
63
65
|
*/
|
|
64
|
-
declare const unroll: (<T extends Iterable<unknown>>(iterable: T) => T) & GPUCallable & {
|
|
66
|
+
declare const unroll: (<T extends Iterable<unknown>>(iterable: T) => T) & GPUCallable<[iterable: Iterable<unknown>]> & {
|
|
65
67
|
[$internal]: true;
|
|
66
68
|
};
|
|
67
69
|
//#endregion
|
|
@@ -2,6 +2,7 @@ import { $gpuCallable, $internal, $resolve } from "../../shared/symbols.js";
|
|
|
2
2
|
import { setName } from "../../shared/meta.js";
|
|
3
3
|
import { snip } from "../../data/snippet.js";
|
|
4
4
|
import { stitch } from "../resolve/stitch.js";
|
|
5
|
+
|
|
5
6
|
//#region src/core/unroll/tgpuUnroll.ts
|
|
6
7
|
/**
|
|
7
8
|
* The result of calling `tgpu.unroll(...)`. The code responsible for
|
|
@@ -90,5 +91,6 @@ const unroll = (() => {
|
|
|
90
91
|
} };
|
|
91
92
|
return impl;
|
|
92
93
|
})();
|
|
94
|
+
|
|
93
95
|
//#endregion
|
|
94
|
-
export { UnrollableIterable, unroll };
|
|
96
|
+
export { UnrollableIterable, unroll };
|
package/core/valueProxyUtils.js
CHANGED
|
@@ -3,6 +3,7 @@ import { getOwnSnippet } from "../types.js";
|
|
|
3
3
|
import { getGPUValue } from "../getGPUValue.js";
|
|
4
4
|
import { accessProp } from "../tgsl/accessProp.js";
|
|
5
5
|
import { accessIndex } from "../tgsl/accessIndex.js";
|
|
6
|
+
|
|
6
7
|
//#region src/core/valueProxyUtils.ts
|
|
7
8
|
const valueProxyHandler = { get(target, prop) {
|
|
8
9
|
if (prop in target) return Reflect.get(target, prop);
|
|
@@ -11,12 +12,12 @@ const valueProxyHandler = { get(target, prop) {
|
|
|
11
12
|
const targetSnippet = getOwnSnippet(target);
|
|
12
13
|
const index = Number(prop);
|
|
13
14
|
if (!Number.isNaN(index)) {
|
|
14
|
-
const accessed = accessIndex(targetSnippet, index);
|
|
15
|
-
if (!accessed) return;
|
|
15
|
+
const accessed$1 = accessIndex(targetSnippet, index);
|
|
16
|
+
if (!accessed$1) return;
|
|
16
17
|
return new Proxy({
|
|
17
18
|
[$internal]: true,
|
|
18
|
-
[$resolve]: (ctx) => ctx.resolve(accessed.value, accessed.dataType),
|
|
19
|
-
[$ownSnippet]: accessed,
|
|
19
|
+
[$resolve]: (ctx) => ctx.resolve(accessed$1.value, accessed$1.dataType),
|
|
20
|
+
[$ownSnippet]: accessed$1,
|
|
20
21
|
toString: () => `${String(target)}[${prop}]`
|
|
21
22
|
}, valueProxyHandler);
|
|
22
23
|
}
|
|
@@ -38,5 +39,6 @@ function getGpuValueRecursively(value) {
|
|
|
38
39
|
}
|
|
39
40
|
return unwrapped;
|
|
40
41
|
}
|
|
42
|
+
|
|
41
43
|
//#endregion
|
|
42
|
-
export { getGpuValueRecursively, valueProxyHandler };
|
|
44
|
+
export { getGpuValueRecursively, valueProxyHandler };
|
|
@@ -15,7 +15,9 @@ interface TgpuVar<TScope extends VariableScope = VariableScope, TDataType extend
|
|
|
15
15
|
value: InferGPU<TDataType>;
|
|
16
16
|
$: InferGPU<TDataType>;
|
|
17
17
|
readonly [$internal]: {
|
|
18
|
-
/** Makes it differentiable on the type level. Does not exist at runtime. */
|
|
18
|
+
/** Makes it differentiable on the type level. Does not exist at runtime. */
|
|
19
|
+
dataType?: TDataType;
|
|
20
|
+
/** Makes it differentiable on the type level. Does not exist at runtime. */
|
|
19
21
|
scope?: TScope;
|
|
20
22
|
};
|
|
21
23
|
}
|
|
@@ -6,6 +6,7 @@ import { IllegalVarAccessError } from "../../errors.js";
|
|
|
6
6
|
import { getExecMode, isInsideTgpuFn } from "../../execMode.js";
|
|
7
7
|
import { assertExhaustive } from "../../shared/utilityTypes.js";
|
|
8
8
|
import { valueProxyHandler } from "../valueProxyUtils.js";
|
|
9
|
+
|
|
9
10
|
//#region src/core/variable/tgpuVariable.ts
|
|
10
11
|
/**
|
|
11
12
|
* Defines a variable scoped to each entry function (private).
|
|
@@ -95,5 +96,6 @@ var TgpuVarImpl = class {
|
|
|
95
96
|
this.$ = v;
|
|
96
97
|
}
|
|
97
98
|
};
|
|
99
|
+
|
|
98
100
|
//#endregion
|
|
99
|
-
export { isVariable, privateVar, workgroupVar };
|
|
101
|
+
export { isVariable, privateVar, workgroupVar };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getCustomLocation, isData } from "../../data/dataTypes.js";
|
|
2
2
|
import { isBuiltin } from "../../data/attributes.js";
|
|
3
|
+
|
|
3
4
|
//#region src/core/vertexLayout/connectAttributesToShader.ts
|
|
4
5
|
function isAttribute(value) {
|
|
5
6
|
return typeof value?.format === "string";
|
|
@@ -53,5 +54,6 @@ function connectAttributesToShader(shaderInputLayout, attributes) {
|
|
|
53
54
|
bufferDefinitions
|
|
54
55
|
};
|
|
55
56
|
}
|
|
57
|
+
|
|
56
58
|
//#endregion
|
|
57
|
-
export { connectAttributesToShader, isAttribute };
|
|
59
|
+
export { connectAttributesToShader, isAttribute };
|
|
@@ -4,6 +4,7 @@ import { Decorated, WgslArray, WgslStruct } from "../../data/wgslTypes.js";
|
|
|
4
4
|
import { Disarray, LooseDecorated, Unstruct } from "../../data/dataTypes.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/vertexLayout/vertexAttribute.d.ts
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* The array can hold T, where T is a single/multi-component numeric, or a struct with members of type T.
|
|
9
10
|
* Examples of valid array members:
|
|
@@ -6,6 +6,7 @@ import { getCustomLocation, isLooseDecorated, isUnstruct } from "../../data/data
|
|
|
6
6
|
import { alignmentOf, customAlignmentOf } from "../../data/alignmentOf.js";
|
|
7
7
|
import { roundUp } from "../../mathUtils.js";
|
|
8
8
|
import { sizeOf } from "../../data/sizeOf.js";
|
|
9
|
+
|
|
9
10
|
//#region src/core/vertexLayout/vertexLayout.ts
|
|
10
11
|
function vertexLayout(schemaForCount, stepMode = "vertex") {
|
|
11
12
|
return new TgpuVertexLayoutImpl(schemaForCount, stepMode);
|
|
@@ -23,9 +24,9 @@ function dataToContainedAttribs(layout, data, offset, customLocationMap, key) {
|
|
|
23
24
|
if (isWgslStruct(data)) {
|
|
24
25
|
let memberOffset = offset;
|
|
25
26
|
const propTypes = data.propTypes;
|
|
26
|
-
return Object.fromEntries(Object.entries(propTypes).map(([key, value]) => {
|
|
27
|
+
return Object.fromEntries(Object.entries(propTypes).map(([key$1, value]) => {
|
|
27
28
|
memberOffset = roundUp(memberOffset, alignmentOf(value));
|
|
28
|
-
const attrib = [key, dataToContainedAttribs(layout, value, memberOffset, customLocationMap, key)];
|
|
29
|
+
const attrib = [key$1, dataToContainedAttribs(layout, value, memberOffset, customLocationMap, key$1)];
|
|
29
30
|
memberOffset += sizeOf(value);
|
|
30
31
|
return attrib;
|
|
31
32
|
}));
|
|
@@ -33,9 +34,9 @@ function dataToContainedAttribs(layout, data, offset, customLocationMap, key) {
|
|
|
33
34
|
if (isUnstruct(data)) {
|
|
34
35
|
let memberOffset = offset;
|
|
35
36
|
const propTypes = data.propTypes;
|
|
36
|
-
return Object.fromEntries(Object.entries(propTypes).map(([key, value]) => {
|
|
37
|
+
return Object.fromEntries(Object.entries(propTypes).map(([key$1, value]) => {
|
|
37
38
|
memberOffset = roundUp(memberOffset, customAlignmentOf(value));
|
|
38
|
-
const attrib = [key, dataToContainedAttribs(layout, value, memberOffset, customLocationMap, key)];
|
|
39
|
+
const attrib = [key$1, dataToContainedAttribs(layout, value, memberOffset, customLocationMap, key$1)];
|
|
39
40
|
memberOffset += sizeOf(value);
|
|
40
41
|
return attrib;
|
|
41
42
|
}));
|
|
@@ -99,5 +100,6 @@ var TgpuVertexLayoutImpl = class {
|
|
|
99
100
|
return this;
|
|
100
101
|
}
|
|
101
102
|
};
|
|
103
|
+
|
|
102
104
|
//#endregion
|
|
103
|
-
export { isVertexLayout, vertexLayout };
|
|
105
|
+
export { isVertexLayout, vertexLayout };
|
package/data/alignIO.js
CHANGED
|
@@ -10,5 +10,7 @@ function alignIO(io, baseAlignment) {
|
|
|
10
10
|
if ("skipBytes" in io) io.skipBytes(baseAlignment - offset & bitMask);
|
|
11
11
|
else io.add(baseAlignment - offset & bitMask);
|
|
12
12
|
}
|
|
13
|
+
var alignIO_default = alignIO;
|
|
14
|
+
|
|
13
15
|
//#endregion
|
|
14
|
-
export {
|
|
16
|
+
export { alignIO_default as default };
|
package/data/alignmentOf.d.ts
CHANGED
package/data/alignmentOf.js
CHANGED
|
@@ -2,6 +2,7 @@ import { isDecorated, isWgslArray, isWgslStruct } from "./wgslTypes.js";
|
|
|
2
2
|
import { getCustomAlignment, isDisarray, isLooseDecorated, isUnstruct } from "./dataTypes.js";
|
|
3
3
|
import { safeStringify } from "../shared/stringify.js";
|
|
4
4
|
import { packedFormats } from "./vertexFormatData.js";
|
|
5
|
+
|
|
5
6
|
//#region src/data/alignmentOf.ts
|
|
6
7
|
const knownAlignmentMap = {
|
|
7
8
|
f32: 4,
|
|
@@ -82,5 +83,6 @@ function customAlignmentOf(data) {
|
|
|
82
83
|
function PUBLIC_alignmentOf(schema) {
|
|
83
84
|
return alignmentOf(schema);
|
|
84
85
|
}
|
|
86
|
+
|
|
85
87
|
//#endregion
|
|
86
|
-
export { PUBLIC_alignmentOf, alignmentOf, customAlignmentOf };
|
|
88
|
+
export { PUBLIC_alignmentOf, alignmentOf, customAlignmentOf };
|
package/data/array.js
CHANGED
|
@@ -2,6 +2,7 @@ import { $internal } from "../shared/symbols.js";
|
|
|
2
2
|
import { schemaCallWrapper } from "./schemaCallWrapper.js";
|
|
3
3
|
import { sizeOf } from "./sizeOf.js";
|
|
4
4
|
import { comptime } from "../core/function/comptime.js";
|
|
5
|
+
|
|
5
6
|
//#region src/data/array.ts
|
|
6
7
|
/**
|
|
7
8
|
* Creates an array schema that can be used to construct gpu buffers.
|
|
@@ -42,5 +43,6 @@ const WgslArrayImpl = {
|
|
|
42
43
|
return `arrayOf(${String(this.elementType)}, ${this.elementCount})`;
|
|
43
44
|
}
|
|
44
45
|
};
|
|
46
|
+
|
|
45
47
|
//#endregion
|
|
46
|
-
export { arrayOf };
|
|
48
|
+
export { arrayOf };
|
package/data/atomic.d.ts
CHANGED
package/data/atomic.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { $internal } from "../shared/symbols.js";
|
|
2
|
+
|
|
2
3
|
//#region src/data/atomic.ts
|
|
3
4
|
/**
|
|
4
5
|
* Marks a concrete integer scalar type schema (u32 or i32) as a WGSL atomic.
|
|
@@ -20,5 +21,6 @@ var AtomicImpl = class {
|
|
|
20
21
|
this.inner = inner;
|
|
21
22
|
}
|
|
22
23
|
};
|
|
24
|
+
|
|
23
25
|
//#endregion
|
|
24
|
-
export { atomic };
|
|
26
|
+
export { atomic };
|