Live data from Hacker News

Wgpu-rs on the web

gfx-rs.github.io

1–10 of 63 posts

Re: Wgpu-rs on the web

#2
This is really cool. I've been excitedly watching how wgpu is developing. I don't have much graphics experience outside of one ogl but it looks like it's turning into something seriously neat.

Re: Wgpu-rs on the web

#4
This is why Rust is going to eventually eat Javascript's lunch on the browser. I'm willing to longbets that by 2025 we see a Rust framework as the top browser toolkit. I'd even be willing to bet that there are popular frameworks in use by major websites that discard the DOM altogether for something simpler and faster.

There's a reason why this has to happen, too.

My sincere hope is that Mozilla and the Rust/Browser luminaries will develop cross-platform APIs for full device hardware abstraction. If we can get Rust/WASM to be able to access the same system calls, hardware resources, payment APIs, native windowing routines, etc. as the iOS and Android SDKs, then we can potentially build a cross-platform native web that is just as snappy as the two shitty walled gardens we have today.

I really hope the performant web slays the app store. That's the dumbest trap we ever fell for. I'd love to visit a website and be playing native Minecraft in seconds. Sans Google Play or the App Store, with no bullshit monopoly tax.

That would address one of the major problems in our industry.

Re: Wgpu-rs on the web

#5
post #3

Can it do sha3 hashing in a web browser on the gpu?

Yes, so does WebGL and with the same efficiency.

Partial hash inversion is an embarrassingly parallel problem: computing a hash from a random number is independent from the other random numbers you want to compute hashes for, also it is a computation bound problem and not memory bound. It means you can build a fairly efficient partial inverse finder by running many fragment shaders ("pixels") in parallel and only drawing the one that finds it. This is doable in WebGL today.

A key feature of WebGPU is compute shaders which sound like they can compute stuff so they would be better at hashing. But actually compute shaders give more flexibility which makes it possible to handle problems that are a bit less parallel, and they help optimize memory-bound programs (but don't help for computation bound programs). So compute shaders make it slightly less code to do a partial inverse finder, but do not make it dramatically more efficient.

So to answer your implicit point: no WebGPU won't unlock capabilities that will lead to a rise in ads mining Bitcoin. (though it could maybe help for Ethereum mining)

Re: Wgpu-rs on the web

#6
I could really do with a diagram to explain how all the parts fit together. gfx-rs, Vulkan, wgpu-rs, wgpu-native, browser WebGPU, gfx-hal, Vulkan Portability bindings.

Here's what i think:

1. Vulkan is an API for doing graphics which is modern and standard

2. Direct3D (part of DirectX, the names are sometimes used interchangeably), Metal, and OpenGL are APIs for doing graphics which are modern or standard

3. Vulkan, Direct3D, Metal, and OpenGL are all implemented by graphics card drivers and operating systems working together - this is pretty much the bottom of the software stack

4. gfx-hal (along with gfx-backend-*) is a Rust library which abstracts over Vulkan, Direct3D, Metal, and OpenGL; its API is similar to Vulkan, but not identical

5. The Vulkan portability bindings implement Vulkan (the "universally portable subset") on top of gfx-hal (to an extent - it seems like there are lots of little bits that can't be implemented for each backend)

6. WebGPU is an API for doing graphics which is modern, standard, and easier than Vulkan

7. WebGPU is (or soon will be) implemented directly by browers, on top of who knows what, Direct3D etc i suppose

8. wgpu-core is an implementation of (a Rust projection of) WebGPU on top of gfx-hal

9. wgpu-native is a C API on top of wgpu-core

10. wgpu-rs is a nice Rust API on top of WebGPU, which can (now!) use either a browser's WebGPU, or wgpu-native

gfx-rs is the name of the overall project.

I'm sticking to text mode.

Re: Wgpu-rs on the web

#7
post #4

This is why Rust is going to eventually eat Javascript's lunch on the browser. I'm willing to longbets that by 2025 we see a Rust framework as the top browser toolkit. I'd even be willing to bet that there are popular frameworks in use by major websites that discard the DOM altogether for something simpler and faster. There's a reason why this has to happen, too. My sincere hope is that Mozilla and the Rust/Browser l…

"Top" measured how, and how much would you like to bet?

Re: Wgpu-rs on the web

#8
post #6

I could really do with a diagram to explain how all the parts fit together. gfx-rs, Vulkan, wgpu-rs, wgpu-native, browser WebGPU, gfx-hal, Vulkan Portability bindings. Here's what i think: 1. Vulkan is an API for doing graphics which is modern and standard 2. Direct3D (part of DirectX, the names are sometimes used interchangeably), Metal, and OpenGL are APIs for doing graphics which are modern or standard 3. Vulkan,…

1. Vulkan, Direct3D, Metal, and OpenGL are all native 3D APIs on different platforms.

2. WebGPU is a new 3D API, designed to be used in browsers (but not limited to them) and implemented on top of one or more of the native APIs.

3. wgpu-native is Mozilla's implementation of WebGPU, built in Rust on top of gfx-hal, which is a Rust-specific abstraction on top of native APIs.

3. wgpu-rs is a convenience wrapper to make the API more Rust-like, which either uses wgpu-native directly, or when compiled for a browser, the browser's own WebGPU implementation.

4. Dawn is Google's implementation of WebGPU, in C++, which similarly can be used directly or through a browser.

Re: Wgpu-rs on the web

#9
post #8
post #6

I could really do with a diagram to explain how all the parts fit together. gfx-rs, Vulkan, wgpu-rs, wgpu-native, browser WebGPU, gfx-hal, Vulkan Portability bindings. Here's what i think: 1. Vulkan is an API for doing graphics which is modern and standard 2. Direct3D (part of DirectX, the names are sometimes used interchangeably), Metal, and OpenGL are APIs for doing graphics which are modern or standard 3. Vulkan,…

1. Vulkan, Direct3D, Metal, and OpenGL are all native 3D APIs on different platforms. 2. WebGPU is a new 3D API, designed to be used in browsers (but not limited to them) and implemented on top of one or more of the native APIs. 3. wgpu-native is Mozilla's implementation of WebGPU, built in Rust on top of gfx-hal, which is a Rust-specific abstraction on top of native APIs. 3. wgpu-rs is a convenience wrapper to make…

The nice side effect here is that even if you are not targeting browsers, if you want a modern, fast, usable and cross-platform 3D API, there now is one, which hasn't been the case for a long time. And there are at least two different implementations of it.

Re: Wgpu-rs on the web

#10
post #4

This is why Rust is going to eventually eat Javascript's lunch on the browser. I'm willing to longbets that by 2025 we see a Rust framework as the top browser toolkit. I'd even be willing to bet that there are popular frameworks in use by major websites that discard the DOM altogether for something simpler and faster. There's a reason why this has to happen, too. My sincere hope is that Mozilla and the Rust/Browser l…

[deleted]
Post reply on HN