wesl 0.7.26 → 0.7.27

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 CHANGED
@@ -41,5 +41,5 @@ fn random_color(uv: vec2u) -> vec3f {
41
41
  </pre>
42
42
 
43
43
  [wesl plugin]: https://www.npmjs.com/package/wesl-plugin
44
- [examples]: https://github.com/wgsl-tooling-wg/wesl-js/tree/main/examples
44
+ [examples]: https://github.com/webgpu-tools/wesl-js/tree/main/examples
45
45
  [wesl]: https://www.npmjs.com/package/wesl
package/dist/index.d.ts CHANGED
@@ -279,7 +279,7 @@ type ElemKindMap = {
279
279
  type: TypeRefElem;
280
280
  var: VarElem;
281
281
  };
282
- /** Inspired by https://github.com/wgsl-tooling-wg/wesl-rs/blob/3b2434eac1b2ebda9eb8bfb25f43d8600d819872/crates/wgsl-parse/src/syntax.rs#L364 */
282
+ /** Inspired by https://github.com/webgpu-tools/wesl-rs/blob/3b2434eac1b2ebda9eb8bfb25f43d8600d819872/crates/wgsl-parse/src/syntax.rs#L364 */
283
283
  type ExpressionElem = Literal | RefIdentElem | TypeRefElem | ParenthesizedExpression | ComponentExpression | ComponentMemberExpression | UnaryExpression | BinaryExpression | FunctionCallExpression;
284
284
  type TerminalElem = DirectiveElem | DeclIdentElem | NameElem | RefIdentElem | TextElem | ImportElem;
285
285
  type GlobalDeclarationElem = AliasElem | ConstElem | FnElem | GlobalVarElem | OverrideElem | StructElem;
@@ -737,7 +737,7 @@ globalNames: Set<string>) => string;
737
737
  /**
738
738
  * Construct a globally unique name based on the declaration
739
739
  * module path separated by underscores.
740
- * Corresponds to "Underscore-count mangling" from [NameMangling.md](https://github.com/wgsl-tooling-wg/wesl-spec/blob/main/NameMangling.md)
740
+ * Corresponds to "Underscore-count mangling" from [NameMangling.md](https://github.com/webgpu-tools/wesl-spec/blob/main/NameMangling.md)
741
741
  */
742
742
  declare function underscoreMangle(decl: DeclIdent, srcModule: SrcModule): string;
743
743
  /**
@@ -844,27 +844,15 @@ interface LinkConfig {
844
844
  plugins?: WeslJsPlugin[];
845
845
  }
846
846
  interface LinkParams {
847
- /** Module resolver for lazy loading (NEW API - preferred)
848
- * Replaces weslSrc for lazy module loading.
849
- * If provided, weslSrc will be ignored. */
847
+ /** Module resolver for lazy loading. If provided, weslSrc is ignored. */
850
848
  resolver?: ModuleResolver;
851
- /** record of file paths and wesl text for modules (LEGACY API - still supported).
852
- * key is module path or file path
853
- * `package::foo::bar`, or './foo/bar.wesl', or './foo/bar'
854
- * value is wesl src
855
- *
856
- *
857
- * Only accepts unix-style, relative filesystem paths that are valid WGSL identifiers
858
- * - Unix-style: Slashes as separators.
859
- * - Valid WGSL identifiers: No backslashes, no `..`, or other non-identifier symbols.
860
- * - Relative paths: They have to be relative to the wesl root.
861
- */
849
+ /** Record of module sources keyed by module path (`package::foo::bar`)
850
+ * or relative file path (`./foo/bar.wesl`). Paths must be unix-style,
851
+ * relative to the wesl root, and valid WGSL identifiers. */
862
852
  weslSrc?: Record<string, string>;
863
- /** name of root wesl module
864
- * for an app, the root module normally contains the '@compute', '@vertex' or '@fragment' entry points
865
- * for a library, the root module defines the public api fo the library
866
- * can be specified as file path (./main.wesl), a module path (package::main), or just a module name (main)
867
- */
853
+ /** Root module name: file path (`./main.wesl`), module path (`package::main`), or bare name (`main`).
854
+ * For apps, the root module contains entry points (`@compute`, `@vertex`, `@fragment`).
855
+ * For libraries, it defines the public API. */
868
856
  rootModuleName?: string;
