3 ms·
First I'm hearing of this. Got a link? Related reading: remember that time a bug in Firefox's WebGL let an attacker grab a screenshot of your whole monitor? h
by MaxBarraclough 8y ago
First I'm hearing of this. Got a link?
Related reading: remember that time a bug in Firefox's WebGL let an attacker grab a screenshot of your whole monitor?
https://blog.mozilla.org/security/2011/06/16/webgl-graphics-memory-stealing-issue/ https://blog.mozilla.org/security/2011/06/16/webgl-graphics-... , https://news.ycombinator.com/item?id=16457791 https://news.ycombinator.com/item?id=16457791 , https://www.contextis.com/blog/webgl-a-new-dimension-for-browser-exploitation https://www.contextis.com/blog/webgl-a-new-dimension-for-bro... , https://www.contextis.com/blog/webgl-more-webgl-security-flaws https://www.contextis.com/blog/webgl-more-webgl-security-fla...
- mrec 8y agoNot GP, but I think the ossification of WebGL has little to do with security concerns and a lot to do with the fact that the GL model is a poor fit to the direction hardware has taken over the past couple of decades. Realistically, any successor is going to be benchmarked to within an inch of its life too, so the same worry would apply. The shape of that successor is still very vague, but it'll probably be closer to the Vulkan/Metal/DX12 generation. Various interested parties have been putting together exploratory proposals (see e.g. Mozilla's Obsidian), and Khronos appears to be accepting that "Vulkan everywhere" ain't going to happen and working on a "3D portability" initiative that's pretty much lowest-common-denominator. That would almost certainly have a web binding if it pans out. Disclaimer: I don't work in this area, I just follow it out of morbid curiosity. A few links: https://www.khronos.org/api/3dportability/ https://www.khronos.org/api/3dportability/ http://floooh.github.io/2016/08/13/webgl-next.html http://floooh.github.io/2016/08/13/webgl-next.html https://www.phoronix.com/scan.php?page=news_item&px=Mozilla-Obsidian-Graphics-API https://www.phoronix.com/scan.php?page=news_item&px=Mozilla-...
- skocznymroczny 8y ago> Khronos appears to be accepting that "Vulkan everywhere" ain't going to happen and working on a "3D portability" initiative that's pretty much lowest-common-denominator. That would almost certainly have a web binding if it pans out. this isn't actually such a bad idea. Right now, WebGL isn't OpenGL everywhere either. It's "OpenGL where possible but Direct3D on Windows because OpenGL drivers used to be terrible". Likewise, it might not be such a bad idea to create a common graphics API, which will use Direct3D 11/Vulkan on Windows, Metal on macOS and Vulkan on Linux
- MaxBarraclough 8y ago> Likewise, it might not be such a bad idea to create a common graphics API, which will use Direct3D 11/Vulkan on Windows, Metal on macOS and Vulkan on Linux So, a higher-level graphics API. Like WebGL? I'm not just being facetious - if we're ruling out a low-level API like Vulkan, aren't we back to square one? What's wrong with WebGL that could be fixed with an API like you describe?
- gmueckl 8y agoWebGL is modelled after the worst part of OpenGL: hardware state is presented as something that can be altered by the application software at any time in any way, no matter how brain dead the change actually is. Instead of preventing the user to from writing slow rendering code on top of that interface, it actively encourages that. The new generation of interfaces are based on the tenet that most of the state information is known in advance anyway and can be precompiled into static opaque handles which represent precomputed and sanity-checked hardware register values that the driver just needs to push when required instead of having to run the heavy checking again each time the user calls some glEnable/glDisable or other state altering shenanigans. I think that a new JavaScript interface that is modelled like this, but is sufficently high level, might be faster, easier to use and safer to implement than what we currently have.
- MaxBarraclough 8y agoYou clearly know a lot more than I do - so that kind of thinking is reflected in the architectures of Direct3D 12/Vulkan/Metal? Could an indirection layer really be practical? (Vaguely related: Zed Shaw's blog post on Indirection Is Not Abstraction, https://zedshaw.com/archive/indirection-is-not-abstraction/ https://zedshaw.com/archive/indirection-is-not-abstraction/ )
- gmueckl 8y agoI don't understand what you mean here. You definitely can't expose Vulkan to untrusted code because it is designed to have a very high level of trust between driver and application - the driver is quite likely to crash the whole system on bad input. And there are countless possibilities for bad input in this interface. So what you need for browsers is an interface that keeps the general ideas of flexible buffer usage and immutable state objects, but puts the user in a rubber cell with heavily padded levers. It can be done, but it likely can't have the full flexibility of DX12/Vulkan/... with memory aliasing etc.
- yig 8y agoIt's called WebGPU. All the major players are cooperating. The mailing list reveals quite active biweekly meetings. https://www.w3.org/community/gpu/ https://www.w3.org/community/gpu/
- MaxBarraclough 8y agoThanks! I had no idea about that project.
- blablabla123 8y agoSorry, that's actually only true for WebCL. https://www.khronos.org/webcl/public-mailing-list/archives/1612/msg00001.php https://www.khronos.org/webcl/public-mailing-list/archives/1... According to this post the future lies in WebVulkan - which is both computing and graphics. On the other hand people from the big companies including Google and Apple are working on WebGPU. That said, and having worked on a complex WebGL project myself where my colleagues were complaining all the time how bad WebGL is (sorry, won't search the references for that though :P), I wonder how there can possibly be any future for it.
- MaxBarraclough 8y agoAh yes, WebCL. A web standard too far. I recall Mozilla saying they wouldn't bother implementing it as people could just use compute shaders in WebGL, but my understanding is that this isn't really practical even now, years later. From a quick google, I don't think there's really any such thing as 'WebVulkan'. Following the discussion above, I don't see that it would really be a good idea anyway. Wrong level of abstraction. Someone above linked to this article on 'GPU for the Web' (which I presume is what 'WebGPU' refers to), which as you say looks like it might be the successor to WebGL - https://www.w3.org/community/gpu/ https://www.w3.org/community/gpu/