Add C interface glslang::Version counterpart and version getter function
This commit is contained in:
parent
ebbd65501d
commit
42260d1f6d
2 changed files with 17 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "StandAlone/DirStackFileIncluder.h"
|
#include "StandAlone/DirStackFileIncluder.h"
|
||||||
#include "glslang/Public/ResourceLimits.h"
|
#include "glslang/Public/ResourceLimits.h"
|
||||||
|
#include "glslang/Public/ShaderLang.h"
|
||||||
#include "glslang/Include/ShHandle.h"
|
#include "glslang/Include/ShHandle.h"
|
||||||
|
|
||||||
#include "glslang/Include/ResourceLimits.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(int(GLSLANG_PROFILE_COUNT) == EProfileCount, "");
|
||||||
static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), "");
|
static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), "");
|
||||||
static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), "");
|
static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), "");
|
||||||
|
static_assert(sizeof(glslang_version_t) == sizeof(glslang::Version), "");
|
||||||
|
|
||||||
typedef struct glslang_shader_s {
|
typedef struct glslang_shader_s {
|
||||||
glslang::TShader* shader;
|
glslang::TShader* shader;
|
||||||
|
|
@ -141,6 +143,11 @@ private:
|
||||||
void* context;
|
void* context;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version)
|
||||||
|
{
|
||||||
|
*reinterpret_cast<glslang::Version*>(version) = glslang::GetVersion();
|
||||||
|
}
|
||||||
|
|
||||||
GLSLANG_EXPORT int glslang_initialize_process() { return static_cast<int>(glslang::InitializeProcess()); }
|
GLSLANG_EXPORT int glslang_initialize_process() { return static_cast<int>(glslang::InitializeProcess()); }
|
||||||
|
|
||||||
GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); }
|
GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); }
|
||||||
|
|
|
||||||
|
|
@ -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_shader_s glslang_shader_t;
|
||||||
typedef struct glslang_program_s glslang_program_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 */
|
/* TLimits counterpart */
|
||||||
typedef struct glslang_limits_s {
|
typedef struct glslang_limits_s {
|
||||||
bool non_inductive_for_loops;
|
bool non_inductive_for_loops;
|
||||||
|
|
@ -249,6 +257,8 @@ extern "C" {
|
||||||
#define GLSLANG_EXPORT
|
#define GLSLANG_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version);
|
||||||
|
|
||||||
GLSLANG_EXPORT int glslang_initialize_process(void);
|
GLSLANG_EXPORT int glslang_initialize_process(void);
|
||||||
GLSLANG_EXPORT void glslang_finalize_process(void);
|
GLSLANG_EXPORT void glslang_finalize_process(void);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue