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.
- package/README.md +1 -1
- package/builtin-ClEnM-Ye.js +818 -0
- package/builtin-ClEnM-Ye.js.map +1 -0
- package/chunk-BYypO7fO.js +18 -0
- package/common/index.d.ts +8 -23
- package/common/index.d.ts.map +1 -0
- package/common/index.js +7 -5
- package/common/index.js.map +1 -1
- package/data/index.d.ts +7 -401
- package/data/index.d.ts.map +1 -0
- package/data/index.js +164 -1
- package/data/index.js.map +1 -1
- package/deepEqual-yZXvaV2C.js +413 -0
- package/deepEqual-yZXvaV2C.js.map +1 -0
- package/extensions-0SFbU9FH.js +2032 -0
- package/extensions-0SFbU9FH.js.map +1 -0
- package/fullScreenTriangle-MdLGaAMR.js +543 -0
- package/fullScreenTriangle-MdLGaAMR.js.map +1 -0
- package/index.d.ts +124 -310
- package/index.d.ts.map +1 -0
- package/index.js +6282 -153
- package/index.js.map +1 -1
- package/indexNamedExports-Cdy7USiY.d.ts +5696 -0
- package/indexNamedExports-Cdy7USiY.d.ts.map +1 -0
- package/operators-HTxa_0k9.js +4156 -0
- package/operators-HTxa_0k9.js.map +1 -0
- package/package.json +3 -2
- package/std/index.d.ts +7 -621
- package/std/index.d.ts.map +1 -0
- package/std/index.js +165 -1
- package/std/index.js.map +1 -1
- package/texture-Dg5ybJro.js +205 -0
- package/texture-Dg5ybJro.js.map +1 -0
- package/chunk-5ABKYSJD.js +0 -2
- package/chunk-5ABKYSJD.js.map +0 -1
- package/chunk-D5UYO3OX.js +0 -3
- package/chunk-D5UYO3OX.js.map +0 -1
- package/chunk-EHLRP4V2.js +0 -2
- package/chunk-EHLRP4V2.js.map +0 -1
- package/chunk-LMPPDGRD.js +0 -2
- package/chunk-LMPPDGRD.js.map +0 -1
- package/chunk-MBB2XFH6.js +0 -2
- package/chunk-MBB2XFH6.js.map +0 -1
- package/chunk-SHSILTWI.js +0 -10
- package/chunk-SHSILTWI.js.map +0 -1
- package/comptime-DKpw1IVu.d.ts +0 -28
- package/matrix-C4IFKU1R.d.ts +0 -123
- package/tgpuConstant-BOn7U_lv.d.ts +0 -4031
package/index.d.ts
CHANGED
|
@@ -1,116 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import 'tinyest';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Extra declaration that will be included in final WGSL code
|
|
9
|
-
* when resolving objects that use it.
|
|
10
|
-
*/
|
|
11
|
-
interface TgpuRawCodeSnippet<TDataType extends AnyData> {
|
|
12
|
-
$: InferGPU<TDataType>;
|
|
13
|
-
value: InferGPU<TDataType>;
|
|
14
|
-
$uses(dependencyMap: Record<string, unknown>): this;
|
|
15
|
-
}
|
|
16
|
-
type RawCodeSnippetOrigin = Exclude<Origin, 'function' | 'this-function' | 'argument' | 'constant-ref'>;
|
|
17
|
-
/**
|
|
18
|
-
* An advanced API that creates a typed shader expression which
|
|
19
|
-
* can be injected into the final shader bundle upon use.
|
|
20
|
-
*
|
|
21
|
-
* @param expression The code snippet that will be injected in place of `foo.$`
|
|
22
|
-
* @param type The type of the expression
|
|
23
|
-
* @param [origin='runtime'] Where the value originates from.
|
|
24
|
-
*
|
|
25
|
-
* **-- Which origin to choose?**
|
|
26
|
-
*
|
|
27
|
-
* Usually 'runtime' (the default) is a safe bet, but if you're sure that the expression or
|
|
28
|
-
* computation is constant (either a reference to a constant, a numeric literal,
|
|
29
|
-
* or an operation on constants), then pass 'constant' as it might lead to better
|
|
30
|
-
* optimizations.
|
|
31
|
-
*
|
|
32
|
-
* If what the expression is a direct reference to an existing value (e.g. a uniform, a
|
|
33
|
-
* storage binding, ...), then choose from 'uniform', 'mutable', 'readonly', 'workgroup',
|
|
34
|
-
* 'private' or 'handle' depending on the address space of the referred value.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* // An identifier that we know will be in the
|
|
39
|
-
* // final shader bundle, but we cannot
|
|
40
|
-
* // refer to it in any other way.
|
|
41
|
-
* const existingGlobal = tgpu['~unstable']
|
|
42
|
-
* .rawCodeSnippet('EXISTING_GLOBAL', d.f32, 'constant');
|
|
43
|
-
*
|
|
44
|
-
* const foo = () => {
|
|
45
|
-
* 'use gpu';
|
|
46
|
-
* return existingGlobal.$ * 2;
|
|
47
|
-
* };
|
|
48
|
-
*
|
|
49
|
-
* const wgsl = tgpu.resolve([foo]);
|
|
50
|
-
* // fn foo() -> f32 {
|
|
51
|
-
* // return EXISTING_GLOBAL * 2;
|
|
52
|
-
* // }
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare function rawCodeSnippet<TDataType extends AnyData>(expression: string, type: TDataType, origin?: RawCodeSnippetOrigin | undefined): TgpuRawCodeSnippet<TDataType>;
|
|
56
|
-
|
|
57
|
-
interface NameRegistry {
|
|
58
|
-
/**
|
|
59
|
-
* Creates a valid WGSL identifier, each guaranteed to be unique
|
|
60
|
-
* in the lifetime of a single resolution process.
|
|
61
|
-
* Should append "_" to primer, followed by some id.
|
|
62
|
-
* @param primer Used in the generation process, makes the identifier more recognizable.
|
|
63
|
-
* @param global Whether the name should be registered in the global scope (true), or in the current function scope (false)
|
|
64
|
-
*/
|
|
65
|
-
makeUnique(primer: string | undefined, global: boolean): string;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a valid WGSL identifier.
|
|
68
|
-
* Renames identifiers that are WGSL reserved words.
|
|
69
|
-
* @param primer Used in the generation process.
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* makeValid("notAKeyword"); // "notAKeyword"
|
|
73
|
-
* makeValid("struct"); // makeUnique("struct")
|
|
74
|
-
* makeValid("struct_1"); // makeUnique("struct_1") (to avoid potential name collisions)
|
|
75
|
-
* makeValid("_"); // ERROR (too difficult to make valid to care)
|
|
76
|
-
*/
|
|
77
|
-
makeValid(primer: string): string;
|
|
78
|
-
pushFunctionScope(): void;
|
|
79
|
-
popFunctionScope(): void;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
type SlotToValueMap = Map<TgpuSlot<unknown>, unknown>;
|
|
83
|
-
interface NamespaceInternal {
|
|
84
|
-
readonly nameRegistry: NameRegistry;
|
|
85
|
-
readonly shelllessRepo: ShelllessRepository;
|
|
86
|
-
memoizedResolves: WeakMap<object, {
|
|
87
|
-
slotToValueMap: SlotToValueMap;
|
|
88
|
-
result: ResolvedSnippet;
|
|
89
|
-
}[]>;
|
|
90
|
-
memoizedDerived: WeakMap<TgpuDerived<unknown>, {
|
|
91
|
-
slotToValueMap: SlotToValueMap;
|
|
92
|
-
result: unknown;
|
|
93
|
-
}[]>;
|
|
94
|
-
listeners: {
|
|
95
|
-
[K in keyof NamespaceEventMap]: Set<(event: NamespaceEventMap[K]) => void>;
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
type NamespaceEventMap = {
|
|
99
|
-
'name': {
|
|
100
|
-
target: object;
|
|
101
|
-
name: string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
type DetachListener = () => void;
|
|
105
|
-
interface Namespace {
|
|
106
|
-
readonly [$internal]: NamespaceInternal;
|
|
107
|
-
on<TEvent extends keyof NamespaceEventMap>(event: TEvent, listener: (event: NamespaceEventMap[TEvent]) => void): DetachListener;
|
|
108
|
-
}
|
|
109
|
-
interface NamespaceOptions {
|
|
110
|
-
names?: 'random' | 'strict' | undefined;
|
|
111
|
-
}
|
|
112
|
-
declare function namespace(options?: NamespaceOptions | undefined): Namespace;
|
|
1
|
+
import { $o as TgpuLayoutComparisonSampler, $r as comptime, Ac as TgpuComputePipeline, Al as Storage, Ao as UniformFlag, Bc as isSlot, Bo as ValidateStorageSchema, Cc as TgpuFragmentFnShell, Co as fn, Dc as AutoFragmentOut, Do as IndexFlag, Ec as AutoFragmentIn, Eo as declare, Fc as TgpuMutableAccessor, Fo as isUsableAsVertex, Gc as workgroupVar, Go as WithVertex, Gr as rawCodeSnippet, Hc as VariableScope, Ho as WithBinding, Ic as TgpuSlot, Io as Configurable, Jc as computeFn, Jo as BindLayoutEntry, Jr as init, Kc as TgpuComputeFn, Ko as Withable, Kr as InitFromDeviceOptions, Lc as isAccessor, Ll as $internal, Lo as TgpuGuardedComputePipeline, Mc as Eventual, Ml as isUsableAsStorage, Mo as Vertex, Nc as TgpuAccessor, No as VertexFlag, Oc as AutoVertexIn, Oo as TgpuBuffer, Pc as TgpuLazy, Po as isBuffer, Qo as TgpuBindGroupLayout, Qr as TgpuComptime, Rc as isLazy, Rl as INTERNAL_GlobalExt, Ro as TgpuRoot, Sc as TgpuFragmentFn, So as TgpuGenericFn, Tc as isTgpuFragmentFn, To as TgpuDeclare, Uc as isVariable, Uo as WithCompute, Ur as RawCodeSnippetOrigin, Vc as TgpuVar, Vo as ValidateUniformSchema, Wc as privateVar, Wo as WithFragment, Wr as TgpuRawCodeSnippet, Xo as LayoutEntryToInput, Xr as Namespace, Yc as isTgpuComputeFn, Yo as ExtractBindGroupInputFromLayout, Yr as initFromDevice, Zo as TgpuBindGroup, Zr as namespace, _c as TextureProps, _i as isTexture, _o as ResolvableObject, _s as TgpuVertexLayout, a as MissingVertexBuffersError, al as LogResources, as as TgpuLayoutUniform, bc as isTgpuVertexFn, bo as TgpuFn, cl as TgpuUniform, cs as TgpuComparisonSampler, dl as TgpuBufferReadonly, ds as TgpuSampler, ei as TgpuConst, es as TgpuLayoutEntry, fl as TgpuBufferUniform, fs as isComparisonSampler, gc as isUsableAsSampled, gi as TgpuTextureView, go as GPUCallable, gs as TgpuRenderPipeline, hc as isUsableAsRender, hi as TgpuTexture, hs as TgpuPrimitiveState, i as MissingSlotValueError, is as TgpuLayoutTexture, jl as StorageFlag, jo as ValidUsagesFor, kc as AutoVertexOut, ko as Uniform, ll as isBufferShorthand, ls as TgpuFixedComparisonSampler, mc as SampledFlag, ml as TgpuQuerySet, ms as ColorAttachment, n as MissingBindGroupsError, ni as AnyData, ns as TgpuLayoutSampler, o as NotUniformError, oa as BaseData, ol as TgpuMutable, os as UnwrapRuntimeConstructor, pc as RenderFlag, pl as isUsableAsUniform, ps as isSampler, qc as TgpuComputeFnShell, qo as ShaderGenerator, qr as InitOptions, r as MissingLinksError, rs as TgpuLayoutStorage, s as ResolutionError, sl as TgpuReadonly, ss as bindGroupLayout, t as TgpuRenderPipelineDescriptor, ti as constant, ts as TgpuLayoutExternalTexture, ul as TgpuBufferMutable, us as TgpuFixedSampler, vc as TgpuVertexFn, vo as Wgsl, vs as vertexLayout, wc as fragmentFn, wo as isTgpuFn, xc as vertexFn, xo as TgpuFnShell, yc as TgpuVertexFnShell, yo as WgslExtension, zc as isMutableAccessor, zo as ValidateBufferSchema } from "./indexNamedExports-Cdy7USiY.js";
|
|
2
|
+
import { t as index_d_exports$1 } from "./data/index.js";
|
|
3
|
+
import { t as index_d_exports$2 } from "./std/index.js";
|
|
4
|
+
import { t as index_d_exports } from "./common/index.js";
|
|
113
5
|
|
|
6
|
+
//#region src/resolutionCtx.d.ts
|
|
114
7
|
/**
|
|
115
8
|
* The results of a WGSL resolution.
|
|
116
9
|
*
|
|
@@ -120,50 +13,51 @@ declare function namespace(options?: NamespaceOptions | undefined): Namespace;
|
|
|
120
13
|
* @param logResources - Buffers and information about used console.logs needed to decode the raw data.
|
|
121
14
|
*/
|
|
122
15
|
interface ResolutionResult {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
16
|
+
code: string;
|
|
17
|
+
usedBindGroupLayouts: TgpuBindGroupLayout[];
|
|
18
|
+
catchall: [number, TgpuBindGroup] | undefined;
|
|
19
|
+
logResources: LogResources | undefined;
|
|
127
20
|
}
|
|
128
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/core/resolve/tgpuResolve.d.ts
|
|
129
23
|
interface TgpuResolveOptions {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The naming strategy used for generating identifiers for resolved externals and their dependencies.
|
|
26
|
+
*
|
|
27
|
+
* ## Namespaces
|
|
28
|
+
* Each call to `tgpu.resolve` uses it's own namespace by default, but a
|
|
29
|
+
* custom namespace can be created with `tgpu.namespace` and passed in.
|
|
30
|
+
*
|
|
31
|
+
* This allows tracking the behavior of the resolution process, as well as
|
|
32
|
+
* sharing state between calls to `tgpu.resolve`.
|
|
33
|
+
*
|
|
34
|
+
* @default 'random'
|
|
35
|
+
*/
|
|
36
|
+
names?: 'strict' | 'random' | Namespace | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* A function to configure the resolution context.
|
|
39
|
+
*/
|
|
40
|
+
config?: ((cfg: Configurable) => Configurable) | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* List of WGSL shader extensions to enable.
|
|
43
|
+
*/
|
|
44
|
+
enableExtensions?: WgslExtension[] | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* A custom shader code generator, used when resolving TypeGPU functions.
|
|
47
|
+
* If not provided, the default WGSL generator will be used.
|
|
48
|
+
*/
|
|
49
|
+
shaderGenerator?: ShaderGenerator | undefined;
|
|
156
50
|
}
|
|
157
51
|
interface TgpuExtendedResolveOptions extends TgpuResolveOptions {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Map of external names to their resolvable values.
|
|
54
|
+
*/
|
|
55
|
+
externals: Record<string, Wgsl | object>;
|
|
56
|
+
/**
|
|
57
|
+
* The code template to use for the resolution. All external names will be replaced with their resolved values.
|
|
58
|
+
* @default ''
|
|
59
|
+
*/
|
|
60
|
+
template?: string | undefined;
|
|
167
61
|
}
|
|
168
62
|
/**
|
|
169
63
|
* Resolves a template with external values. Each external that is used will get resolved to a code string and replaced in the template.
|
|
@@ -267,12 +161,31 @@ declare function resolveWithContext(items: ResolvableObject[], options?: TgpuRes
|
|
|
267
161
|
*/
|
|
268
162
|
declare function resolve(options: TgpuExtendedResolveOptions): string;
|
|
269
163
|
declare function resolve(items: ResolvableObject[], options?: TgpuResolveOptions): string;
|
|
270
|
-
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/core/slot/slot.d.ts
|
|
166
|
+
declare function slot<T>(defaultValue?: T): TgpuSlot<T>;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/core/slot/lazy.d.ts
|
|
169
|
+
declare function lazy<T>(compute: () => T): TgpuLazy<T>;
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/core/slot/accessor.d.ts
|
|
172
|
+
declare function accessor<T extends AnyData | ((count: number) => AnyData)>(schemaOrConstructor: T, defaultValue?: TgpuAccessor.In<NoInfer<T>>): TgpuAccessor<UnwrapRuntimeConstructor<T>>;
|
|
173
|
+
declare function mutableAccessor<T extends AnyData | ((count: number) => AnyData)>(schemaOrConstructor: T, defaultValue?: TgpuMutableAccessor.In<NoInfer<T>>): TgpuMutableAccessor<UnwrapRuntimeConstructor<T>>;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/core/unroll/tgpuUnroll.d.ts
|
|
176
|
+
/**
|
|
177
|
+
* Marks an iterable to be unrolled by the wgslGenerator.
|
|
178
|
+
*/
|
|
179
|
+
declare const unroll: (<T extends Iterable<unknown>>(value: T) => T) & GPUCallable<[value: Iterable<unknown>]> & {
|
|
180
|
+
[$internal]: true;
|
|
181
|
+
};
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/core/simulate/tgpuSimulate.d.ts
|
|
271
184
|
interface SimulationResult<T> {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
185
|
+
value: T;
|
|
186
|
+
buffers: Map<TgpuBuffer<BaseData>, unknown>;
|
|
187
|
+
privateVars: Map<TgpuVar<'private'>, unknown>[][][];
|
|
188
|
+
workgroupVars: Map<TgpuVar<'workgroup'>, unknown>[][][];
|
|
276
189
|
}
|
|
277
190
|
/**
|
|
278
191
|
* Runs the provided callback in a simulated environment, giving
|
|
@@ -297,162 +210,63 @@ interface SimulationResult<T> {
|
|
|
297
210
|
* console.log(result.value); // 3
|
|
298
211
|
*/
|
|
299
212
|
declare function simulate<T>(callback: () => T): SimulationResult<T>;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
* Options passed into {@link init}.
|
|
303
|
-
*/
|
|
304
|
-
type InitOptions = {
|
|
305
|
-
adapter?: GPURequestAdapterOptions | undefined;
|
|
306
|
-
device?: GPUDeviceDescriptor & {
|
|
307
|
-
optionalFeatures?: Iterable<GPUFeatureName>;
|
|
308
|
-
} | undefined;
|
|
309
|
-
/** @default 'random' */
|
|
310
|
-
unstable_names?: 'random' | 'strict' | undefined;
|
|
311
|
-
/**
|
|
312
|
-
* A custom shader code generator, used when resolving TGSL.
|
|
313
|
-
* If not provided, the default WGSL generator will be used.
|
|
314
|
-
*/
|
|
315
|
-
shaderGenerator?: ShaderGenerator | undefined;
|
|
316
|
-
unstable_logOptions?: LogGeneratorOptions;
|
|
317
|
-
};
|
|
318
|
-
/**
|
|
319
|
-
* Options passed into {@link initFromDevice}.
|
|
320
|
-
*/
|
|
321
|
-
type InitFromDeviceOptions = {
|
|
322
|
-
device: GPUDevice;
|
|
323
|
-
/** @default 'random' */
|
|
324
|
-
unstable_names?: 'random' | 'strict' | undefined;
|
|
325
|
-
/**
|
|
326
|
-
* A custom shader code generator, used when resolving TGSL.
|
|
327
|
-
* If not provided, the default WGSL generator will be used.
|
|
328
|
-
*/
|
|
329
|
-
shaderGenerator?: ShaderGenerator | undefined;
|
|
330
|
-
unstable_logOptions?: LogGeneratorOptions;
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* Requests a new GPU device and creates a root around it.
|
|
334
|
-
* If a specific device should be used instead, use @see initFromDevice.
|
|
335
|
-
*
|
|
336
|
-
* @example
|
|
337
|
-
* When given no options, the function will ask the browser for a suitable GPU device.
|
|
338
|
-
* ```ts
|
|
339
|
-
* const root = await tgpu.init();
|
|
340
|
-
* ```
|
|
341
|
-
*
|
|
342
|
-
* @example
|
|
343
|
-
* If there are specific options that should be used when requesting a device, you can pass those in.
|
|
344
|
-
* ```ts
|
|
345
|
-
* const adapterOptions: GPURequestAdapterOptions = ...;
|
|
346
|
-
* const deviceDescriptor: GPUDeviceDescriptor = ...;
|
|
347
|
-
* const root = await tgpu.init({ adapter: adapterOptions, device: deviceDescriptor });
|
|
348
|
-
* ```
|
|
349
|
-
*/
|
|
350
|
-
declare function init(options?: InitOptions): Promise<TgpuRoot>;
|
|
351
|
-
/**
|
|
352
|
-
* Creates a root from the given device, instead of requesting it like @see init.
|
|
353
|
-
*
|
|
354
|
-
* @example
|
|
355
|
-
* ```ts
|
|
356
|
-
* const device: GPUDevice = ...;
|
|
357
|
-
* const root = tgpu.initFromDevice({ device });
|
|
358
|
-
* ```
|
|
359
|
-
*/
|
|
360
|
-
declare function initFromDevice(options: InitFromDeviceOptions): TgpuRoot;
|
|
361
|
-
|
|
362
|
-
declare function accessor<T extends AnyWgslData>(schema: T, defaultValue?: TgpuFn<() => T> | TgpuBufferUsage<T> | TgpuBufferShorthand<T> | Infer<T>): TgpuAccessor<T>;
|
|
363
|
-
|
|
364
|
-
declare function derived<T>(compute: () => T): TgpuDerived<T>;
|
|
365
|
-
|
|
366
|
-
declare function slot<T>(defaultValue?: T): TgpuSlot<T>;
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* An error that happens during resolution of WGSL code.
|
|
370
|
-
* Contains a trace of all ancestor resolvables in
|
|
371
|
-
* which this error originated.
|
|
372
|
-
*
|
|
373
|
-
* @category Errors
|
|
374
|
-
*/
|
|
375
|
-
declare class ResolutionError extends Error {
|
|
376
|
-
readonly cause: unknown;
|
|
377
|
-
readonly trace: unknown[];
|
|
378
|
-
constructor(cause: unknown, trace: unknown[]);
|
|
379
|
-
appendToTrace(ancestor: unknown): ResolutionError;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* @category Errors
|
|
383
|
-
*/
|
|
384
|
-
declare class MissingSlotValueError extends Error {
|
|
385
|
-
readonly slot: TgpuSlot<unknown>;
|
|
386
|
-
constructor(slot: TgpuSlot<unknown>);
|
|
213
|
+
declare namespace tgpuUnstable_d_exports {
|
|
214
|
+
export { _accessor as accessor, _comptime as comptime, _computeFn as computeFn, _constant as const, declare, _lazy as derived, _fn as fn, _fragmentFn as fragmentFn, _mutableAccessor as mutableAccessor, namespace, _privateVar as privateVar, rawCodeSnippet, simulate, _slot as slot, _vertexFn as vertexFn, _vertexLayout as vertexLayout, _workgroupVar as workgroupVar };
|
|
387
215
|
}
|
|
388
|
-
/**
|
|
389
|
-
|
|
390
|
-
*/
|
|
391
|
-
declare
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
declare
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
216
|
+
/** @deprecated This feature is now stable, use tgpu.const. */
|
|
217
|
+
declare const _constant: typeof constant;
|
|
218
|
+
/** @deprecated This feature is now stable, use tgpu.comptime. */
|
|
219
|
+
declare const _comptime: typeof comptime;
|
|
220
|
+
/** @deprecated This feature is now stable, use tgpu.computeFn. */
|
|
221
|
+
declare const _computeFn: typeof computeFn;
|
|
222
|
+
/** @deprecated This feature is now stable, use tgpu.fn. */
|
|
223
|
+
declare const _fn: typeof fn;
|
|
224
|
+
/** @deprecated This feature is now stable, use tgpu.fragmentFn. */
|
|
225
|
+
declare const _fragmentFn: typeof fragmentFn;
|
|
226
|
+
/** @deprecated This feature is now stable, use tgpu.vertexFn. */
|
|
227
|
+
declare const _vertexFn: typeof vertexFn;
|
|
228
|
+
/** @deprecated This feature is now stable, use tgpu.accessor. */
|
|
229
|
+
declare const _accessor: typeof accessor;
|
|
230
|
+
/** @deprecated This feature is now stable, use tgpu.mutableAccessor. */
|
|
231
|
+
declare const _mutableAccessor: typeof mutableAccessor;
|
|
232
|
+
/** @deprecated This feature is now stable, use tgpu.lazy. */
|
|
233
|
+
declare const _lazy: typeof lazy;
|
|
234
|
+
/** @deprecated This feature is now stable, use tgpu.slot. */
|
|
235
|
+
declare const _slot: typeof slot;
|
|
236
|
+
/** @deprecated This feature is now stable, use tgpu.privateVar. */
|
|
237
|
+
declare const _privateVar: typeof privateVar;
|
|
238
|
+
/** @deprecated This feature is now stable, use tgpu.workgroupVar. */
|
|
239
|
+
declare const _workgroupVar: typeof workgroupVar;
|
|
240
|
+
/** @deprecated This feature is now stable, use tgpu.vertexLayout. */
|
|
241
|
+
declare const _vertexLayout: typeof vertexLayout;
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/index.d.ts
|
|
404
244
|
/**
|
|
405
245
|
* @module typegpu
|
|
406
246
|
*/
|
|
407
|
-
|
|
247
|
+
// NOTE: This is a barrel file, internal files should not import things from this file
|
|
408
248
|
declare const tgpu: {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* @deprecated This feature is now stable, use tgpu.vertexLayout.
|
|
431
|
-
*/
|
|
432
|
-
vertexLayout: typeof vertexLayout;
|
|
433
|
-
namespace: typeof namespace;
|
|
434
|
-
derived: typeof derived;
|
|
435
|
-
/**
|
|
436
|
-
* @deprecated This feature is now stable, use tgpu.slot.
|
|
437
|
-
*/
|
|
438
|
-
slot: typeof slot;
|
|
439
|
-
accessor: typeof accessor;
|
|
440
|
-
/**
|
|
441
|
-
* @deprecated This feature is now stable, use tgpu.privateVar.
|
|
442
|
-
*/
|
|
443
|
-
privateVar: typeof privateVar;
|
|
444
|
-
/**
|
|
445
|
-
* @deprecated This feature is now stable, use tgpu.workgroupVar.
|
|
446
|
-
*/
|
|
447
|
-
workgroupVar: typeof workgroupVar;
|
|
448
|
-
/**
|
|
449
|
-
* @deprecated This feature is now stable, use tgpu.const.
|
|
450
|
-
*/
|
|
451
|
-
const: typeof constant;
|
|
452
|
-
declare: typeof declare;
|
|
453
|
-
rawCodeSnippet: typeof rawCodeSnippet;
|
|
454
|
-
simulate: typeof simulate;
|
|
455
|
-
};
|
|
249
|
+
const: typeof constant;
|
|
250
|
+
fn: typeof fn;
|
|
251
|
+
comptime: typeof comptime;
|
|
252
|
+
resolve: typeof resolve;
|
|
253
|
+
resolveWithContext: typeof resolveWithContext;
|
|
254
|
+
init: typeof init;
|
|
255
|
+
initFromDevice: typeof initFromDevice;
|
|
256
|
+
slot: typeof slot;
|
|
257
|
+
lazy: typeof lazy;
|
|
258
|
+
accessor: typeof accessor;
|
|
259
|
+
mutableAccessor: typeof mutableAccessor;
|
|
260
|
+
privateVar: typeof privateVar;
|
|
261
|
+
workgroupVar: typeof workgroupVar;
|
|
262
|
+
vertexLayout: typeof vertexLayout;
|
|
263
|
+
bindGroupLayout: typeof bindGroupLayout;
|
|
264
|
+
computeFn: typeof computeFn;
|
|
265
|
+
fragmentFn: typeof fragmentFn;
|
|
266
|
+
vertexFn: typeof vertexFn;
|
|
267
|
+
unroll: typeof unroll;
|
|
268
|
+
'~unstable': typeof tgpuUnstable_d_exports;
|
|
456
269
|
};
|
|
457
|
-
|
|
458
|
-
export { Configurable,
|
|
270
|
+
//#endregion
|
|
271
|
+
export { AutoFragmentIn, AutoFragmentOut, AutoVertexIn, AutoVertexOut, BindLayoutEntry, ColorAttachment, Configurable, Eventual, ExtractBindGroupInputFromLayout, INTERNAL_GlobalExt, IndexFlag, InitFromDeviceOptions, InitOptions, LayoutEntryToInput, MissingBindGroupsError, MissingLinksError, MissingSlotValueError, MissingVertexBuffersError, Namespace, NotUniformError, RawCodeSnippetOrigin, RenderFlag, ResolutionError, SampledFlag, Storage, StorageFlag, TextureProps, TgpuAccessor, TgpuBindGroup, TgpuBindGroupLayout, TgpuBuffer, TgpuBufferMutable, TgpuBufferReadonly, TgpuBufferUniform, TgpuComparisonSampler, TgpuComptime, TgpuComputeFn, TgpuComputeFnShell, TgpuComputePipeline, TgpuConst, TgpuDeclare, TgpuFixedComparisonSampler, TgpuFixedSampler, TgpuFn, TgpuFnShell, TgpuFragmentFn, TgpuFragmentFnShell, TgpuGenericFn, TgpuGuardedComputePipeline, TgpuLayoutComparisonSampler, TgpuLayoutEntry, TgpuLayoutExternalTexture, TgpuLayoutSampler, TgpuLayoutStorage, TgpuLayoutTexture, TgpuLayoutUniform, TgpuLazy, TgpuMutable, TgpuMutableAccessor, TgpuPrimitiveState, TgpuQuerySet, TgpuRawCodeSnippet, TgpuReadonly, TgpuRenderPipeline, TgpuRenderPipelineDescriptor, TgpuRoot, TgpuSampler, TgpuSlot, TgpuTexture, TgpuTextureView, TgpuUniform, TgpuVar, TgpuVertexFn, TgpuVertexFnShell, TgpuVertexLayout, Uniform, UniformFlag, ValidUsagesFor, ValidateBufferSchema, ValidateStorageSchema, ValidateUniformSchema, VariableScope, Vertex, VertexFlag, WithBinding, WithCompute, WithFragment, WithVertex, Withable, index_d_exports as common, index_d_exports$1 as d, tgpu as default, tgpu, isAccessor, isBuffer, isBufferShorthand, isComparisonSampler, isLazy, isMutableAccessor, isSampler, isSlot, isTexture, isTgpuComputeFn, isTgpuFn, isTgpuFragmentFn, isTgpuVertexFn, isUsableAsRender, isUsableAsSampled, isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, isVariable, index_d_exports$2 as std };
|
|
272
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["__core_function_tgpuFn_ts0","__core_function_comptime_ts0","__core_resolve_tgpuResolve_ts0","__core_root_init_ts0","__core_slot_slot_ts0","__core_slot_lazy_ts0","__core_slot_accessor_ts0","__core_variable_tgpuVariable_ts0","__core_vertexLayout_vertexLayout_ts0","__tgpuBindGroupLayout_ts0","__core_function_tgpuComputeFn_ts0","__core_function_tgpuFragmentFn_ts0","__core_function_tgpuVertexFn_ts0","__core_unroll_tgpuUnroll_ts0","__tgpuUnstable_ts0","tgpu","__core_constant_tgpuConstant_ts0","constant","fn","comptime","resolve","resolveWithContext","init","initFromDevice","slot","lazy","accessor","mutableAccessor","privateVar","workgroupVar","vertexLayout","bindGroupLayout","computeFn","fragmentFn","vertexFn","unroll","const","default"],"sources":["../src/resolutionCtx.ts","../src/core/resolve/tgpuResolve.ts","../src/core/slot/slot.ts","../src/core/slot/lazy.ts","../src/core/slot/accessor.ts","../src/core/unroll/tgpuUnroll.ts","../src/core/simulate/tgpuSimulate.ts","../src/tgpuUnstable.ts","../src/index.d.ts"],"mappings":";;;;;;;;;;;;;;UAs+BiB,gBAAA;EACf,IAAA;EACA,oBAAA,EAAsB,mBAAA;EACtB,QAAA,WAAmB,aAAA;EACnB,YAAA,EAAc,YAAA;AAAA;;;UC19BC,kBAAA;EDs9BA;;;;;;;;;;;;ECz8Bf,KAAA,yBAA8B,SAAA;ED68B9B;;;ECz8BA,MAAA,KAAW,GAAA,EAAK,YAAA,KAAiB,YAAA;;;;EAIjC,gBAAA,GAAmB,aAAA;EArBc;;;;EA0BjC,eAAA,GAAkB,eAAA;AAAA;AAAA,UAGH,0BAAA,SAAmC,kBAAA;EAHjB;;;EAOjC,SAAA,EAAW,MAAA,SAAe,IAAA;EAhB1B;;;;EAqBA,QAAA;AAAA;;;;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