Live data from Hacker News

Wgpu-0.10 released: WebGPU implementation now in pure Rust

gfx-rs.github.io

41–50 of 86 posts

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#41

Earlier quoted context omitted.

Cross platform. You could build a rust app with a WebGPU target that runs across web and native.

Ah nice, I see. Any particular reason for Rust being used? Just curious, because I would (naively) expect to see similar projects with Golang, C++ etc but I really only see Rust.

This implementation is developed by firefox (at least, last I checked). Google has an implementation along similar lines in C++ called dawn, and I'm pretty sure webkit plans to use dawn. So you see them in Rust/C++, but no one has written an implementation in go afaik.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#42

Earlier quoted context omitted.

Cross platform. You could build a rust app with a WebGPU target that runs across web and native.

Ah nice, I see. Any particular reason for Rust being used? Just curious, because I would (naively) expect to see similar projects with Golang, C++ etc but I really only see Rust.

Rust is great for this!

Google has an implementation of WebGPU called Dawn, which is quite impressive. It's written in C++.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#43
post #40

Earlier quoted context omitted.

Does wgpu finally support OpenGL?

Yeah, we support OpenGL ES-3.0 with a few major caveats.

That’s awesome. Wgpu did not support a single Linux machine I tried it on, all with various hardware/driver combos, back when OpenGL wasn’t available and later when it was first previewed. It was the only reason I used a different abstraction.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#44
post #41

Earlier quoted context omitted.

Ah nice, I see. Any particular reason for Rust being used? Just curious, because I would (naively) expect to see similar projects with Golang, C++ etc but I really only see Rust.

This implementation is developed by firefox (at least, last I checked). Google has an implementation along similar lines in C++ called dawn, and I'm pretty sure webkit plans to use dawn. So you see them in Rust/C++, but no one has written an implementation in go afaik.

For all we know, Safari on Windows(!) is going to use Dawn. But anything on Apple platforms isn't quite clear. They may get their own implementation.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#45

Earlier quoted context omitted.

Cross platform. You could build a rust app with a WebGPU target that runs across web and native.

Ah nice, I see. Any particular reason for Rust being used? Just curious, because I would (naively) expect to see similar projects with Golang, C++ etc but I really only see Rust.

[deleted]

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#46
post #41

Earlier quoted context omitted.

Ah nice, I see. Any particular reason for Rust being used? Just curious, because I would (naively) expect to see similar projects with Golang, C++ etc but I really only see Rust.

This implementation is developed by firefox (at least, last I checked). Google has an implementation along similar lines in C++ called dawn, and I'm pretty sure webkit plans to use dawn. So you see them in Rust/C++, but no one has written an implementation in go afaik.

A Go implementation would only be usable from Go, whereas Rust and C++ can export a C API that many different languages can use.

Plus, using system libraries (DirectX, Villain, Metal, OpenGL) from Go would be a pain and possibly suffer worse from the FFI penalties than just using a higher level library written in Rust/C++ to begin with.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#47
post #44
post #41

Earlier quoted context omitted.

This implementation is developed by firefox (at least, last I checked). Google has an implementation along similar lines in C++ called dawn, and I'm pretty sure webkit plans to use dawn. So you see them in Rust/C++, but no one has written an implementation in go afaik.

For all we know, Safari on Windows(!) is going to use Dawn. But anything on Apple platforms isn't quite clear. They may get their own implementation.

The Windows version of Safari was discontinued in 2012.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#48
post #34

Earlier quoted context omitted.

> platforms APIs still alive. The APIs that currently exist are not the cause of the potential issue I am raising.

And without knowing what those future APIs are like, you can't design a future-proof backend API to handle it. You'll design it for the past problems which will be different than future ones.

What you can do is design a backend for your project that is less general and tailored to your specific problems so as to increase the likelihood that it is easier to implement on new platforms that may arise. This is why I mentioned the “rule of least power”

For example using drawTriangle(p1, p2, p3) instead of drawPolys(TYPE_TRIANGLE, point_list, n_points). The former is unequivocally easier to implement, the latter requires more complexity.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#49
post #34

Earlier quoted context omitted.

And without knowing what those future APIs are like, you can't design a future-proof backend API to handle it. You'll design it for the past problems which will be different than future ones.

What you can do is design a backend for your project that is less general and tailored to your specific problems so as to increase the likelihood that it is easier to implement on new platforms that may arise. This is why I mentioned the “rule of least power” For example using drawTriangle(p1, p2, p3) instead of drawPolys(TYPE_TRIANGLE, point_list, n_points). The former is unequivocally easier to implement, the latte…

And it has been explained to you repeatedly that wgpu is already more or less "least power" - that Bevy already uses most of the API surface and will soon be using nearly all of it.

Re: Wgpu-0.10 released: WebGPU implementation now in pure Rust

#50
post #40

Earlier quoted context omitted.

Yeah, we support OpenGL ES-3.0 with a few major caveats.

That’s awesome. Wgpu did not support a single Linux machine I tried it on, all with various hardware/driver combos, back when OpenGL wasn’t available and later when it was first previewed. It was the only reason I used a different abstraction.

What abstraction did you use?
Post reply on HN