mellinoe / ShaderGen

Proof-of-concept library for generating HLSL, GLSL, and Metal shader code from C#,
MIT License
497 stars 56 forks source link

[ENHANCEMENT] Parse GLSLangValidator version output in ToolChain #79

Open thargy opened 6 years ago

thargy commented 6 years ago

Running GlslangValidator -v produces an output similar to this:

Glslang Version: Overload400-PrecQual.1817 08-Feb-2017 ESSL Version: OpenGL ES GLSL 3.00 glslang LunarG Khronos.Overload400-PrecQual.1817 08-Feb-2017 GLSL Version: 4.20 glslang LunarG Khronos.Overload400-PrecQual.1817 08-Feb-2017 SPIR-V Version 0x00010000, Revision 8 GLSL.std.450 Version 100, Revision 1 Khronos Tool ID 8 GL_KHR_vulkan_glsl version 100 ARB_GL_gl_spirv version 100

When multiple versions of GlslangValidator are found on the same system (local directory, path, Vulkan SDK, etc.) it would be nice to pick the latest automatically by picking the latest version (by parsing this output). For bonus points, we can see which version of each spec. is supported.

thargy commented 5 years ago

An alternative/better approach is suggested in #94, however, if we maintain a fallback this would still be useful (the value of such a fallback if #94 is implemented is debatable, unless we compare the version of the exe to the wrapped library and find it is newer and so use in preference).