typegpu 0.10.2 → 0.11.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/_virtual/_rolldown/runtime.js +6 -11
  2. package/builtin.js +1 -3
  3. package/common/fullScreenTriangle.d.ts +1 -5
  4. package/common/fullScreenTriangle.js +1 -3
  5. package/common/index.d.ts +3 -2
  6. package/common/index.js +6 -4
  7. package/common/writeSoA.d.ts +16 -0
  8. package/common/writeSoA.js +90 -0
  9. package/core/buffer/buffer.d.ts +12 -7
  10. package/core/buffer/buffer.js +102 -53
  11. package/core/buffer/bufferShorthand.d.ts +5 -5
  12. package/core/buffer/bufferShorthand.js +9 -5
  13. package/core/buffer/bufferUsage.d.ts +0 -2
  14. package/core/buffer/bufferUsage.js +6 -4
  15. package/core/constant/tgpuConstant.d.ts +2 -1
  16. package/core/constant/tgpuConstant.js +8 -7
  17. package/core/declare/tgpuDeclare.js +8 -9
  18. package/core/function/autoIO.d.ts +7 -6
  19. package/core/function/autoIO.js +1 -3
  20. package/core/function/comptime.js +1 -3
  21. package/core/function/createCallableSchema.js +4 -6
  22. package/core/function/dualImpl.js +1 -3
  23. package/core/function/entryInputRouter.js +39 -0
  24. package/core/function/extractArgs.js +2 -2
  25. package/core/function/fnCore.js +19 -8
  26. package/core/function/fnTypes.d.ts +14 -8
  27. package/core/function/ioSchema.js +24 -3
  28. package/core/function/shelllessImpl.js +1 -3
  29. package/core/function/templateUtils.js +1 -2
  30. package/core/function/tgpuComputeFn.d.ts +2 -3
  31. package/core/function/tgpuComputeFn.js +9 -16
  32. package/core/function/tgpuFn.d.ts +2 -2
  33. package/core/function/tgpuFn.js +1 -3
  34. package/core/function/tgpuFragmentFn.d.ts +5 -1
  35. package/core/function/tgpuFragmentFn.js +5 -10
  36. package/core/function/tgpuVertexFn.d.ts +4 -0
  37. package/core/function/tgpuVertexFn.js +6 -12
  38. package/core/pipeline/applyPipelineState.js +1 -3
  39. package/core/pipeline/computePipeline.d.ts +2 -6
  40. package/core/pipeline/computePipeline.js +64 -63
  41. package/core/pipeline/connectAttachmentToShader.js +1 -3
  42. package/core/pipeline/connectTargetsToShader.js +1 -3
  43. package/core/pipeline/limitsOverflow.js +1 -2
  44. package/core/pipeline/pipelineUtils.js +29 -0
  45. package/core/pipeline/renderPipeline.d.ts +23 -5
  46. package/core/pipeline/renderPipeline.js +32 -14
  47. package/core/pipeline/timeable.d.ts +0 -3
  48. package/core/pipeline/timeable.js +3 -9
  49. package/core/pipeline/typeGuards.js +1 -3
  50. package/core/querySet/querySet.d.ts +0 -2
  51. package/core/querySet/querySet.js +37 -36
  52. package/core/rawCodeSnippet/tgpuRawCodeSnippet.js +1 -3
  53. package/core/resolve/externals.d.ts +0 -2
  54. package/core/resolve/externals.js +2 -4
  55. package/core/resolve/namespace.js +1 -3
  56. package/core/resolve/resolveData.js +1 -3
  57. package/core/resolve/stitch.js +1 -3
  58. package/core/resolve/tgpuResolve.d.ts +3 -1
  59. package/core/resolve/tgpuResolve.js +3 -5
  60. package/core/root/configurableImpl.js +2 -3
  61. package/core/root/init.d.ts +0 -5
  62. package/core/root/init.js +35 -28
  63. package/core/root/rootTypes.d.ts +25 -5
  64. package/core/sampler/sampler.d.ts +0 -4
  65. package/core/sampler/sampler.js +3 -3
  66. package/core/simulate/tgpuSimulate.js +1 -3
  67. package/core/slot/accessor.d.ts +0 -4
  68. package/core/slot/accessor.js +1 -3
  69. package/core/slot/internalSlots.js +1 -3
  70. package/core/slot/lazy.js +1 -3
  71. package/core/slot/slot.js +2 -3
  72. package/core/slot/slotTypes.js +1 -3
  73. package/core/texture/externalTexture.d.ts +0 -6
  74. package/core/texture/externalTexture.js +2 -3
  75. package/core/texture/texture.d.ts +0 -4
  76. package/core/texture/texture.js +5 -3
  77. package/core/texture/textureFormats.js +1 -3
  78. package/core/texture/textureUtils.js +1 -3
  79. package/core/texture/usageExtension.js +1 -3
  80. package/core/unroll/tgpuUnroll.d.ts +58 -3
  81. package/core/unroll/tgpuUnroll.js +63 -5
  82. package/core/valueProxyUtils.js +1 -3
  83. package/core/variable/tgpuVariable.js +1 -3
  84. package/core/vertexLayout/connectAttributesToShader.js +1 -3
  85. package/core/vertexLayout/vertexLayout.js +9 -9
  86. package/data/alignIO.js +1 -2
  87. package/data/alignmentOf.d.ts +0 -1
  88. package/data/alignmentOf.js +1 -3
  89. package/data/array.d.ts +1 -3
  90. package/data/array.js +2 -4
  91. package/data/atomic.js +2 -3
  92. package/data/attributes.js +3 -3
  93. package/data/autoStruct.d.ts +1 -3
  94. package/data/autoStruct.js +1 -3
  95. package/data/compiledIO.js +83 -86
  96. package/data/dataIO.js +46 -39
  97. package/data/dataTypes.d.ts +7 -7
  98. package/data/dataTypes.js +6 -3
  99. package/data/deepEqual.js +1 -3
  100. package/data/disarray.d.ts +1 -3
  101. package/data/disarray.js +1 -3
  102. package/data/getLongestContiguousPrefix.d.ts +0 -1
  103. package/data/getLongestContiguousPrefix.js +1 -3
  104. package/data/index.d.ts +3 -3
  105. package/data/index.js +10 -3
  106. package/data/isContiguous.d.ts +0 -1
  107. package/data/isContiguous.js +1 -3
  108. package/data/matrix.d.ts +8 -10
  109. package/data/matrix.js +32 -18
  110. package/data/numberOps.js +1 -2
  111. package/data/numeric.js +16 -29
  112. package/data/offsetUtils.d.ts +2 -2
  113. package/data/offsetUtils.js +3 -5
  114. package/data/offsets.js +1 -3
  115. package/data/partialIO.js +84 -39
  116. package/data/ptr.d.ts +0 -1
  117. package/data/ptr.js +1 -3
  118. package/data/ref.d.ts +0 -3
  119. package/data/ref.js +1 -3
  120. package/data/sampler.js +1 -3
  121. package/data/schemaCallWrapper.js +1 -3
  122. package/data/schemaMemoryLayout.js +1 -3
  123. package/data/sizeOf.d.ts +0 -1
  124. package/data/sizeOf.js +1 -3
  125. package/data/snippet.js +12 -3
  126. package/data/struct.js +1 -3
  127. package/data/texture.js +1 -3
  128. package/data/unstruct.js +1 -3
  129. package/data/vector.js +4 -12
  130. package/data/vectorImpl.js +27 -28
  131. package/data/vectorOps.js +20 -3
  132. package/data/vertexFormatData.js +2 -3
  133. package/data/wgslTypes.d.ts +39 -11
  134. package/data/wgslTypes.js +10 -3
  135. package/errors.js +6 -3
  136. package/execMode.js +1 -3
  137. package/extension.js +1 -3
  138. package/getGPUValue.js +1 -3
  139. package/index.d.ts +4 -2
  140. package/index.js +3 -3
  141. package/indexNamedExports.d.ts +3 -1
  142. package/mathUtils.js +1 -2
  143. package/memo.js +8 -8
  144. package/nameRegistry.js +1 -3
  145. package/package.js +2 -3
  146. package/package.json +5 -5
  147. package/resolutionCtx.d.ts +0 -10
  148. package/resolutionCtx.js +84 -18
  149. package/shared/env.js +1 -2
  150. package/shared/generators.js +1 -2
  151. package/shared/meta.js +1 -3
  152. package/shared/repr.d.ts +32 -2
  153. package/shared/stringify.js +1 -3
  154. package/shared/symbols.d.ts +10 -1
  155. package/shared/symbols.js +10 -33
  156. package/shared/utilityTypes.d.ts +6 -2
  157. package/shared/utilityTypes.js +1 -2
  158. package/shared/vertexFormat.js +1 -2
  159. package/std/array.d.ts +1 -1
  160. package/std/array.js +1 -3
  161. package/std/atomic.d.ts +12 -12
  162. package/std/atomic.js +1 -3
  163. package/std/bitcast.d.ts +2 -2
  164. package/std/bitcast.js +1 -3
  165. package/std/boolean.d.ts +30 -16
  166. package/std/boolean.js +37 -12
  167. package/std/derivative.d.ts +9 -9
  168. package/std/derivative.js +1 -3
  169. package/std/discard.d.ts +1 -1
  170. package/std/discard.js +1 -3
  171. package/std/extensions.d.ts +1 -3
  172. package/std/extensions.js +1 -3
  173. package/std/index.d.ts +5 -4
  174. package/std/index.js +8 -5
  175. package/std/matrix.d.ts +5 -5
  176. package/std/matrix.js +1 -3
  177. package/std/numeric.d.ts +78 -132
  178. package/std/numeric.js +1 -3
  179. package/std/operators.d.ts +16 -8
  180. package/std/operators.js +80 -6
  181. package/std/packing.d.ts +4 -4
  182. package/std/packing.js +1 -3
  183. package/std/range.d.ts +24 -0
  184. package/std/range.js +38 -0
  185. package/std/subgroup.d.ts +21 -21
  186. package/std/subgroup.js +1 -3
  187. package/std/texture.d.ts +20 -11
  188. package/std/texture.js +13 -3
  189. package/tgpu.js +1 -3
  190. package/tgpuBindGroupLayout.js +9 -8
  191. package/tgpuUnstable.js +1 -3
  192. package/tgsl/accessIndex.js +2 -4
  193. package/tgsl/accessProp.js +8 -6
  194. package/tgsl/consoleLog/deserializers.js +1 -3
  195. package/tgsl/consoleLog/logGenerator.js +2 -4
  196. package/tgsl/consoleLog/serializers.js +24 -26
  197. package/tgsl/consoleLog/types.d.ts +0 -2
  198. package/tgsl/consoleLog/types.js +1 -2
  199. package/tgsl/conversion.js +1 -3
  200. package/tgsl/forOfUtils.js +35 -9
  201. package/tgsl/generationHelpers.js +3 -3
  202. package/tgsl/math.js +1 -3
  203. package/tgsl/shaderGenerator.d.ts +10 -8
  204. package/tgsl/shaderGenerator_members.d.ts +2 -0
  205. package/tgsl/shaderGenerator_members.js +6 -0
  206. package/tgsl/shellless.js +1 -8
  207. package/tgsl/wgslGenerator.d.ts +36 -0
  208. package/tgsl/wgslGenerator.js +135 -81
  209. package/types.d.ts +14 -4
  210. package/types.js +3 -3
  211. package/wgslExtensions.js +1 -2
