|
@@ -14,6 +14,7 @@
|
|
|
#include "shaderCompilerGlslang.h"
|
|
#include "shaderCompilerGlslang.h"
|
|
|
#include "config_shaderpipeline.h"
|
|
#include "config_shaderpipeline.h"
|
|
|
#include "virtualFile.h"
|
|
#include "virtualFile.h"
|
|
|
|
|
+#include "shaderCompilerGlslPreProc.h"
|
|
|
|
|
|
|
|
#ifndef CPPPARSER
|
|
#ifndef CPPPARSER
|
|
|
#include <glslang/Public/ShaderLang.h>
|
|
#include <glslang/Public/ShaderLang.h>
|
|
@@ -292,6 +293,14 @@ compile_now(ShaderModule::Stage stage, std::istream &in,
|
|
|
return nullptr;
|
|
return nullptr;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (!is_cg && glsl_version < 330 && glsl_version != 150) {
|
|
|
|
|
+ // Fall back to GlslPreProc handler. Cleaner way to do this?
|
|
|
|
|
+ static ShaderCompilerGlslPreProc preprocessor;
|
|
|
|
|
+
|
|
|
|
|
+ std::istringstream stream(std::string((const char *)&code[0], code.size()));
|
|
|
|
|
+ return preprocessor.compile_now(stage, stream, filename, record);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
static bool is_initialized = false;
|
|
static bool is_initialized = false;
|
|
|
if (!is_initialized) {
|
|
if (!is_initialized) {
|
|
|
ShInitialize();
|
|
ShInitialize();
|