6 ms·
Looks like they are using wgpu, which is the main (only?) implementation of WebGPU. Seems like WebGPU will work because everyone is going to ship the same shim
by dexwiz 6y ago
Looks like they are using wgpu, which is the main (only?) implementation of WebGPU. Seems like WebGPU will work because everyone is going to ship the same shim (wgpu) over the top of proprietary APIs.
- crowlKats 6y agoThere is also Google's Dawn implementation
- modeless 6y agoThere are three implementions of WebGPU in development for the three browser engines. Dawn for Blink and wgpu for Gecko are cross platform, and I think Apple may be doing something Metal-specific for WebKit.
- jsheard 6y agoBoth Dawn and wgpu are standalone libraries too, so applications other than Blink/Gecko can plug either in to get a Metal-ish abstraction that works everywhere It will be nice to finally have a portable 3D API that's sanely designed (unlike OpenGL) and that non-experts can be expected to handle (unlike Vulkan)
- dagmx 6y agoYep this is the reason I'm so excited by webgpu. I'd love the multi platform support of OpenGL with the features all the new APIs bring.
- singularity2001 6y agowhat makes wgpu more sanely designed than opengl? to me both look similarly horrifying: http://austin-eng.com/webgpu-samples/samples/rotatingCube?wgsl=1 http://austin-eng.com/webgpu-samples/samples/rotatingCube?wg...
- flohofwoe 6y agoWebGPU is the common cross-section of the modern 3D APIs (Metal, D3D12 and Vulkan). In general, and somewhat simplified, those APIs move all the expensive render-pipeline-configuration out of the render loop and into the initialization phase. So your code is much more "front-loaded" than GL, but once everything's initialized, the actual rendering is much less code and has much less overhead because most render-state has been pre-compiled into immutable objects. OpenGL on the other hand is a highly dynamic state machine where flipping a single "switch" can lead to expensive reconfiguration of the render pipeline during rendering.
- skocznymroczny 6y agoI've been using wgpu for quite some time (in D, through wgpu-native bindings). What exactly do you find it horrifying? It's much closer to DX12/Vulkan than OpenGL. The main difference is that it introduces the concept of a render pipeline, encapsulating all render state from shaders used, shader input layouts, vertex layouts, depth/stencil states, color attachments, which can be pre-created and then bound with a single API call. It's a big improvement over OpenGL which required you to track the state yourself or pre-emptively restore most of the state to avoid side effects between calls.
- singularity2001 6y ago132 lines for hello world (helloTriangle), just so much boiler plate. I cannot pin it down but there must be a better way, this looks like the server world before the invention of ruby on rails. Also magical values in string format: primitiveTopology: 'triangle-list', const swapChainFormat = 'bgra8unorm'; ...
- skocznymroczny 6y agoDoes Javascript have enums? I've seen these stringly typed enums often in JS APIs.
- flohofwoe 6y ago
- pjmlp 6y agoMiddleware engines is the answer to that question. WebGPU is not much easier than Vulkan, simpler yes, but still too much boilerplate to set everything up and running. https://gpuweb.github.io/gpuweb/ https://gpuweb.github.io/gpuweb/ https://gpuweb.github.io/gpuweb/wgsl.html https://gpuweb.github.io/gpuweb/wgsl.html
- flohofwoe 6y agoWebGPU is a lot simpler to use than Vulkan. The programming model is much closer to Metal than Vulkan or D3D12.
- pjmlp 6y agoEasy and simple are not the same, and one still needs to go hunting for libraries to do basic stuff like loading textures, in good old Khronos tradition.
- flohofwoe 6y agoNo other 3D API has code for loading textures either though. That stuff belongs in separate utility libraries.
- pjmlp 6y agoWhich are shipped by the same companies as the 3D APIs, on the same OS SDK, where are the Khronos utility libraries? The attempt to create an OpenGL SDK repository was a joke, and the best Vulkan SDK can offer is a tool to avoid loading all the layers by hand, as it reached the same extension spaghetti as any Khronos API.
- flohofwoe 6y agoI'm not going to defend Khronos, IMHO they are the definition of the "designed by committee" philosophy. But a simple internet search yields: https://www.khronos.org/ktx/documentation/libktx/index.html https://www.khronos.org/ktx/documentation/libktx/index.html But for cross-platform code it makes more sense anyway to use an independent cross-platform image loader library, instead of depending on the platform-specific utility APIs provided by D3DX or MetalKit.