@@ -1,15 +1,12 @@
1
1
  import { $internal } from "../../shared/symbols.js";
2
2
  import { isQuerySet } from "../querySet/querySet.js";
3
-
4
3
  //#region src/core/pipeline/timeable.ts
5
- function createWithPerformanceCallback(currentPriors, callback, root) {
6
- if (!root.enabledFeatures.has("timestamp-query")) throw new Error("Performance callback requires the \"timestamp-query\" feature to be enabled on GPU device.");
4
+ function createWithPerformanceCallback(currentPriors, callback, querySet) {
7
5
  if (!currentPriors.timestampWrites) return {
8
6
  ...currentPriors,
9
7
  performanceCallback: callback,
10
- hasAutoQuerySet: true,
11
8
  timestampWrites: {
12
- querySet: root.createQuerySet("timestamp", 2),
9
+ querySet,
13
10
  beginningOfPassWriteIndex: 0,
14
11
  endOfPassWriteIndex: 1
15
12
  }
@@ -21,13 +18,11 @@ function createWithPerformanceCallback(currentPriors, callback, root) {
21
18
  }
22
19
  function createWithTimestampWrites(currentPriors, options, root) {
23
20
  if (!root.enabledFeatures.has("timestamp-query")) throw new Error("Timestamp writes require the \"timestamp-query\" feature to be enabled on GPU device.");
24
- if (currentPriors.hasAutoQuerySet && currentPriors.timestampWrites) currentPriors.timestampWrites.querySet.destroy();
25
21
  const timestampWrites = { querySet: options.querySet };
26
22
  if (options.beginningOfPassWriteIndex !== void 0) timestampWrites.beginningOfPassWriteIndex = options.beginningOfPassWriteIndex;
27
23
  if (options.endOfPassWriteIndex !== void 0) timestampWrites.endOfPassWriteIndex = options.endOfPassWriteIndex;
28
24
  return {
29
25
  ...currentPriors,
30
- hasAutoQuerySet: false,
31
26
  timestampWrites
32
27
  };
33
28
  }
@@ -56,6 +51,5 @@ function triggerPerformanceCallback({ root, priors }) {
56
51
  await callback(start, end);
57
52
  });
58
53
  }
59
-
60
54
  //#endregion
61
- export { createWithPerformanceCallback, createWithTimestampWrites, setupTimestampWrites, triggerPerformanceCallback };
55
+ export { createWithPerformanceCallback, createWithTimestampWrites, setupTimestampWrites, triggerPerformanceCallback };
@@ -1,5 +1,4 @@
1
1
  import { $internal } from "../../shared/symbols.js";
2
-
3
2
  //#region src/core/pipeline/typeGuards.ts
4
3
  function isComputePipeline(value) {
5
4
  const maybe = value;
@@ -24,6 +23,5 @@ function isGPURenderPassEncoder(value) {
24
23
  function isGPURenderBundleEncoder(value) {
25
24
  return !!value && typeof value === "object" && "draw" in value && "finish" in value && !("executeBundles" in value) && !("beginRenderPass" in value) && !("dispatchWorkgroups" in value);
26
25
  }
27
-
28
26
  //#endregion
29
- export { isComputePipeline, isGPUCommandEncoder, isGPUComputePassEncoder, isGPURenderBundleEncoder, isGPURenderPassEncoder, isPipeline, isRenderPipeline };
27
+ export { isComputePipeline, isGPUCommandEncoder, isGPUComputePassEncoder, isGPURenderBundleEncoder, isGPURenderPassEncoder, isPipeline, isRenderPipeline };
@@ -1,7 +1,5 @@
1
1
  import { TgpuNamable } from "../../shared/meta.js";
2
2
  import { $internal } from "../../shared/symbols.js";
3
- import "../root/rootTypes.js";
4
-
5
3
  //#region src/core/querySet/querySet.d.ts
6
4
  interface TgpuQuerySet<T extends GPUQueryType> extends TgpuNamable {
7
5
  readonly resourceType: 'query-set';
@@ -1,6 +1,5 @@
1
1
  import { $internal } from "../../shared/symbols.js";
2
2
  import { setName } from "../../shared/meta.js";
3
-
4
3
  //#region src/core/querySet/querySet.ts
5
4
  function INTERNAL_createQuerySet(group, type, count, rawQuerySet) {
6
5
  return new TgpuQuerySetImpl(group, type, count, rawQuerySet);
@@ -11,71 +10,74 @@ function isQuerySet(value) {
11
10
  }
12
11
  var TgpuQuerySetImpl = class {
13
12
  resourceType = "query-set";
13
+ type;
14
+ count;
15
+ #rawQuerySet;
14
16
  #device;
15
- _querySet = null;
16
- _ownQuerySet;
17
- _destroyed = false;
18
- _available = true;
19
- _readBuffer = null;
20
- _resolveBuffer = null;
17
+ #querySet;
18
+ #ownQuerySet;
19
+ #destroyed = false;
20
+ #available = true;
21
+ #readBuffer = void 0;
22
+ #resolveBuffer = void 0;
21
23
  constructor(root, type, count, rawQuerySet) {
24
+ this.#device = root.device;
22
25
  this.type = type;
23
26
  this.count = count;
24
- this.rawQuerySet = rawQuerySet;
25
- this.#device = root.device;
26
- this._ownQuerySet = !rawQuerySet;
27
- this._querySet = rawQuerySet || null;
27
+ this.#rawQuerySet = rawQuerySet;
28
+ this.#ownQuerySet = !rawQuerySet;
29
+ this.#querySet = rawQuerySet;
28
30
  }
29
31
  get querySet() {
30
- if (this._destroyed) throw new Error("This QuerySet has been destroyed.");
31
- if (this.rawQuerySet) return this.rawQuerySet;
32
- if (this._querySet) return this._querySet;
33
- this._querySet = this.#device.createQuerySet({
32
+ if (this.#destroyed) throw new Error("This QuerySet has been destroyed.");
33
+ if (this.#rawQuerySet) return this.#rawQuerySet;
34
+ if (this.#querySet) return this.#querySet;
35
+ this.#querySet = this.#device.createQuerySet({
34
36
  type: this.type,
35
37
  count: this.count
36
38
  });
37
- return this._querySet;
39
+ return this.#querySet;
38
40
  }
39
41
  get destroyed() {
40
- return this._destroyed;
42
+ return this.#destroyed;
41
43
  }
42
44
  get available() {
43
- return this._available;
45
+ return this.#available;
44
46
  }
45
47
  get [$internal]() {
46
48
  const self = this;
47
49
  return {
48
50
  get readBuffer() {
49
- if (!self._readBuffer) self._readBuffer = self.#device.createBuffer({
51
+ if (!self.#readBuffer) self.#readBuffer = self.#device.createBuffer({
50
52
  size: self.count * BigUint64Array.BYTES_PER_ELEMENT,
51
53
  usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ
52
54
  });
53
- return self._readBuffer;
55
+ return self.#readBuffer;
54
56
  },
55
57
  get resolveBuffer() {
56
- if (!self._resolveBuffer) self._resolveBuffer = self.#device.createBuffer({
58
+ if (!self.#resolveBuffer) self.#resolveBuffer = self.#device.createBuffer({
57
59
  size: self.count * BigUint64Array.BYTES_PER_ELEMENT,
58
60
  usage: GPUBufferUsage.QUERY_RESOLVE | GPUBufferUsage.COPY_SRC
59
61
  });
60
- return self._resolveBuffer;
62
+ return self.#resolveBuffer;
61
63
  }
62
64
  };
63
65
  }
64
66
  $name(label) {
65
67
  setName(this, label);
66
- if (this._querySet) this._querySet.label = label;
68
+ if (this.#querySet) this.#querySet.label = label;
67
69
  return this;
68
70
  }
69
71
  resolve() {
70
- if (this._destroyed) throw new Error("This QuerySet has been destroyed.");
71
- if (!this._available) throw new Error("This QuerySet is busy resolving or reading.");
72
+ if (this.#destroyed) throw new Error("This QuerySet has been destroyed.");
73
+ if (!this.#available) throw new Error("This QuerySet is busy resolving or reading.");
72
74
  const commandEncoder = this.#device.createCommandEncoder();
73
75
  commandEncoder.resolveQuerySet(this.querySet, 0, this.count, this[$internal].resolveBuffer, 0);
74
76
  this.#device.queue.submit([commandEncoder.finish()]);
75
77
  }
76
78
  async read() {
77
- if (!this._resolveBuffer) throw new Error("QuerySet must be resolved before reading.");
78
- this._available = false;
79
+ if (!this.#resolveBuffer) throw new Error("QuerySet must be resolved before reading.");
80
+ this.#available = false;
79
81
  try {
80
82
  const commandEncoder = this.#device.createCommandEncoder();
81
83
  commandEncoder.copyBufferToBuffer(this[$internal].resolveBuffer, 0, this[$internal].readBuffer, 0, this.count * BigUint64Array.BYTES_PER_ELEMENT);
@@ -86,18 +88,17 @@ var TgpuQuerySetImpl = class {
86
88
  readBuffer.unmap();
87
89
  return Array.from(data);
88
90
  } finally {
89
- this._available = true;
91
+ this.#available = true;
90
92
  }
91
93
  }
92
94
  destroy() {
93
- if (this._destroyed) return;
94
- this._destroyed = true;
95
- if (this._querySet && this._ownQuerySet) this._querySet.destroy();
96
- this._readBuffer?.destroy();
97
- this._resolveBuffer?.destroy();
98
- this._readBuffer = this._resolveBuffer = null;
95
+ if (this.#destroyed) return;
96
+ this.#destroyed = true;
97
+ if (this.#querySet && this.#ownQuerySet) this.#querySet.destroy();
98
+ this.#readBuffer?.destroy();
99
+ this.#resolveBuffer?.destroy();
100
+ this.#readBuffer = this.#resolveBuffer = void 0;
99
101
  }
100
102
  };
101
-
102
103
  //#endregion
103
- export { INTERNAL_createQuerySet, isQuerySet };
104
+ export { INTERNAL_createQuerySet, isQuerySet };
@@ -3,7 +3,6 @@ import { snip } from "../../data/snippet.js";
3
3
  import { inCodegenMode } from "../../execMode.js";
4
4
  import { valueProxyHandler } from "../valueProxyUtils.js";
5
5
  import { applyExternals, replaceExternalsInWgsl } from "../resolve/externals.js";
6
-
7
6
  //#region src/core/rawCodeSnippet/tgpuRawCodeSnippet.ts
8
7
  /**
9
8
  * An advanced API that creates a typed shader expression which
@@ -91,6 +90,5 @@ var TgpuRawCodeSnippetImpl = class {
91
90
  return this.$;
92
91
  }
93
92
  };
94
-
95
93
  //#endregion
96
- export { rawCodeSnippet };
94
+ export { rawCodeSnippet };
@@ -1,5 +1,3 @@
1
- import "../../types.js";
2
-
3
1
  //#region src/core/resolve/externals.d.ts
4
2
  /**
5
3
  * A key-value mapping where keys represent identifiers within shader code,
@@ -2,7 +2,6 @@ import { getName, hasTinyestMetadata, setName } from "../../shared/meta.js";
2
2
  import { isWgslStruct } from "../../data/wgslTypes.js";
3
3
  import { isLooseData } from "../../data/dataTypes.js";
4
4
  import { isWgsl } from "../../types.js";
5
-
6
5
  //#region src/core/resolve/externals.ts
7
6
  /**
8
7
  * Merges two external maps into one. If a key is present in both maps, the value from the new map is used.
@@ -43,7 +42,7 @@ function identifierRegex(name) {
43
42
  function replaceExternalsInWgsl(ctx, externalMap, wgsl) {
44
43
  return Object.entries(externalMap).reduce((acc, [externalName, external]) => {
45
44
  const externalRegex = identifierRegex(externalName);
46
- if (wgsl && externalName !== "Out" && externalName !== "In" && !externalRegex.test(wgsl)) console.warn(`The external '${externalName}' wasn't used in the resolved template.`);
45
+ if (wgsl && externalName !== "Out" && externalName !== "in" && !externalRegex.test(wgsl)) console.warn(`The external '${externalName}' wasn't used in the resolved template.`);
47
46
  if (isWgsl(external) || isLooseData(external) || hasTinyestMetadata(external)) return acc.replaceAll(externalRegex, ctx.resolve(external).value);
48
47
  if (external !== null && typeof external === "object") {
49
48
  const foundProperties = [...wgsl.matchAll(new RegExp(`${externalName.replaceAll(".", "\\.").replaceAll("$", "\\$")}\\.(?<prop>.*?)(?![\\w\\$_])`, "g"))].map((found) => found[1]);
@@ -53,6 +52,5 @@ function replaceExternalsInWgsl(ctx, externalMap, wgsl) {
53
52
  return acc;
54
53
  }, wgsl);
55
54
  }
56
-
57
55
  //#endregion
58
- export { addArgTypesToExternals, addReturnTypeToExternals, applyExternals, replaceExternalsInWgsl };
56
+ export { addArgTypesToExternals, addReturnTypeToExternals, applyExternals, replaceExternalsInWgsl };
@@ -2,7 +2,6 @@ import { $internal } from "../../shared/symbols.js";
2
2
  import { getName } from "../../shared/meta.js";
3
3
  import { RandomNameRegistry, StrictNameRegistry } from "../../nameRegistry.js";
4
4
  import { ShelllessRepository } from "../../tgsl/shellless.js";
5
-
6
5
  //#region src/core/resolve/namespace.ts
7
6
  var NamespaceImpl = class {
8
7
  [$internal];
@@ -36,6 +35,5 @@ function namespace(options) {
36
35
  const { names = "strict" } = options ?? {};
37
36
  return new NamespaceImpl(names === "strict" ? new StrictNameRegistry() : new RandomNameRegistry());
38
37
  }
39
-
40
38
  //#endregion
41
- export { getUniqueName, namespace };
39
+ export { getUniqueName, namespace };
@@ -6,7 +6,6 @@ import { getAttributesString } from "../../data/attributes.js";
6
6
  import { isWgslComparisonSampler, isWgslSampler } from "../../data/sampler.js";
7
7
  import { accessModeMap, isWgslStorageTexture, isWgslTexture } from "../../data/texture.js";
8
8
  import { isAttribute } from "../vertexLayout/connectAttributesToShader.js";
9
-
10
9
  //#region src/core/resolve/resolveData.ts
11
10
  /**
12
11
  * Schemas for which their `type` property directly
@@ -141,6 +140,5 @@ function resolveData(ctx, data) {
141
140
  if (isWgslComparisonSampler(data) || isWgslSampler(data)) return data.type;
142
141
  assertExhaustive(data, "resolveData");
143
142
  }
144
-
145
143
  //#endregion
146
- export { resolveData };
144
+ export { resolveData };
@@ -1,6 +1,5 @@
1
1
  import { isSnippet } from "../../data/snippet.js";
2
2
  import { getResolutionCtx } from "../../execMode.js";
3
-
4
3
  //#region src/core/resolve/stitch.ts
5
4
  /**
6
5
  * "The reverse of snipping"
@@ -20,6 +19,5 @@ function stitch(strings, ...snippets) {
20
19
  }
21
20
  return result;
22
21
  }
23
-
24
22
  //#endregion
25
- export { stitch };
23
+ export { stitch };
@@ -29,10 +29,12 @@ interface TgpuResolveOptions {
29
29
  */
30
30
  enableExtensions?: WgslExtension[] | undefined;
31
31
  /**
32
+ * **NOTE: This is an unstable API and may change in the future.**
33
+ *
32
34
  * A custom shader code generator, used when resolving TypeGPU functions.
33
35
  * If not provided, the default WGSL generator will be used.
34
36
  */
35
- shaderGenerator?: ShaderGenerator | undefined;
37
+ unstable_shaderGenerator?: ShaderGenerator | undefined;
36
38
  }
37
39
  interface TgpuExtendedResolveOptions extends TgpuResolveOptions {
38
40
  /**
@@ -6,7 +6,6 @@ import { namespace } from "./namespace.js";
6
6
  import { isBindGroupLayout } from "../../tgpuBindGroupLayout.js";
7
7
  import { resolve as resolve$1 } from "../../resolutionCtx.js";
8
8
  import { isPipeline } from "../pipeline/typeGuards.js";
9
-
10
9
  //#region src/core/resolve/tgpuResolve.ts
11
10
  function resolveWithContext(arg0, options) {
12
11
  if (Array.isArray(arg0)) return resolveFromArray(arg0, options);
@@ -17,7 +16,7 @@ function resolve(arg, options) {
17
16
  return resolveWithContext(arg).code;
18
17
  }
19
18
  function resolveFromTemplate(options) {
20
- const { template, externals, shaderGenerator, names = "strict", config, enableExtensions } = options;
19
+ const { template, externals, unstable_shaderGenerator: shaderGenerator, names = "strict", config, enableExtensions } = options;
21
20
  if (!template) console.warn("Calling resolve with an empty template is deprecated and will soon return an empty string. Consider using the 'tgpu.resolve(resolvableArray, options)' API instead.");
22
21
  const dependencies = {};
23
22
  applyExternals(dependencies, externals ?? {});
@@ -36,7 +35,7 @@ function resolveFromTemplate(options) {
36
35
  });
37
36
  }
38
37
  function resolveFromArray(items, options) {
39
- const { shaderGenerator, names = "strict", config, enableExtensions } = options ?? {};
38
+ const { unstable_shaderGenerator: shaderGenerator, names = "strict", config, enableExtensions } = options ?? {};
40
39
  return resolve$1({
41
40
  [$internal]: true,
42
41
  [$resolve](ctx) {
@@ -63,6 +62,5 @@ function tryFindRoot(items) {
63
62
  if (pipelines.length > 1) throw new Error(`Found ${pipelines.length} pipelines but can only resolve one at a time.`);
64
63
  return pipelines[0]?.[$internal].root;
65
64
  }
66
-
67
65
  //#endregion
68
- export { resolve, resolveWithContext };
66
+ export { resolve, resolveWithContext };
@@ -1,7 +1,7 @@
1
1
  import { isAccessor, isMutableAccessor } from "../slot/slotTypes.js";
2
-
3
2
  //#region src/core/root/configurableImpl.ts
4
3
  var ConfigurableImpl = class ConfigurableImpl {
4
+ bindings;
5
5
  constructor(bindings) {
6
6
  this.bindings = bindings;
7
7
  }
@@ -13,6 +13,5 @@ var ConfigurableImpl = class ConfigurableImpl {
13
13
  return new ConfigurableImpl([...this.bindings, ...newCfg.bindings]);
14
14
  }
15
15
  };
16
-
17
16
  //#endregion
18
- export { ConfigurableImpl };
17
+ export { ConfigurableImpl };
@@ -1,11 +1,6 @@
1
- import "../buffer/bufferShorthand.js";
2
1
  import { LogGeneratorOptions } from "../../tgsl/consoleLog/types.js";
3
- import "../pipeline/computePipeline.js";
4
- import "../../tgpuBindGroupLayout.js";
5
2
  import { ShaderGenerator } from "../../tgsl/shaderGenerator.js";
6
3
  import { TgpuRoot } from "./rootTypes.js";
7
- import "../../data/wgslTypes.js";
8
-
9
4
  //#region src/core/root/init.d.ts
10
5
  /**
11
6
  * Options passed into {@link init}.
package/core/root/init.js CHANGED
@@ -23,7 +23,6 @@ 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
-
27
26
  //#region src/core/root/init.ts
28
27
  /**
29
28
  * Changes the given array to a vec of 3 numbers, filling missing values with 1.
@@ -51,8 +50,8 @@ var TgpuGuardedComputePipelineImpl = class TgpuGuardedComputePipelineImpl {
51
50
  this.#workgroupSize = workgroupSize;
52
51
  this.#lastSize = vec3u();
53
52
  }
54
- with(bindGroup) {
55
- return new TgpuGuardedComputePipelineImpl(this.#root, this.#pipeline.with(bindGroup), this.#sizeUniform, this.#workgroupSize);
53
+ with(bindGroupOrEncoder) {
54
+ return new TgpuGuardedComputePipelineImpl(this.#root, this.#pipeline.with(bindGroupOrEncoder), this.#sizeUniform, this.#workgroupSize);
56
55
  }
57
56
  dispatchThreads(...threads) {
58
57
  const sanitizedSize = toVec3(threads);
@@ -79,28 +78,30 @@ var TgpuGuardedComputePipelineImpl = class TgpuGuardedComputePipelineImpl {
79
78
  }
80
79
  };
81
80
  var WithBindingImpl = class WithBindingImpl {
82
- constructor(_getRoot, _slotBindings) {
83
- this._getRoot = _getRoot;
84
- this._slotBindings = _slotBindings;
81
+ #getRoot;
82
+ #slotBindings;
83
+ constructor(getRoot, slotBindings) {
84
+ this.#getRoot = getRoot;
85
+ this.#slotBindings = slotBindings;
85
86
  }
86
87
  with(slot, value) {
87
- return new WithBindingImpl(this._getRoot, [...this._slotBindings, [isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot, value]]);
88
+ return new WithBindingImpl(this.#getRoot, [...this.#slotBindings, [isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot, value]]);
88
89
  }
89
90
  withCompute(entryFn) {
90
- return new WithComputeImpl(this._getRoot(), this._slotBindings, entryFn);
91
+ return new WithComputeImpl(this.#getRoot(), this.#slotBindings, entryFn);
91
92
  }
92
93
  createComputePipeline(descriptor) {
93
- return INTERNAL_createComputePipeline(this._getRoot(), this._slotBindings, descriptor);
94
+ return INTERNAL_createComputePipeline(this.#getRoot(), this.#slotBindings, descriptor);
94
95
  }
95
96
  createRenderPipeline(descriptor) {
96
97
  return INTERNAL_createRenderPipeline({
97
- root: this._getRoot(),
98
- slotBindings: this._slotBindings,
98
+ root: this.#getRoot(),
99
+ slotBindings: this.#slotBindings,
99
100
  descriptor
100
101
  });
101
102
  }
102
103
  createGuardedComputePipeline(callback) {
103
- const root = this._getRoot();
104
+ const root = this.#getRoot();
104
105
  if (callback.length >= 4) throw new Error("Guarded compute callback only supports up to three dimensions.");
105
106
  const workgroupSize = workgroupSizeConfigs[callback.length];
106
107
  const wrappedCallback = fn([
@@ -124,24 +125,27 @@ var WithBindingImpl = class WithBindingImpl {
124
125
  return new TgpuGuardedComputePipelineImpl(root, this.createComputePipeline({ compute: mainCompute }), sizeUniform, workgroupSize);
125
126
  }
126
127
  withVertex(entryFn, attribs) {
127
- return new WithVertexImpl(this._getRoot(), this._slotBindings, {
128
+ return new WithVertexImpl(this.#getRoot(), this.#slotBindings, {
128
129
  vertex: entryFn,
129
130
  attribs
130
131
  });
131
132
  }
132
133
  pipe(transform) {
133
134
  const newCfg = transform(new ConfigurableImpl([]));
134
- return new WithBindingImpl(this._getRoot, [...this._slotBindings, ...newCfg.bindings]);
135
+ return new WithBindingImpl(this.#getRoot, [...this.#slotBindings, ...newCfg.bindings]);
135
136
  }
136
137
  };
137
138
  var WithComputeImpl = class {
138
- constructor(_root, _slotBindings, _entryFn) {
139
- this._root = _root;
140
- this._slotBindings = _slotBindings;
141
- this._entryFn = _entryFn;
139
+ #root;
140
+ #slotBindings;
141
+ #entryFn;
142
+ constructor(root, slotBindings, entryFn) {
143
+ this.#root = root;
144
+ this.#slotBindings = slotBindings;
145
+ this.#entryFn = entryFn;
142
146
  }
143
147
  createPipeline() {
144
- return INTERNAL_createComputePipeline(this._root, this._slotBindings, { compute: this._entryFn });
148
+ return INTERNAL_createComputePipeline(this.#root, this.#slotBindings, { compute: this.#entryFn });
145
149
  }
146
150
  };
147
151
  var WithVertexImpl = class WithVertexImpl {
@@ -229,14 +233,18 @@ var WithFragmentImpl = class WithFragmentImpl {
229
233
  */
230
234
  var TgpuRootImpl = class extends WithBindingImpl {
231
235
  "~unstable";
232
- _unwrappedBindGroupLayouts = new WeakMemo((key) => key.unwrap(this));
233
- _unwrappedBindGroups = new WeakMemo((key) => key.unwrap(this));
236
+ device;
237
+ nameRegistrySetting;
238
+ shaderGenerator;
239
+ #unwrappedBindGroupLayouts = new WeakMemo((key) => key.unwrap(this));
240
+ #unwrappedBindGroups = new WeakMemo((key) => key.unwrap(this));
241
+ #ownDevice;
234
242
  [$internal];
235
- constructor(device, nameRegistrySetting, _ownDevice, logOptions, shaderGenerator) {
243
+ constructor(device, nameRegistrySetting, ownDevice, logOptions, shaderGenerator) {
236
244
  super(() => this, []);
237
245
  this.device = device;
238
246
  this.nameRegistrySetting = nameRegistrySetting;
239
- this._ownDevice = _ownDevice;
247
+ this.#ownDevice = ownDevice;
240
248
  this.shaderGenerator = shaderGenerator;
241
249
  this["~unstable"] = this;
242
250
  this[$internal] = { logOptions };
@@ -274,7 +282,7 @@ var TgpuRootImpl = class extends WithBindingImpl {
274
282
  }
275
283
  destroy() {
276
284
  clearTextureUtilsCache(this.device);
277
- if (this._ownDevice) this.device.destroy();
285
+ if (this.#ownDevice) this.device.destroy();
278
286
  }
279
287
  createTexture(props) {
280
288
  return INTERNAL_createTexture(props, this);
@@ -288,8 +296,8 @@ var TgpuRootImpl = class extends WithBindingImpl {
288
296
  unwrap(resource) {
289
297
  if (isComputePipeline(resource)) return resource[$internal].rawPipeline;
290
298
  if (isRenderPipeline(resource)) return resource[$internal].core.unwrap().pipeline;
291
- if (isBindGroupLayout(resource)) return this._unwrappedBindGroupLayouts.getOrMake(resource);
292
- if (isBindGroup(resource)) return this._unwrappedBindGroups.getOrMake(resource);
299
+ if (isBindGroupLayout(resource)) return this.#unwrappedBindGroupLayouts.getOrMake(resource);
300
+ if (isBindGroup(resource)) return this.#unwrappedBindGroups.getOrMake(resource);
293
301
  if (isBuffer(resource)) return resource.buffer;
294
302
  if (isTexture(resource)) return resource[$internal].unwrap();
295
303
  if (isTextureView(resource)) {
@@ -452,6 +460,5 @@ function initFromDevice(options) {
452
460
  const { device, unstable_names: names = "strict", unstable_logOptions } = options ?? {};
453
461
  return new TgpuRootImpl(device, names, false, unstable_logOptions ?? {}, options?.shaderGenerator);
454
462
  }
455
-
456
463
  //#endregion
457
- export { init, initFromDevice };
464
+ export { init, initFromDevice };
@@ -24,7 +24,7 @@ import { ShaderGenerator } from "../../tgsl/shaderGenerator.js";
24
24
  import { TgpuBuffer, VertexFlag } from "../buffer/buffer.js";
25
25
  import { AnyWgslData, BaseData, U16, U32, Vec3u, Void, WgslArray, v4f } from "../../data/wgslTypes.js";
26
26
  import { TgpuTexture } from "../texture/texture.js";
27
- import { ExtractInvalidSchemaError, Infer, InferGPURecord, IsValidBufferSchema, IsValidStorageSchema, IsValidUniformSchema } from "../../shared/repr.js";
27
+ import { ExtractInvalidSchemaError, InferGPURecord, InferInput, IsValidBufferSchema, IsValidStorageSchema, IsValidUniformSchema } from "../../shared/repr.js";
28
28
  import { AnyData, Disarray, UndecorateRecord } from "../../data/dataTypes.js";
29
29
 
30
30
  //#region src/core/root/rootTypes.d.ts
@@ -34,6 +34,12 @@ interface TgpuGuardedComputePipeline<TArgs extends number[] = number[]> extends
34
34
  * Analogous to `TgpuComputePipeline.with(bindGroup)`.
35
35
  */
36
36
  with(bindGroup: TgpuBindGroup): TgpuGuardedComputePipeline<TArgs>;
37
+ /**
38
+ * Returns a pipeline wrapper that encodes dispatches into the provided
39
+ * command encoder instead of submitting them immediately.
40
+ * Analogous to `TgpuComputePipeline.with(encoder)`.
41
+ */
42
+ with(encoder: GPUCommandEncoder): TgpuGuardedComputePipeline<TArgs>;
37
43
  /**
38
44
  * Dispatches the pipeline.
39
45
  * Unlike `TgpuComputePipeline.dispatchWorkgroups()`, this method takes in the
@@ -469,7 +475,9 @@ interface TgpuRoot extends Unwrapper, WithBinding {
469
475
  * @param typeSchema The type of data that this buffer will hold.
470
476
  * @param initial The initial value of the buffer. (optional)
471
477
  */
472
- createBuffer<TData extends AnyData>(typeSchema: ValidateBufferSchema<TData>, initial?: Infer<NoInfer<TData>>): TgpuBuffer<TData>;
478
+ createBuffer<TData extends AnyData>(typeSchema: ValidateBufferSchema<TData>, initializer: (buffer: TgpuBuffer<NoInfer<TData>>) => void): TgpuBuffer<TData>;
479
+ createBuffer<TData extends AnyData>(typeSchema: ValidateBufferSchema<TData>, initial?: InferInput<NoInfer<TData>>): TgpuBuffer<TData>;
480
+ createBuffer<TData extends AnyData>(typeSchema: ValidateBufferSchema<TData>, initial?: ((buffer: TgpuBuffer<NoInfer<TData>>) => void) | InferInput<NoInfer<TData>>): TgpuBuffer<TData>;
473
481
  /**
474
482
  * Allocates memory on the GPU, allows passing data between host and shader.
475
483
  *
@@ -488,7 +496,9 @@ interface TgpuRoot extends Unwrapper, WithBinding {
488
496
  * @param typeSchema The type of data that this buffer will hold.
489
497
  * @param initial The initial value of the buffer. (optional)
490
498
  */
491
- createUniform<TData extends AnyWgslData>(typeSchema: ValidateUniformSchema<TData>, initial?: Infer<NoInfer<TData>>): TgpuUniform<TData>;
499
+ createUniform<TData extends AnyWgslData>(typeSchema: ValidateUniformSchema<TData>, initializer: (buffer: TgpuBuffer<NoInfer<TData>>) => void): TgpuUniform<TData>;
500
+ createUniform<TData extends AnyWgslData>(typeSchema: ValidateUniformSchema<TData>, initial?: InferInput<NoInfer<TData>>): TgpuUniform<TData>;
501
+ createUniform<TData extends AnyWgslData>(typeSchema: ValidateUniformSchema<TData>, initial?: ((buffer: TgpuBuffer<NoInfer<TData>>) => void) | InferInput<NoInfer<TData>>): TgpuUniform<TData>;
492
502
  /**
493
503
  * Allocates memory on the GPU, allows passing data between host and shader.
494
504
  * Read-only on the GPU, optimized for small data. For a general-purpose buffer,
@@ -506,7 +516,9 @@ interface TgpuRoot extends Unwrapper, WithBinding {
506
516
  * @param typeSchema The type of data that this buffer will hold.
507
517
  * @param initial The initial value of the buffer. (optional)
508
518
  */
509
- createMutable<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initial?: Infer<NoInfer<TData>>): TgpuMutable<TData>;
519
+ createMutable<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initializer: (buffer: TgpuBuffer<NoInfer<TData>>) => void): TgpuMutable<TData>;
520
+ createMutable<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initial?: InferInput<NoInfer<TData>>): TgpuMutable<TData>;
521
+ createMutable<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initial?: ((buffer: TgpuBuffer<NoInfer<TData>>) => void) | InferInput<NoInfer<TData>>): TgpuMutable<TData>;
510
522
  /**
511
523
  * Allocates memory on the GPU, allows passing data between host and shader.
512
524
  * Can be mutated in-place on the GPU. For a general-purpose buffer,
@@ -524,7 +536,9 @@ interface TgpuRoot extends Unwrapper, WithBinding {
524
536
  * @param typeSchema The type of data that this buffer will hold.
525
537
  * @param initial The initial value of the buffer. (optional)
526
538
  */
527
- createReadonly<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initial?: Infer<NoInfer<TData>>): TgpuReadonly<TData>;
539
+ createReadonly<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initializer: (buffer: TgpuBuffer<NoInfer<TData>>) => void): TgpuReadonly<TData>;
540
+ createReadonly<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initial?: InferInput<NoInfer<TData>>): TgpuReadonly<TData>;
541
+ createReadonly<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, initial?: ((buffer: TgpuBuffer<NoInfer<TData>>) => void) | InferInput<NoInfer<TData>>): TgpuReadonly<TData>;
528
542
  /**
529
543
  * Allocates memory on the GPU, allows passing data between host and shader.
530
544
  * Read-only on the GPU, optimized for large data. For a general-purpose buffer,
@@ -534,6 +548,9 @@ interface TgpuRoot extends Unwrapper, WithBinding {
534
548
  * @param gpuBuffer A vanilla WebGPU buffer.
535
549
  */
536
550
  createReadonly<TData extends AnyWgslData>(typeSchema: ValidateStorageSchema<TData>, gpuBuffer: GPUBuffer): TgpuReadonly<TData>;
551
+ createTexture<TWidth extends number, THeight extends number, TDepth extends number, TSize extends readonly [TWidth] | readonly [TWidth, THeight] | readonly [TWidth, THeight, TDepth], TFormat extends GPUTextureFormat, TMipLevelCount extends number, TSampleCount extends number, TViewFormats extends GPUTextureFormat[], TDimension extends GPUTextureDimension>(props: CreateTextureOptions<TSize, TFormat, TMipLevelCount, TSampleCount, TViewFormats, TDimension>): TgpuTexture<CreateTextureResult<TSize, TFormat, TMipLevelCount, TSampleCount, TViewFormats, TDimension>>;
552
+ createSampler(props: WgslSamplerProps): TgpuFixedSampler;
553
+ createComparisonSampler(props: WgslComparisonSamplerProps): TgpuFixedComparisonSampler;
537
554
  /**
538
555
  * Creates a query set for collecting timestamps or occlusion queries.
539
556
  *
@@ -586,6 +603,7 @@ interface TgpuRoot extends Unwrapper, WithBinding {
586
603
  interface ExperimentalTgpuRoot extends Omit<TgpuRoot, 'with'>, Withable_Deprecated<WithBinding> {
587
604
  readonly nameRegistrySetting: 'strict' | 'random';
588
605
  readonly shaderGenerator?: ShaderGenerator | undefined;
606
+ /** @deprecated Use `root.createTexture` instead. */
589
607
  createTexture<TWidth extends number, THeight extends number, TDepth extends number, TSize extends readonly [TWidth] | readonly [TWidth, THeight] | readonly [TWidth, THeight, TDepth], TFormat extends GPUTextureFormat, TMipLevelCount extends number, TSampleCount extends number, TViewFormats extends GPUTextureFormat[], TDimension extends GPUTextureDimension>(props: CreateTextureOptions<TSize, TFormat, TMipLevelCount, TSampleCount, TViewFormats, TDimension>): TgpuTexture<CreateTextureResult<TSize, TFormat, TMipLevelCount, TSampleCount, TViewFormats, TDimension>>;
590
608
  beginRenderPass(descriptor: GPURenderPassDescriptor, callback: (pass: RenderPass) => void): void;
591
609
  /**
@@ -601,7 +619,9 @@ interface ExperimentalTgpuRoot extends Omit<TgpuRoot, 'with'>, Withable_Deprecat
601
619
  * @param callback - A function that records draw commands into the bundle.
602
620
  */
603
621
  beginRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor, callback: (pass: RenderBundleEncoderPass) => void): GPURenderBundle;
622
+ /** @deprecated Use `root.createSampler` instead. */
604
623
  createSampler(props: WgslSamplerProps): TgpuFixedSampler;
624
+ /** @deprecated Use `root.createComparisonSampler` instead. */
605
625
  createComparisonSampler(props: WgslComparisonSamplerProps): TgpuFixedComparisonSampler;
606
626
  /**
607
627
  * @deprecated Used to cause all commands enqueued by pipelines to be
@@ -1,10 +1,6 @@
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";
8
4
  import { Infer } from "../../shared/repr.js";
9
5
 
10
6
  //#region src/core/sampler/sampler.d.ts