5 ms·
This is really cool. As far as boilerplate goes WebGPU is really not that bad (one just needs to look at Vulkan to see how fun it can get) but really anything t
by stanleykm 3y ago
This is really cool. As far as boilerplate goes WebGPU is really not that bad (one just needs to look at Vulkan to see how fun it can get) but really anything to lower the barrier to entry is nice.
I am curious about the API overhead here. For example if I run two separate passes using bare WebGPU I could use a single command encoder. Would two function calls here result in two command encoders?
Another question - from the example code this doesnt look asynchronous, does it wait for everything to finish before returning? I could also be misreading the code I dont know typescript very well.
- jrmydev 3y agoThanks, and great question: Shadeup will try to fit it all into one command encoder but may need to split if the coder: 1. Manually flushes 2. Reads/downloads a buffer on the CPU Most calls are lazily evaluated, and a small dep graph is built as you reference/draw things. That being said, shadeup does make some perf sacrifices in the name of simplicity. I'd say it's well suited to prototyping and learning. Of course, once you have a working prototype of something porting it to native wgsl should be easy
- stanleykm 3y agoOh nice thanks for the explanation.
- burntcaramel 3y agoHave you thought about having an "eject" command? For example, Create React App had an eject command to go from the self-contained version to a full customisable Webpack app.
- jrmydev 3y agoUsers can already kinda do this by showing the compiled output, but the js engine itself is still tucked away. At some point, I would probably have a tree shaken full output for each shadeup.
- pjmlp 3y agoWebGPU main pain point is forcing everyone to rewrite their shaders, no wonder most Web native game engines are going the shading language abstraction route, when only Chrome does WebGPU on desktop, and it isn't even an option on mobile years to come. Thus cross API WebGL / WebGPU shading middleware is needed.
- greggman7 3y agoIIRC, WebGPU is shipping on Android in ~4 days Safari Technology Preview finally turned it on again. Of course when Apple will ship it on Mac and/or iOS is unknown but at least they showed some progress after hiding for 6 or more months Firefox is doing their best to ship ASAP.
- adastra22 3y agowgpu is a nice implementation of webgpu for native rust applications on desktop.
- pjmlp 3y agoI don't see a point of that versus middleware engines, with much better tooling. WebGPU/WebGL are like JavaScript, something that we have to put up with, because on the browser there is no other alternative. No need to constrain ourselves to the browser limitations when there are other options.