Skip to content

Commit 43bd898

Browse files
committed
GLSLang: check version before applying our API hack
1 parent 0d90297 commit 43bd898

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

PlugIns/GLSLang/src/OgreGLSLang.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
#include <glslang/Public/ShaderLang.h>
1212
#include <glslang/SPIRV/GlslangToSpv.h>
13+
#ifndef GLSLANG_MINOR_VERSION
14+
#include <glslang/build_info.h>
15+
#else
16+
#define GLSLANG_VERSION_MAJOR 11
17+
#endif
1318
#include "gl_types.h"
1419

1520
namespace
@@ -457,7 +462,12 @@ void GLSLangProgram::prepareImpl()
457462
}
458463
}
459464

465+
#if GLSLANG_VERSION_MAJOR < 14
466+
auto utype = program.getUniformTType(i);
467+
#else
460468
auto utype = (const TType*)program.getUniformTType(i);
469+
#endif
470+
461471
GpuConstantDefinition def;
462472
def.logicalIndex = isUBO ? uoffset : utype->getQualifier().layoutLocation;
463473
def.arraySize = program.getUniformArraySize(i);

0 commit comments

Comments
 (0)