Live data from Hacker News

Point of WebGPU on Native

kvark.github.io

31–40 of 98 posts

Re: Point of WebGPU on Native

#31
The author states something like:

Use XXX API and deal with bugs, incompatibilities, etc. etc.

What makes him think that this new API will be free of any of things he mentions above? As far as I can see this whole high performance graphics area has always been a wasps nest of various vendors each trying to pull the blanket to their side. I doubt adding "Web" to it will make life any easier.

Re: Point of WebGPU on Native

#32

I'm really rooting for WebGPU as the "cross-platform 3D-API for the rest of us" (where "rest of us" is everybody who isn't a highly specialized rendering engineer in an AAA-game engine team). There's "one small thing" I'd like to see in WebGPU for the native use case: an optional compile-time configuration feature which allows to pass in "backend-native" shaders so that all the runtime-shader-translation code isn't n…

> where "rest of us" is everybody who isn't a highly specialized rendering engineer in an AAA-game engine team Then you should be looking at WebGL, not WebGPU!

Those kind of advises would make sense if they were parallel APIs, however neither WebGL 3.0 nor OpenGL 5.0 will happen.

Re: Point of WebGPU on Native

#33
post #3

Sounds promising — would be great to know the history on why the other people who tried to make the one graphics api to rule them all failed? Seems like that could be helpful in the whole “learning from the past thing”.

Because hardware vendors don't want one. Lock-in when you are leading your particular niche gives big profits, so companies go for it.

That is why Microsoft, Sony, NVIDIA, Apple, Xilinx, etc. create their own platforms and APIs.

Re: Point of WebGPU on Native

#34
post #32

Earlier quoted context omitted.

> where "rest of us" is everybody who isn't a highly specialized rendering engineer in an AAA-game engine team Then you should be looking at WebGL, not WebGPU!

Those kind of advises would make sense if they were parallel APIs, however neither WebGL 3.0 nor OpenGL 5.0 will happen.

They say they are not making an AAA engine. They are looking for a simple way to get into graphics. They have no need for parallel, low-level APIs.

Re: Point of WebGPU on Native

#35

Earlier quoted context omitted.

There's no Vulkan on MacOS/iOS (though there may be some 3rd party library that will translate to Metal).

MoltenVK is the most prominent Vulkan to Metal translation library. Technically, it's a 1st party library, since it's the core of the Khronos Group's Vulkan SDK on mac/iOS. https://github.com/KhronosGroup/MoltenVK

It's not 1st party. Up to the very recent, the whole SDK was a "LunarG SDK" for a reason - it wasn't 1st party either. It's basically just somebody packing up a bunch of useful libraries together.

Re: Point of WebGPU on Native

#36

Earlier quoted context omitted.

There's no Vulkan on MacOS/iOS (though there may be some 3rd party library that will translate to Metal).

While true this boils down to "Apple won't support anything it doesn't have control over", as demonstrated by them using veto power to pick WebGPU's shader language (a custom one) instead of using the shader IR literally everyone else wanted. It doesn't make a ton of sense to evaluate the success of APIs and standards this way because Apple has a long track record of refusing to implement stuff or deprecating it once…

That paints Apple in a wrong light. They agreed on the WebGPU Shading Language proposed by Google (!) (previously called "Tint"). This is something Google is interested in, as well.

Re: Point of WebGPU on Native

#37
post #32

Earlier quoted context omitted.

Those kind of advises would make sense if they were parallel APIs, however neither WebGL 3.0 nor OpenGL 5.0 will happen.

They say they are not making an AAA engine. They are looking for a simple way to get into graphics. They have no need for parallel, low-level APIs.

> Please don't comment about the voting on comments. It never does any good, and it makes boring reading.

https://news.ycombinator.com/newsguidelines.html

In this case specifically I'd just use the second half of your comment, the first half just detracts from the message and sounds petty.

Re: Point of WebGPU on Native

#38
post #37

Earlier quoted context omitted.

They say they are not making an AAA engine. They are looking for a simple way to get into graphics. They have no need for parallel, low-level APIs.

> Please don't comment about the voting on comments. It never does any good, and it makes boring reading. https://news.ycombinator.com/newsguidelines.html In this case specifically I'd just use the second half of your comment, the first half just detracts from the message and sounds petty.

I edited it, but let me say I don't agree with your policy, because downvoting is reserved for high-score accounts. If it would be open to (almost) everyone, then it would be fine.

In fact, if you think about it, what is "petty" isn't talking about downvoting, but the ability to downvote itself. Flagging is fine, because trolls will always be around.

Re: Point of WebGPU on Native

#39

Earlier quoted context omitted.

I don't think getting into OpenGL is actually that hard. There are wrapper libraries, e.g. for Java, and tons of tutorials. The hardest part for beginners is probably wrapping their head around the concept of the rendering pipeline, with it's various stages. Once this is settled, it becomes much clearer what the various shaders do and how they interact with each other. So I'd higly recommend spending some time to und…

Absolutely this. I wish I had spent more time learning about the rendering pipeline before jumping into trying out so much as a "Hello Triangle" tutorial. It's also worth getting familiar with terminology early on, because common terms in the context of graphics programming have different meanings to their common usage. e.g. I've found it helpful to think of a "vertex" first and foremost as an element of an array, wh…

Unless you're in CUDA, then it's a "kernel." But in OpenCL it's still a "compute shader"?

Oy vey

Re: Point of WebGPU on Native

#40

I'm really rooting for WebGPU as the "cross-platform 3D-API for the rest of us" (where "rest of us" is everybody who isn't a highly specialized rendering engineer in an AAA-game engine team). There's "one small thing" I'd like to see in WebGPU for the native use case: an optional compile-time configuration feature which allows to pass in "backend-native" shaders so that all the runtime-shader-translation code isn't n…

Shipping compiled shaders is a feature request that pops up from time to time in gfx-rs land [1]. So far, we have been skeptical about this. Something like a serializable pipeline cache would help, but not entirely solve the shipping binary size. Although, is it really important? "Hello Triangle" may be a few megs, but the code for shader translation is a constant addition to it, so extrapolating this 5.2Mb value is not useful.

Currently, both Dawn and wgpu-native use SPIRV-Cross for translation of shaders. The plan is for both is to migrate to in-house translation. In case of wgpu, that would be Naga [2]. Sometime in the future, you could be able to include it with only WGSL -> AIR (Apple's shader IR) code path compiled in, without anything else. Could be good enough for the code size? :)

  [1] https://github.com/gfx-rs/gfx/issues/3117
  [2] https://github.com/gfx-rs/naga
Post reply on HN