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 43bd898
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PlugIns/GLSLang/src/OgreGLSLang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

#include <glslang/Public/ShaderLang.h>
#include <glslang/SPIRV/GlslangToSpv.h>
#ifndef GLSLANG_MINOR_VERSION
#include <glslang/build_info.h>
#else
#define GLSLANG_VERSION_MAJOR 11
#endif
#include "gl_types.h"

namespace
Expand Down Expand Up @@ -457,7 +462,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 43bd898

Please sign in to comment.