5 ms·
I've been looking around, and it seems WebGPU is doing the same things we've been using WebGL for. Is it a more generic interface that also allows for arbitary
by pickdenis 7y ago
I've been looking around, and it seems WebGPU is doing the same things we've been using WebGL for. Is it a more generic interface that also allows for arbitary computation? (a la GPGPU)
- kvark 7y agoMore capable (compute) and modern: command buffers, passes, pipeline states, bind groups, multi-threading.
- networkimprov 7y agoSuperb toolkit for ads mining cryptocurrency :-/ Or even whole sites! Maybe it's the long-sought revenue model for journalism ;-)
- shurcooL 7y agoWebGPU to WebGL is like Metal/Vulkan to OpenGL.
- kbumsik 7y ago> it seems WebGPU is doing the same things we've been using WebGL for. Not really the same though, the purpose of WebGPU is exposing a sandboxed GPU hardware directly to the web, not exposing just a graphical API like WebGL exposes OpenGL variants. It currently is looking at being SPIR-V compatible. As both Vulkan and OpenCL supports SPIR-V we might use WebGPU for GPGPU in the future.
- shmerl 7y agoGood thing SPIR-V approach prevailed, despite Apple trying to derail it.
- kvark 7y agoThere is no resolution for this question yet, too early to celebrate anything.
- shmerl 7y agoAh, I see, thanks for clarifying. I misread the post then, since it mentioned SPIR-V. Too bad Apple not only refuse to support Vulkan, but try to prevent using SPIR-V as well.
- kvark 7y agoThey just want to make sure we aren't depending on Khronos too much. It's a reasonable thing to want for the group. As for Firefox, the WebGPU implementation uses the infrastructure we have for Vulkan Portability, and so consuming SPIRV is natural.
- pjmlp 7y agoWhat I care about is having a modern shading language not stuck being a C dialect, and good GPGPU debugging. If whatever Apple does forces Khronos to be more innovative, moreso the better. Without CUDA's winning strategy regarding multi-language support, SPIR-V and SYSCL would never had happened.
- deleted 7y ago[deleted]
- pcwalton 7y agoMetal Shading Language is a C++ dialect. HLSL is as much of a C dialect as GLSL is. And I would argue that C++ provides no benefits over C for shading languages. I prefer GLSL to Metal Shading Language.
- AlexMax 7y agoDid SPIR-V actually "prevail", or is Apple going to continue implementing WSL regardless of where the standard goes?
- shmerl 7y agoNot sure really. Apparently it's not yet resolved, which means Apple are still trying to derail things.
- gfxgirl 7y agoI'm not entirely convinced spriv is good for webdev. imagine the only way to code in a browser was to use an offline compiler to emit byte code. some people might like that but I'd argue there have been many indirect benefits to having the text version of JavaScript be the default on the web. sure there will be workarounds like building your own DSL to spriv compiler and including it on your page but I'd argue a standard high level text format leads to more collaboration / standardization / interop / knowledge sharing I'm sure others would prefer the web had just started as sandboxed assembly
- shmerl 7y agoSPIR-V already has a lot of collaboration, and will provide natural synergy with non Web use cases, since it's the standard bytecode format for shaders there already. So collaboration argument goes for SPIR-V here. Human readability of the shader shipped from the page is a different argument, and it can have some merit, but the same could be argued against using WebAssembly for instance which is not very human readable in comparison with JavaScript. I don't think it's a strong argument against using it.
- Jasper_ 7y agoI've had enough experience with deploying GLSL on many Android devices and also WebGL to be disillusioned with it. There's no great modern textual shading language out there, GLSL is missing a lot of modern niceities, HLSL isn't really an "independent language" (could talk more about that), and Apple's WHLSL/WSL proposal is drastically underspec'd to the point of hilarity. I think if you want to compile shaders from source, you are free to include your favorite transpiler as WebAssembly, like glslang. That's currently what I'm doing for my WebGPU prototype project.
- tomjakubowski 7y agoAs someone who's only used GLSL of all the shader languages, what are some of the modern features it's missing?
- Jasper_ 7y ago
- deleted 7y ago[deleted]
- Jasper_ 7y agoVulkan and OpenCL use two drastically different profiles of SPIR-V. You cannot just take OpenCL kernels and run them as compute shaders, huge portions of the execution model are different.
- floatboth 7y agoSome googlers are working on OpenCL source to Vulkan-profile-SPIR-V though: https://github.com/google/clspv https://github.com/google/clspv
- banachtarski 7y agoNo absolutely not (although compute shaders will be a thing). WebGL1 : DirectX9 :: WebGPU : DirectX12 Or WebGL1 : OpenGLES1 :: WebGPU : Vulkan