869
857
  /** For debug logging. Will be prepended to file paths. */
870
858
  debugWeslRoot?: string;
@@ -888,7 +876,9 @@ interface LinkParams {
888
876
  mangler?: ManglerFn;
889
877
  }
890
878
  /** Project config for web components and tools. */
891
- type WeslProject = Pick<LinkParams, "weslSrc" | "rootModuleName" | "conditions" | "constants" | "libs" | "packageName">;
879
+ type WeslProject = Pick<LinkParams, "weslSrc" | "rootModuleName" | "conditions" | "constants" | "libs" | "packageName"> & {
880
+ /** Shader directory relative to project root (set by ?link from wesl.toml). */shaderRoot?: string;
881
+ };
892
882
  /** Context passed to virtual library generators. */
893
883
  interface VirtualLibContext {
894
884
  conditions: Conditions;
package/dist/index.js CHANGED
@@ -283,12 +283,13 @@ const isBrowser = "document" in globalThis;
283
283
  /** Throw an error with an embedded source map so that browser users can
284
284
  * click on the error in the browser debug console and see the wesl source code. */
285
285
  function throwClickableError(params) {
286
- const { url, text, lineNumber, lineColumn, length, error } = params;
286
+ const { url, text, lineNumber, lineColumn, length, offset, error } = params;
287
287
  const weslLocation = {
288
288
  file: url,
289
289
  line: lineNumber,
290
290
  column: lineColumn,
291
- length
291
+ length,
292
+ offset
292
293
  };
293
294
  error.weslLocation = weslLocation;
294
295
  if (!isBrowser) throw error;
@@ -349,6 +350,7 @@ function failIdentElem(identElem, msg = "") {
349
350
  lineNumber,
350
351
  lineColumn,
351
352
  length: end - start,
353
+ offset: start,
352
354
  error: new Error(detailedMessage)
353
355
  });
354
356
  }
@@ -656,7 +658,7 @@ function lowerAndEmitElem(e, ctx) {
656
658
  case "let":
657
659
  case "statement":
658
660
  case "continuing":
659
- emitStatement$1(e, ctx);
661
+ emitStatement(e, ctx);
660
662
  return;
661
663
  case "override":
662
664
  case "const":
@@ -694,7 +696,7 @@ function emitModule(e, ctx) {
694
696
  lowerAndEmitElem(child, ctx);
695
697
  }
696
698
  }
