top | item 46618499

(no title)

mendyberger | 1 month ago

Curious, why use web-sys directly instead of wgpu?

discuss

order

dakom|1 month ago

Mostly because I want insight and control at a lower level, which breaks down into two different use-cases:

1. Debugging. The nature of bugs in this space is a lot more of "it doesn't look right on the screen" as opposed to "it breaks compilation", so I want to easily do things like peek into my buffers, use native js logging, etc. It's just a lot easier for me to reason about when I have more manual control.

2. Leaky abstractions. wgpu is a pretty low-level but it can't avoid the pain that comes with different backends, async where it should it shouldn't be, features that aren't available everywhere, etc.

That said, it would probably be pretty straightforward to convert the renderer into wgpu, most of the data structures and concepts should map cleanly

mendyberger|1 month ago

Fair enough.

For me, having wgpu's rust native api feels so much nicer than having to deal with the unergenomic web_sys api. Tradeoffs.