diff --git a/glslang/CInterface/glslang_c_interface.cpp b/glslang/CInterface/glslang_c_interface.cpp index dd8a2fdc..bf00b4e0 100644 --- a/glslang/CInterface/glslang_c_interface.cpp +++ b/glslang/CInterface/glslang_c_interface.cpp @@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "StandAlone/DirStackFileIncluder.h" #include "glslang/Public/ResourceLimits.h" +#include "glslang/Public/ShaderLang.h" #include "glslang/Include/ShHandle.h" #include "glslang/Include/ResourceLimits.h" @@ -54,6 +55,7 @@ static_assert(int(GLSLANG_REFLECTION_COUNT) == EShReflectionCount, ""); static_assert(int(GLSLANG_PROFILE_COUNT) == EProfileCount, ""); static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), ""); static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), ""); +static_assert(sizeof(glslang_version_t) == sizeof(glslang::Version), ""); typedef struct glslang_shader_s { glslang::TShader* shader; @@ -141,6 +143,11 @@ private: void* context; }; +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version) +{ + *reinterpret_cast(version) = glslang::GetVersion(); +} + GLSLANG_EXPORT int glslang_initialize_process() { return static_cast(glslang::InitializeProcess()); } GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); } diff --git a/glslang/Include/glslang_c_interface.h b/glslang/Include/glslang_c_interface.h index f11079ed..459b1216 100644 --- a/glslang/Include/glslang_c_interface.h +++ b/glslang/Include/glslang_c_interface.h @@ -41,6 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. typedef struct glslang_shader_s glslang_shader_t; typedef struct glslang_program_s glslang_program_t; +/* Version counterpart */ +typedef struct glslang_version_s { + int major; + int minor; + int patch; + const char* flavor; +} glslang_version_t; + /* TLimits counterpart */ typedef struct glslang_limits_s { bool non_inductive_for_loops; @@ -249,6 +257,8 @@ extern "C" { #define GLSLANG_EXPORT #endif +GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version); + GLSLANG_EXPORT int glslang_initialize_process(void); GLSLANG_EXPORT void glslang_finalize_process(void);