by stanleykm · 2y ago · 0 comments
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.
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
Thus cross API WebGL / WebGPU shading middleware is needed.
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.
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.