697
- function emitStatement$1(e, ctx) {
699
+ function emitStatement(e, ctx) {
698
700
  if (!(e.contents.length > 0 && e.contents[0].kind === "attribute")) emitAttributes(e.attributes, ctx);
699
701
  emitContents(e, ctx);
700
702
  }
@@ -1257,7 +1259,7 @@ function liveDeclsToString(liveDecls) {
1257
1259
  /**
1258
1260
  * Construct a globally unique name based on the declaration
1259
1261
  * module path separated by underscores.
1260
- * Corresponds to "Underscore-count mangling" from [NameMangling.md](https://github.com/wgsl-tooling-wg/wesl-spec/blob/main/NameMangling.md)
1262
+ * Corresponds to "Underscore-count mangling" from [NameMangling.md](https://github.com/webgpu-tools/wesl-spec/blob/main/NameMangling.md)
1261
1263
  */
1262
1264
  function underscoreMangle(decl, srcModule) {
1263
1265
  const { modulePath } = srcModule;
@@ -4468,20 +4470,13 @@ async function link(params) {
4468
4470
  }
4469
4471
  /** linker api for benchmarking */
4470
4472
  function _linkSync(params) {
4471
- const { weslSrc, libs = [], packageName, debugWeslRoot } = params;
4472
- const { resolver } = params;
4473
- const resolvers = [];
4474
- if (resolver) resolvers.push(resolver);
4475
- else if (weslSrc) resolvers.push(new RecordResolver(weslSrc, {
4473
+ const { weslSrc, libs = [], packageName, debugWeslRoot, resolver } = params;
4474
+ if (!resolver && !weslSrc) throw new Error("Either resolver or weslSrc must be provided");
4475
+ const allResolvers = [resolver ?? new RecordResolver(weslSrc, {
4476
4476
  packageName,
4477
4477
  debugWeslRoot
4478
- }));
4479
- else throw new Error("Either resolver or weslSrc must be provided");
4480
- if (libs.length > 0) {
4481
- const libResolvers = createLibraryResolvers(libs, debugWeslRoot);
4482
- resolvers.push(...libResolvers);
4483
- }
4484
- const finalResolver = resolvers.length === 1 ? resolvers[0] : new CompositeResolver(resolvers);
4478
+ }), ...createLibraryResolvers(libs, debugWeslRoot)];
4479
+ const finalResolver = allResolvers.length === 1 ? allResolvers[0] : new CompositeResolver(allResolvers);
4485
4480
  return linkRegistry({
4486
4481
  ...params,
4487
4482
  resolver: finalResolver
@@ -4565,6 +4560,7 @@ function setupVirtualLibs(virtualLibs, constants) {
4565
4560
  }
4566
4561
  return libs && mapValues(libs, (fn) => ({ fn }));
4567
4562
  }
4563
+ /** Run registered transform plugins over the bound AST. */
4568
4564
  function applyTransformPlugins(rootModule, globalNames, config) {
4569
4565
  const { moduleElem, srcModule } = rootModule;
4570
4566
  const startAst = {
@@ -4577,53 +4573,38 @@ function applyTransformPlugins(rootModule, globalNames, config) {
4577
4573
  }
4578
4574
  /** Assemble WGSL output from prologue statements, root module, and imported declarations. */
4579
4575
  function emitWgsl(rootModuleElem, srcModule, newDecls, newStatements, conditions = {}) {
4580
- const prologueBuilders = newStatements.map((s) => emitStatement(s, conditions));
4581
- const rootBuilder = new SrcMapBuilder({
4582
- text: srcModule.src,
4583
- path: srcModule.debugFilePath
4584
- });
4576
+ const prologueBuilders = newStatements.map((s) => emitElem(s.srcModule, s.elem, conditions, { addNl: true }));
4577
+ const rootBuilder = builderFromModule(srcModule);
4585
4578
  lowerAndEmit({
4586
4579
  srcBuilder: rootBuilder,
4587
4580
  rootElems: [rootModuleElem],
4588
4581
  conditions,
4589
4582
  extracting: false
4590
4583
  });
4591
- const declBuilders = newDecls.map((decl) => emitDecl(decl, conditions));
4584
+ const declBuilders = newDecls.map((decl) => emitElem(decl.srcModule, decl.declElem, conditions, { skipConditionalFiltering: true }));
4592
4585
  return [
4593
4586
  ...prologueBuilders,
4594
4587
  rootBuilder,
4595
4588
  ...declBuilders
4596
4589
  ];
4597
4590
  }
4598
- function emitStatement(s, conditions) {
4599
- const { elem, srcModule } = s;
4600
- const { src: text, debugFilePath: path } = srcModule;
4601
- const builder = new SrcMapBuilder({
4602
- text,
4603
- path
4604
- });
4591
+ /** Emit a single element (prologue statement or imported declaration) into a SrcMapBuilder. */
4592
+ function emitElem(srcModule, elem, conditions, opts = {}) {
4593
+ const builder = builderFromModule(srcModule);
4605
4594
  lowerAndEmit({
4606
4595
  srcBuilder: builder,
4607
4596
  rootElems: [elem],
4608
- conditions
4597
+ conditions,
4598
+ skipConditionalFiltering: opts.skipConditionalFiltering
4609
4599
  });
4610
- builder.addNl();
4600
+ if (opts.addNl) builder.addNl();
4611
4601
  return builder;
4612
4602
  }
4613
- /** Skip conditional filtering because findValidRootDecls already validated these declarations */
4614
- function emitDecl(decl, conditions) {
4615
- const { src: text, debugFilePath: path } = decl.srcModule;
4616
- const builder = new SrcMapBuilder({
4617
- text,
4618
- path
4619
- });
4620
- lowerAndEmit({
4621
- srcBuilder: builder,
4622
- rootElems: [decl.declElem],
4623
- conditions,
4624
- skipConditionalFiltering: true
4603
+ function builderFromModule(srcModule) {
4604
+ return new SrcMapBuilder({
4605
+ text: srcModule.src,
4606
+ path: srcModule.debugFilePath
4625
4607
  });
4626
- return builder;
4627
4608
  }
4628
4609
  //#endregion
4629
4610
  //#region src/LinkerUtil.ts
@@ -4924,6 +4905,7 @@ function makeWeslDevice(device) {
4924
4905
  lineNumber: message.lineNum,
4925
4906
  lineColumn: message.linePos,
4926
4907
  length: message.length,
4908
+ offset: message.offset,
4927
4909
  error: /* @__PURE__ */ new Error(message.type + ": " + message.message)
4928
4910
  });
4929
4911
  else console.error(ev.error.message);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "wesl",
3
- "version": "0.7.26",
3
+ "version": "0.7.27",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
7
7
  "src"
8
8
  ],
9
- "repository": "github:wgsl-tooling-wg/wesl-js",
9
+ "repository": "github:webgpu-tools/wesl-js",
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./dist/index.d.ts",
@@ -52,7 +52,7 @@ export type ElemKindMap = {
52
52
  var: VarElem;
53
53
  };
54
54
 
55
- /** Inspired by https://github.com/wgsl-tooling-wg/wesl-rs/blob/3b2434eac1b2ebda9eb8bfb25f43d8600d819872/crates/wgsl-parse/src/syntax.rs#L364 */
55
+ /** Inspired by https://github.com/webgpu-tools/wesl-rs/blob/3b2434eac1b2ebda9eb8bfb25f43d8600d819872/crates/wgsl-parse/src/syntax.rs#L364 */
56
56
  export type ExpressionElem =
57
57
  | Literal
58
58
  | RefIdentElem
@@ -9,6 +9,8 @@ export interface WeslErrorLocation {
9
9
  line: number;
10
10
  column: number;
11
11
  length: number;
12
+ /** byte offset into the source file */
13
+ offset: number;
12
14
  }
13
15
 
14
16
  export interface ClickableErrorParams {
@@ -27,6 +29,9 @@ export interface ClickableErrorParams {
27
29
  /** number of characters in the error section */
28
30
  length: number;
29
31
 
32
+ /** byte offset of the error section within the source text */
33
+ offset: number;
34
+
30
35
  /** the original error */
31
36
  error: Error;
32
37
  }
@@ -36,12 +41,13 @@ const isBrowser = "document" in globalThis;
36
41
  /** Throw an error with an embedded source map so that browser users can
37
42
  * click on the error in the browser debug console and see the wesl source code. */
38
43
  export function throwClickableError(params: ClickableErrorParams): void {
39
- const { url, text, lineNumber, lineColumn, length, error } = params;
44
+ const { url, text, lineNumber, lineColumn, length, offset, error } = params;
40
45
  const weslLocation: WeslErrorLocation = {
41
46
  file: url,
42
47
  line: lineNumber,
43
48
  column: lineColumn,
44
49
  length,
50
+ offset,
45
51
  };
46
52
  (error as any).weslLocation = weslLocation;
47
53
  if (!debug || !isBrowser) throw error;
@@ -142,6 +148,7 @@ export function failIdentElem(
142
148
  lineNumber,
143
149
  lineColumn,
144
150
  length,
151
+ offset: start,
145
152
  error: new Error(detailedMessage),
146
153
  });
147
154
  }
package/src/Linker.ts CHANGED
@@ -37,29 +37,17 @@ export interface LinkConfig {
37
37
  }
38
38
 
39
39
  export interface LinkParams {
40
- /** Module resolver for lazy loading (NEW API - preferred)
41
- * Replaces weslSrc for lazy module loading.
42
- * If provided, weslSrc will be ignored. */
40
+ /** Module resolver for lazy loading. If provided, weslSrc is ignored. */
43
41
  resolver?: ModuleResolver;
44
42
 
45
- /** record of file paths and wesl text for modules (LEGACY API - still supported).
46
- * key is module path or file path
47
- * `package::foo::bar`, or './foo/bar.wesl', or './foo/bar'
48
- * value is wesl src
49
- *
50
- *
51
- * Only accepts unix-style, relative filesystem paths that are valid WGSL identifiers
52
- * - Unix-style: Slashes as separators.
53
- * - Valid WGSL identifiers: No backslashes, no `..`, or other non-identifier symbols.
54
- * - Relative paths: They have to be relative to the wesl root.
55
- */
43
+ /** Record of module sources keyed by module path (`package::foo::bar`)
44
+ * or relative file path (`./foo/bar.wesl`). Paths must be unix-style,
45
+ * relative to the wesl root, and valid WGSL identifiers. */
56
46
  weslSrc?: Record<string, string>;
57
47
 
58
- /** name of root wesl module
59
- * for an app, the root module normally contains the '@compute', '@vertex' or '@fragment' entry points
60
- * for a library, the root module defines the public api fo the library
61
- * can be specified as file path (./main.wesl), a module path (package::main), or just a module name (main)
62
- */
48
+ /** Root module name: file path (`./main.wesl`), module path (`package::main`), or bare name (`main`).
49
+ * For apps, the root module contains entry points (`@compute`, `@vertex`, `@fragment`).
50
+ * For libraries, it defines the public API. */
63
51
  rootModuleName?: string;
64
52
 
65
53
  /** For debug logging. Will be prepended to file paths. */
@@ -100,7 +88,10 @@ export type WeslProject = Pick<
100
88
  | "constants"
101
89
  | "libs"
102
90
  | "packageName"
103
- >;
91
+ > & {
92
+ /** Shader directory relative to project root (set by ?link from wesl.toml). */
93
+ shaderRoot?: string;
94
+ };
104
95
 
105
96
  /** Context passed to virtual library generators. */
106
97
  export interface VirtualLibContext {
@@ -127,26 +118,20 @@ export async function link(params: LinkParams): Promise<LinkedWesl> {
127
118
 
128
119
  /** linker api for benchmarking */
129
120
  export function _linkSync(params: LinkParams): SrcMap {
130
- const { weslSrc, libs = [], packageName, debugWeslRoot } = params;
131
- const { resolver } = params;
121
+ const { weslSrc, libs = [], packageName, debugWeslRoot, resolver } = params;
132
122
 
133
- const resolvers: ModuleResolver[] = [];
134
-
135
- if (resolver) {
136
- resolvers.push(resolver);
137
- } else if (weslSrc) {
138
- resolvers.push(new RecordResolver(weslSrc, { packageName, debugWeslRoot }));
139
- } else {
123
+ if (!resolver && !weslSrc) {
140
124
  throw new Error("Either resolver or weslSrc must be provided");
141
125
  }
126
+ const primaryResolver =
127
+ resolver ?? new RecordResolver(weslSrc!, { packageName, debugWeslRoot });
142
128
 
143
- if (libs.length > 0) {
144
- const libResolvers = createLibraryResolvers(libs, debugWeslRoot);
145
- resolvers.push(...libResolvers);
146
- }
147
-
129
+ const libResolvers = createLibraryResolvers(libs, debugWeslRoot);
130
+ const allResolvers = [primaryResolver, ...libResolvers];
148
131
  const finalResolver =
149
- resolvers.length === 1 ? resolvers[0] : new CompositeResolver(resolvers);
132
+ allResolvers.length === 1
133
+ ? allResolvers[0]
134
+ : new CompositeResolver(allResolvers);
150
135
 
151
136
  return linkRegistry({ ...params, resolver: finalResolver });
152
137
  }
@@ -200,11 +185,8 @@ export interface LinkRegistryParams
200
185
  * that share some sources.)
201
186
  */
202
187
  export function linkRegistry(params: LinkRegistryParams): SrcMap {
203
- const {
204
- transformedAst: ast,
205
- newDecls,
206
- newStatements,
207
- } = bindAndTransform(params);
188
+ const bound = bindAndTransform(params);
189
+ const { transformedAst: ast, newDecls, newStatements } = bound;
208
190
  const builders = emitWgsl(
209
191
  ast.moduleElem,
210
192
  ast.srcModule,
@@ -230,7 +212,6 @@ export function bindAndTransform(
230
212
 
231
213
  const modulePath = normalizeModuleName(rootModuleName);
232
214
  const rootAst = getRootModule(resolver, modulePath, rootModuleName);
233
-
234
215
  const virtuals = setupVirtualLibs(params.virtualLibs, constants);
235
216
 
236
217
  const bound = bindIdents({
@@ -291,14 +272,14 @@ function setupVirtualLibs(
291
272
  return libs && mapValues(libs, fn => ({ fn }));
292
273
  }
293
274
 
275
+ /** Run registered transform plugins over the bound AST. */
294
276
  function applyTransformPlugins(
295
277
  rootModule: WeslAST,
296
278
  globalNames: Set<string>,
297
279
  config?: LinkConfig,
298
280
  ): TransformedAST {
299
- const { moduleElem, srcModule } = rootModule;
300
-
301
281
  // for now only transform the root module
282
+ const { moduleElem, srcModule } = rootModule;
302
283
  const startAst = { moduleElem, srcModule, globalNames, notableElems: {} };
303
284
  const plugins = config?.plugins ?? [];
304
285
  const transforms = filterMap(plugins, plugin => plugin.transform);
@@ -313,12 +294,11 @@ function emitWgsl(
313
294
  newStatements: EmittableElem[],
314
295
  conditions: Conditions = {},
315
296
  ): SrcMapBuilder[] {
316
- const prologueBuilders = newStatements.map(s => emitStatement(s, conditions));
297
+ const prologueBuilders = newStatements.map(s =>
298
+ emitElem(s.srcModule, s.elem, conditions, { addNl: true }),
299
+ );
317
300
 
318
- const rootBuilder = new SrcMapBuilder({
319
- text: srcModule.src,
320
- path: srcModule.debugFilePath,
321
- });
301
+ const rootBuilder = builderFromModule(srcModule);
322
302
  lowerAndEmit({
323
303
  srcBuilder: rootBuilder,
324
304
  rootElems: [rootModuleElem],
@@ -326,36 +306,40 @@ function emitWgsl(
326
306
  extracting: false,
327
307
  });
328
308
 
329
- const declBuilders = newDecls.map(decl => emitDecl(decl, conditions));
309
+ const declBuilders = newDecls.map(decl =>
310
+ emitElem(decl.srcModule, decl.declElem!, conditions, {
311
+ skipConditionalFiltering: true,
312
+ }),
313
+ );
330
314
 
331
315
  return [...prologueBuilders, rootBuilder, ...declBuilders];
332
316
  }
333
317
 
334
- function emitStatement(
335
- s: EmittableElem,
318
+ /** Emit a single element (prologue statement or imported declaration) into a SrcMapBuilder. */
319
+ function emitElem(
320
+ srcModule: SrcModule,
321
+ elem: AbstractElem,
336
322
  conditions: Conditions,
323
+ opts: { addNl?: boolean; skipConditionalFiltering?: boolean } = {},
337
324
  ): SrcMapBuilder {
338
- const { elem, srcModule } = s;
339
- const { src: text, debugFilePath: path } = srcModule;
340
- const builder = new SrcMapBuilder({ text, path });
341
- lowerAndEmit({ srcBuilder: builder, rootElems: [elem], conditions });
342
- builder.addNl();
343
- return builder;
344
- }
345
-
346
- /** Skip conditional filtering because findValidRootDecls already validated these declarations */
347
- function emitDecl(decl: DeclIdent, conditions: Conditions): SrcMapBuilder {
348
- const { src: text, debugFilePath: path } = decl.srcModule;
349
- const builder = new SrcMapBuilder({ text, path });
325
+ const builder = builderFromModule(srcModule);
350
326
  lowerAndEmit({
351
327
  srcBuilder: builder,
352
- rootElems: [decl.declElem!],
328
+ rootElems: [elem],
353
329
  conditions,
354
- skipConditionalFiltering: true,
330
+ skipConditionalFiltering: opts.skipConditionalFiltering,
355
331
  });
332
+ if (opts.addNl) builder.addNl();
356
333
  return builder;
357
334
  }
358
335
 
336
+ function builderFromModule(srcModule: SrcModule): SrcMapBuilder {
337
+ return new SrcMapBuilder({
338
+ text: srcModule.src,
339
+ path: srcModule.debugFilePath,
340
+ });
341
+ }
342
+
359
343
  /*
360
344
 
361
345
  LATER
package/src/Mangler.ts CHANGED
@@ -25,7 +25,7 @@ export type ManglerFn = (
25
25
  /**
26
26
  * Construct a globally unique name based on the declaration
27
27
  * module path separated by underscores.
28
- * Corresponds to "Underscore-count mangling" from [NameMangling.md](https://github.com/wgsl-tooling-wg/wesl-spec/blob/main/NameMangling.md)
28
+ * Corresponds to "Underscore-count mangling" from [NameMangling.md](https://github.com/webgpu-tools/wesl-spec/blob/main/NameMangling.md)
29
29
  */
30
30
  export function underscoreMangle(
31
31
  decl: DeclIdent,
@@ -1,5 +1,5 @@
1
1
  // From https://www.w3.org/TR/WGSL/#predeclared
2
- // Use https://github.com/wgsl-tooling-wg/wgsl-spec to regenerate these list in the future
2
+ // Use https://github.com/webgpu-tools/wgsl-spec to regenerate these list in the future
3
3
 
4
4
  export const stdFns = `bitcast all any select arrayLength
5
5
  abs acos acosh asin asinh atan atanh atan2 ceil clamp cos cosh
package/src/WeslDevice.ts CHANGED
@@ -89,6 +89,7 @@ export function makeWeslDevice(device: GPUDevice): WeslDevice {
89
89
  lineNumber: message.lineNum,
90
90
  lineColumn: message.linePos,
91
91
  length: message.length,
92
+ offset: message.offset,
92
93
  error: new Error(message.type + ": " + message.message),
93
94
  });
94
95
  }
@@ -1,4 +1,4 @@
1
- // Use https://github.com/wgsl-tooling-wg/wgsl-spec to check this list in the future
1
+ // Use https://github.com/webgpu-tools/wgsl-spec to check this list in the future
2
2
  // I recommend checking whether a new list and the current list are equal
3
3
 
4
4
  /** https://www.w3.org/TR/WGSL/#keyword-summary */
@@ -39,7 +39,7 @@ interface CompoundOptions {
39
39
 
40
40
  // Experimental: declarations in conditional blocks visible in outer scope.
41
41
  // e.g. @if(X) { let y = 1; } makes y visible outside the block.
42
- // see https://github.com/wgsl-tooling-wg/wesl-spec/issues/158
42
+ // see https://github.com/webgpu-tools/wesl-spec/issues/158
43
43
  const conditionalBlockFeature = true;
44
44
 
45
45
  /** Function bodies share scope with parameters (per WGSL spec). */
@@ -11,7 +11,7 @@ const bevyBulkTest = {
11
11
  name: "Bevy",
12
12
  baseDir: "bevy-wgsl",
13
13
  git: {
14
- url: "https://github.com/wgsl-tooling-wg/bevy-wgsl.git",
14
+ url: "https://github.com/webgpu-tools/bevy-wgsl.git",
15
15
  revision: "84977ff025eaf8d92e56a9c35b815fae70eb4af0",
16
16
  },
17
17
  };