Live data from Hacker News

A Guide to Rust Graphics Libraries as of 2019

wiki.alopex.li

11–20 of 27 posts

Re: A Guide to Rust Graphics Libraries as of 2019

#12
post #7

Earlier quoted context omitted.

The first link I included has a wonderful diagram of this (but from the perspective of HLSL instead of GLSL), the gist of it is: GLSL gets compiled to SPIR-V ahead of time by a compiler of your choice (probably glslangValidator). You can take that binary blob and feed it into Vulkan (vkCreateShaderModule) or OpenGL (glShaderBinary as long as you have the right extension). For everything else, Khronos has a tool calle…

Thanks so much for explaining how that works :) Is it just me or does decompiling the binary SPIR-V to ESL/HLSL source code then recompiling sound like a recipe for massive inefficiency? Or in practice does it work out pretty nicely?

Yes, it's absolutely inefficient but for those platforms it's the only way to execute your own code on the GPU. Metal has a bitcode format that I know nothing about and I believe older DirectX had some intermediate format that was binary. Both are proprietary and only documented via reverse-engineering, so they're not great targets.

Most of the extra cost of feeding in SPIR-V could also be offset if you generate the text shader code at compile/packaging time so that those builds don't have the original SPIR-V in them.

Re: A Guide to Rust Graphics Libraries as of 2019

#16

>OpenGL: Basically Javascript for GPU’s. Everyday we stray further from god's light.

Yeah, that comment you cited is unbelievably misinformed.

I had a visceral reaction to that sentence too, but read the rest of the paragraph. It's not wrong in the way the author meant it. The author is saying that OpenGL is like JavaScript because it's high level, it's open and supported everywhere, it was designed in the 90s in a very different ecosystem to what we have today, and even though it's been updated and the old versions are no longer worth using (ECMAScript 3 and OpenGL 2.1,) the new versions still have a bunch of weird historical baggage. I don't see anything wrong with that.

Re: A Guide to Rust Graphics Libraries as of 2019

#17
Very good deep-dive, but I'm surprised there was little mention of the higher-level libraries that do exist already. I've found kiss3d and three-rs, both of which seem pretty early but appear to let you "load a model you made in Blender and show it on screen".

Re: A Guide to Rust Graphics Libraries as of 2019

#18

>OpenGL: Basically Javascript for GPU’s. Everyday we stray further from god's light.

Yeah, that comment you cited is unbelievably misinformed.

Is it? Implementation of OpenGL basically a browser. It's a virtual machine that executes GLSL with garbage collector and other quirky stuff.
Post reply on HN