5 ms·
Raw WebGPU
- mschuetz 7y agoI'm extremely excited for WebGPU. Support for Compute Shaders and efficient batching of various tasks such as setting shader uniforms are going to be game changers with respect to power and performance of 3D graphics and GPGPU in web browsers. Right now, Chrome Canary on windows crashes for me when I try WebGPU, unfortunately.
- kvark 7y agoWithout push constants or persistently mapped uniform buffers, it's a long stretch to call our way of setting uniforms "efficient"...
- Jasper_ 7y agoI've lost track of the many buffer management proposals up in the air. What's the current motion? Would love to see devh's range tracking proposal brought back from the dead, but that's probably unlikely for MVP at this stage.
- kvark 7y agoCurrent motion is maybe we'll get a Queue::setBufferSubData and setTextureSubData, or not. And even if we get them, it's problematic to allow the copy to be direct if this part of the buffer isn't used (while some other part is used) by the GPU.
- imjasonmiller 7y agoThis is great and I would love to try this out. Unfortunately, support for Linux seems to be lacking? It’s definitely one of the web technologies I’m very excited about.
- kvark 7y agoYou can play with the native implementations on Linux for now, such as wgpu and Dawn, with an ability to build for the web in the future.
- sesuximo 7y agothis sounds cool, but why do we need it? why can't the web directly expose opengl?
- fulafel 7y agoUntrusted JS can't be given direct access to native graphics APIs because they are not hardened against malicious code. (Or even benign code, it sometimes feels like...) Hence WebGL/WebGPU.
- sesuximo 7y agothis was my first thought, but I don't know what kind of malicious code a GPU can run
- klhiouyter 7y agoFirst of all, your code passes through the driver, so you can exploit vulnerabilities there. Even after that, the GPU can do DMA requests, so you can abuse that to read/write arbitrary memory locations.
- sesuximo 7y agook makes sense. didn't know it could access arbitrary memory
- fulafel 7y agoGraphics APIs are defined and implemented in memory-unsafe languages on the CPU side, C/C++, and will read from and write to memory based on data and pointers you pass to them without any provisions for untrusted data. -> instant pwnage (Not to say GPU code execution is safe, but you wouldn't need it to ruin the users day)
- kevingadd 7y agoGPUs effectively have general-purpose compute now and they can DMA bytes into and out of system memory. At a basic level, sneaky on-GPU code run by an attacker could grab pixels off your screen (text from your emails, etc), but it's also possible for the GPU-based attack code to harvest data from system memory or even mess with data in order to attack a process running on the CPU.
- nojs_reader 7y agoThis article can't be read without Javascript enabled. The following methods don't work to make the article readable: - (X) disabling CSS - (X) requesting a different URL - (X) viewing through Firefox Reader Mode - (X) viewing through Wallabag - (X) reading the article source in a Github/Gitlab repo As a last fallback when every other method fails, the raw HTML of this post is visible at https://pastebin.com/XfjtC5w8 https://pastebin.com/XfjtC5w8. If there's a reading method available that doesn't require JS, let us know. Author notes: The text for this article is present in the original HTML, it's just encoded into a string which is stored inside a script tag and written to the body. As a quick fallback, consider storing this string in the DOM rather than in a script tag, and then using CSS to hide it. Forcing users to manually disable CSS to get around JS-requirements is considered an acceptable tradeoff for applications like Foilfolio, which want to do transformations on text before displaying to the user.
- moondev 7y agoAre there any examples of using webgpu for remote desktop applications?
- domenicd 7y ago> Raw > TypeScript What?
- TomMarius 7y agoIs "raw" reserved only for chemical elements now? Or maybe atomic nuclei only?
- macawfish 7y agoI'm excited about having the option to generate portable SPIR-V shaders from a wide range of languages (GLSL, HLSL, Julia, Rust, OCaml and others). I understand that SPIR-V is an excellent, flexible intermediate representation... I really hope it ends up as the shader language of WebGPU. (Apple is trying to sabotage SPIR-V and it'll be really disappointing if they succeed.)
- CharlesW 7y agoIf by "Apple is trying to sabotoge" you mean "Apple has no plans to support", https://webkit.org/blog/8482/web-high-level-shading-language/ https://webkit.org/blog/8482/web-high-level-shading-language... goes into some detail about why SPIR-V bytecode isn't a good fit for them specifically, and reasonable (IMHO) arguments for why SPIR-V isn't a good fit for the web in general. As SPIR-V is an intermediate language, I am curious how you imagine this would affect you. Mind elaborating?
- Jasper_ 7y agoLet me offer a rebuttal to that page. > First, SPIR-V was not written with security as a first principle, and it’s unclear whether it can be modified to satisfy the security requirements of the web. At the time of this post's authoring, Google already had a set of SPIR-V restrictions to make it suitable for the web [0]. The only response from Apple I heard was "it doesn't have tests", but, again, it had more than WSL at the time [1]. [0] https://github.com/gpuweb/spirv-execution-env/blob/master/execution-env.md https://github.com/gpuweb/spirv-execution-env/blob/master/ex... [1] https://github.com/KhronosGroup/SPIRV-Tools/blob/master/test/val/val_webgpu_test.cpp https://github.com/KhronosGroup/SPIRV-Tools/blob/master/test... > Forking the SPIR-V language means developers would have to recompile their shaders, possibly being forced to rewrite their source code anyway. They might have to rewrite some small portions of their shader code to target WebGPU, or run some preprocessing tools to validate it. I don't think this was ever a problem. This is basically saying "if they have to change it anyway, why not rewrite it in an entirely new language", but most realistic shader code would be unaffected. > Additionally, browsers would still be unable to trust incoming bytecode, and would be required to validate programs to make sure they are not doing anything insecure. Browsers need to validate WSL/WHLSL too for things like out-of-bounds array accesses. > And since Windows and macOS/iOS don’t support Vulkan, the incoming SPIR-V would still need to be translated/compiled into another language. This is also true for WSL/WHLSL. But SPIR-V has a leg up here, as existing community cross-compile tools like SPIRV-Cross exist [2]. [2] https://github.com/KhronosGroup/SPIRV-Cross/ https://github.com/KhronosGroup/SPIRV-Cross/ The argument that we have against WSL/WHLSL is that we do not trust the developers of these specifications to correctly understand the GPU programming environment, and involving IHVs in WSL/WHLSL's design is a waste of time, when they have already produced SPIR-V over many years.
- deleted 7y ago[deleted]
- abvdasker 7y agoForgive my ignorance of GPU programming. I'm genuinely curious -- how does this differ from WebGL?
- alaingalvan 7y agoHey everyone, I'm the original author here, thanks for reading! WebGPU's pretty exciting stuff, a modern graphics API for the Web. Feel free to let me know if you have any suggestions/improvements! I'll keep an eye on the thread though.