-
Notifications
You must be signed in to change notification settings - Fork 313
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
Use iframes #369
Use iframes #369
Conversation
This PR removes react and next. It allows a sample to be pure JavaScript (though there are none at the moment). It allows samples to be standalone so that they run separate from the sample selection menu.
personally I'd vote to remove these. They're more clutter than infomative IMO.
there's a live version here: https://greggman.github.io/webgpu-samples-iframes/ |
@greggman Can you make sure https://webgpu.github.io/webgpu-samples/samples/videoUploadingWebCodecs still redirects to https://webgpu.github.io/webgpu-samples/samples/videoUploading?videoSource=videoFrame? |
fixed screenshots |
How about loading the shaders using fetch instead? |
That doesn't seem very idiomatic. I'm only guessing most devs don't want a separate network request for each shader vs just strings in their script. |
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.
this is a huge diff and I tried to look through most of the non-sample parts but may have missed things. I skimmed most of the existing webgpu code.
I think we may as well land it and follow-up on any improvements / changes since the high level structure probably won't change significantly.
Note: This could be moved to a sample folder now (could leave a redirect for the previous url)
This PR removes react and next. It allows a sample to be pure JavaScript (though there are none at the moment, all the samples are in typescript). It allows samples to be standalone so that they run separate from the sample selection menu. (which is how they are able to run in iframes).
Note: The last 4 PRs are not merged (they're overwritten). The 3 related to redirects, AFAICT, are irrelevant after this PR. The group descriptions I can add back but this is taking much longer than expect (Have spent ~30hrs) so crossing my fingers this is ok. Open to suggestions.
Note: Originally I had changed all of the
xxx.wgsl
files toxxx.wgsl.js
and surrounded the shaders withbut I felt there were be resistance so I left it as is. We can revisit that. My issue with it is is it requires a build step and special rules. Of course typescript requires a build step too but if switch the
.wgsl
to.wgsl.js
then all you need is typescript to build and run the examples. You don't need some bundler to hack the.wgsl
files into includable files. That seems more useful for people wanting to use the samples elsewhere? OTOH the plugin to make it work is small in most build systems so I'm not 100 sure what I feel about that ATM.