Skip to content

Commit

Permalink
GLSLang: check version before applying our API hack
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed May 14, 2024
1 parent 0d90297 commit b7ec2db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PlugIns/GLSLang/src/OgreGLSLang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <glslang/Public/ShaderLang.h>
#include <glslang/SPIRV/GlslangToSpv.h>
#include <glslang/build_info.h>
#include "gl_types.h"

namespace
Expand Down Expand Up @@ -457,7 +458,12 @@ void GLSLangProgram::prepareImpl()
}
}

#if GLSLANG_VERSION_MAJOR < 14
auto utype = program.getUniformTType(i);
#else
auto utype = (const TType*)program.getUniformTType(i);
#endif

GpuConstantDefinition def;
def.logicalIndex = isUBO ? uoffset : utype->getQualifier().layoutLocation;
def.arraySize = program.getUniformArraySize(i);
Expand Down

0 comments on commit b7ec2db

Please sign in to comment.