Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions wiki/Getting-Started-JavaScript.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ conditional compilation, virtual modules, const injection, [wgsl-edit](wgsl-edit

```ts
/// <reference types="wesl-plugin/suffixes" />
import { link, createWeslDevice } from "wesl";
import { link, createShaderModule, makeWeslDevice } from "wesl";
import appWesl from "../shaders/app.wesl?link";

async function example() {
const device = createWeslDevice(await navigator.gpu.requestAdapter());
const adapter = await navigator.gpu.requestAdapter();
const device = makeWeslDevice(await adapter.requestDevice());
const linked = await link(appWesl);
const shaderModule = linked.createShaderModule(device, {});
const shaderModule = createShaderModule(linked, device, {});
}
```

Expand Down Expand Up @@ -77,4 +78,4 @@ See [WESL-js Examples] for example projects.

[wesl]: https://www.npmjs.com/package/wesl
[wesl-plugin]: https://www.npmjs.com/package/wesl-plugin
[wesl-js examples]: https://github.com/webgpu-tools/wesl-js/tree/main/examples
[wesl-js examples]: https://github.com/webgpu-tools/wesl-js/tree/main/examples