Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review and hopefully simplify link() API #3

Open
mighdoll opened this issue Oct 10, 2024 · 0 comments
Open

Review and hopefully simplify link() API #3

mighdoll opened this issue Oct 10, 2024 · 0 comments
Milestone

Comments

@mighdoll
Copy link
Contributor

Current API:

// load wgsl text (using vite syntax. see Build Support below.)
const wgsl = import.meta.glob("./shaders/*.wgsl", {
  query: "?raw",
  eager: true,
  import: "default",
});

// register the linkable exports
const registry = new ModuleRegistry({ wgsl });

// link my main shader wgsl with imported modules,
// using the provided variables for import parameters 
const code = registry.link("main", { WorkgroupSize: 128 });

// pass the linked wgsl to WebGPU as normal
device.createShaderModule({ code });
@mighdoll mighdoll moved this to Todo in wgsl-linker Oct 15, 2024
@mighdoll mighdoll added this to the M1 milestone Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant