Skip to content

wgsl-tooling-wg/wgsl-linker

Repository files navigation

wgsl-linker

wgsl-linker enriches the WGSL shader language to support linking code modules via import. Linking can be done entirely at runtime.

For those in the JavaScript/Typescript world, think 'bundling'. The wgsl-linker is a module bundler for WGSL.

As with other programming languages, module linking becomes useful when your WGSL code grows large enough to be split into separate reusable files (aka modules). Linking integrates the code modules together while solving for:

  • renaming - Two functions with the same name? The linker will rename one of them, and all the calls to the renamed function.
  • deduplication - Two modules import the same function? You get only one copy.
  • recursion - Importing a function that references another import? You get all references, recursively.
  • dead code - Importing a function from a big module? You get only that function and its references, not the whole file.

wgsl-linker is currently being revised to follow the upcoming community WESL standard.

About

enriched WGSL with support for import/export and more

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published