Skip to content

Commit 230be38

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

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

PlugIns/GLSLang/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ target_compile_features(Plugin_GLSLangProgramManager PRIVATE cxx_std_17)
1010
if(ANDROID)
1111
target_include_directories(Plugin_GLSLangProgramManager SYSTEM PRIVATE
1212
${ANDROID_NDK}/sources/third_party/shaderc/third_party/glslang
13+
${ANDROID_NDK}/sources/third_party/shaderc/obj/local/${ANDROID_ABI}/include/
1314
${ANDROID_NDK}/sources/third_party/shaderc/third_party/)
1415
target_link_libraries(Plugin_GLSLangProgramManager PUBLIC OgreMain
1516
${ANDROID_NDK}/sources/third_party/shaderc/libs/c++_static/${ANDROID_ABI}/libshaderc.a)

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 10
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)