Skip to content

Commit b7ec2db

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PlugIns/GLSLang/src/OgreGLSLang.cpp

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

1111
#include <glslang/Public/ShaderLang.h>
1212
#include <glslang/SPIRV/GlslangToSpv.h>
13+
#include <glslang/build_info.h>
1314
#include "gl_types.h"
1415

1516
namespace
@@ -457,7 +458,12 @@ void GLSLangProgram::prepareImpl()
457458
}
458459
}
459460

461+
#if GLSLANG_VERSION_MAJOR < 14
462+
auto utype = program.getUniformTType(i);
463+
#else
460464
auto utype = (const TType*)program.getUniformTType(i);
465+
#endif
466+
461467
GpuConstantDefinition def;
462468
def.logicalIndex = isUBO ? uoffset : utype->getQualifier().layoutLocation;
463469
def.arraySize = program.getUniformArraySize(i);

0 commit comments

Comments
 (0)