3 ms·
> That would mean they would need to have a proper parser for a half dozen shader models. It avoids this entirely. If you're on a system whose GPU driver only
by davexunit 2y ago
> That would mean they would need to have a proper parser for a half dozen shader models.
It avoids this entirely. If you're on a system whose GPU driver only speaks DXBC and you hand it SPIR-V, that would be an error. This is what SDL GPU does. The SDL team conveniently made a small library that can cross-compile SPIR-V to the other major bytecode formats that you can integrate into your build pipeline.
- LinAGKar 2y agoThat obviously wouldn't work for the web though, since it would make webpages OS-specific
- vetinari 2y agoNot only that; passtrough to real gpu hardware on the web is a quick way to get 0wned. The GPU drivers - and a bunch of hardware too - are not robust enough to be exposed this way. So WebGL and WebGPU filter and check anything between webpage and the real hardware.
- beeflet 2y agoWebGL and WebGPU are still major vectors for device fingerprinting. In an ideal world, GPU access would result in a browser popup like location services and notifications currently do. But admittedly this is not the only major vector for fingerprinting. I would also say that User-agent shouldn't be a header but an autofilliable form input, and that cookies should be some transparently manageable tab in the address bar (and should be renamed to something more comprehensible to the average person like "tokens" or "tickets").
- davexunit 2y agoIf only there were a shader IR that was made with portability in mind!
- beeflet 2y agoWebGL sort of makes webpages API-specific already by pretty much forcing them to implement OpenGLES. I think if anything SPIR-V is less imposing on the OS because you don't have to implement the whole GLSL front of the compiler and you can just deal with the intermediary. You end up with a strange situation where a company like apple doesn't want to support OpenGL or provide a translation layer in their OS, but they effectively end up doing so in their browser anyways. But the downside of GLSL I think is that you make the web less "open" because GLSL (or whatever SL) isn't immediately transparent to the user. In the same way we usually expect to open up a webpage and inspect the javascript (because it is typically not minified by convention) whereas the introduction of WASM will require a decompiler to do the same. The web so far has been a kind of a strange bastion for freedom with adblockers and other types of plugins being able to easily modify webpages. In the future this will be more difficult with web apps as it would amount to decompiling and patching a portable executable (flutter, etc).