4 ms·
GLSL+glslang+SPIR-V was one of the suggested approaches for developers that want to compile GLSL at runtime on the web. Google has been working on getting a mi
by Jasper_ 7y ago
GLSL+glslang+SPIR-V was one of the suggested approaches for developers that want to compile GLSL at runtime on the web.
Google has been working on getting a minimal form of glslang out the door, but they're having trouble because glslang is a pretty big beast.
- magicalist 7y agoBut presumably if that was the eventually standardized format the compiler could ship with browsers, though, right? It just seems weird to compare against another format that hasn't been agreed to either but they shipped the compiler with the browser preview so people can test it. It should either be comparing sources or comparing (source + compiler to get it working in a shipping stable browser), not mixing the two.
- kvark 7y agowell, one of the points to go with SPIR-V is to not standardize higher level languages that translate into it
- om2 7y agoThe proposal from SPIR-V advocates is to not ship any high level language compiler with the browser. That could change, but currently no one is excited about accepting both a binary language and a text-based language.
- saurik 7y agoWhy would you expect people to ship a compiler though? Like: when I want to do runtime code generation on .NET, I don't concatenate strings containing C# and run them through a C# compiler... that would be madness!!... instead I use the APIs provided to do IL generation, which have been extremely amazing essentially since day one and provide unbounded flexibility over working with any specific textual language. If I really really wanted a compiler at runtime, maybe I want a different one, and I can then use differently models like F# or a Lisp variant... things that are much harder if someone insists I translate everything into some silly specific language :/.
- pjmlp 7y agoWhat you are describing is exactly shipping a compiler, the JIT compiler bundled in the .NET Framework and Core runtimes. You cannot do that in .NET Native, for example.
- om2 7y agoShipping support for both a text format and a binary format directly in the browser is in some ways the worst of both worlds. If both are implemented natively, you get double the attack surface at the ingestion layer. If the text format is supported by compiling to the binary format (or vice versa) using WASM that happens to ship with the browser, it will probably be slow (whereas ingesting a text format directly seems pretty fast).