4 ms·
Call me dumb but I'm always confused with SPIR-V. Does it have any relationship with Vulkan or OpenGL?
by kbumsik 7y ago
Call me dumb but I'm always confused with SPIR-V. Does it have any relationship with Vulkan or OpenGL?
- simcop2387 7y agoYes. Its the underlying "language" of shader programs in vulkan. OpenGL 4.6 adds support for loading spirv and a few other things like that.
- pdpi 7y agoGraphics programming is fundamentally a form of client/server programming. Your (usually) c++ is the client, shaders are the server, OpenGL/Vulkan/Direct3D are basically your client libraries to talk to the server. Your OpenGL driver has a compiler in it that JIT compiles GLSL into into shader programs your GPU can run. In this world, SPIR-V is sort of like JVM/WASM bytecode — a compilation target for shader languages, that’s a bit nicer for drivers to work with.
- kbumsik 7y ago> Graphics programming is fundamentally a form of client/server programming. Thanks, in that way it is a lot easier to understand. So do you mean GLSL would be compiled into SPIR-V?
- pdpi 7y agoYup! https://vulkan.lunarg.com/doc/view/1.0.39.1/linux/spirv_toolchain.html https://vulkan.lunarg.com/doc/view/1.0.39.1/linux/spirv_tool... Microsoft actually has an HLSL to SPIR-V compiler too. https://github.com/microsoft/DirectXShaderCompiler/blob/master/docs/SPIR-V.rst https://github.com/microsoft/DirectXShaderCompiler/blob/mast...