-
Notifications
You must be signed in to change notification settings - Fork 240
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
Add example showing how to use Slang/WASM #5996
Add example showing how to use Slang/WASM #5996
Conversation
examples/wgpu-slang-wasm/README.md
Outdated
|
||
## Description | ||
|
||
This is a simple example showing how WebGPU applications can usethe Slang API directly via the WebAssembly library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
showing how WebGPU applications can use the slang-wasm library to compile slang shaders at runtime to wgsl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
b2831df
to
d8e4324
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I am wondering if it will be more helpful to add some comments, because the goal of this change is to tech how to use.
But too many comments may just bloat the line count.
throw new Error("Failed to compile WGSL shaders."); | ||
} | ||
|
||
render(wgslShaders); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is render()
gets called only once?
Or does it get called every frame?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just called once, since there is no animation in the example.
Yeah I considered it, but most of the code is WebGPU -related.
|
This closes #5656.