Add #include processing to glslang (though turned off by default).
When an include directive is recognized by the preprocessor, it
executes a callback on the filepath argument to obtain the file
contents. That way the compilation client can deal with the file
system, include paths, etc.
Currently only accepts quoted filepaths -- no angle brackets yet.
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index b88d8ad..cc6e279 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -700,8 +700,8 @@
shader->setStrings(shaderStrings, 1);
if (Options & EOptionOutputPreprocessed) {
std::string str;
- if (shader->preprocess(&Resources, defaultVersion, ENoProfile,
- false, false, messages, &str)) {
+ if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false,
+ messages, &str, glslang::TShader::ForbidInclude())) {
PutsIfNonEmpty(str.c_str());
} else {
CompileFailed = true;