Commit ec2e27ad by John Kessenich Committed by GitHub

Merge pull request #613 from Corillian/hlslpreprocess

Fixed processing #include's when preprocessing HLSL
parents fb06e955 205dc4e4
...@@ -110,6 +110,7 @@ public: ...@@ -110,6 +110,7 @@ public:
void getPreamble(std::string&); void getPreamble(std::string&);
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; }
TInfoSink& infoSink; TInfoSink& infoSink;
......
...@@ -897,7 +897,9 @@ int TPpContext::readCPPline(TPpToken* ppToken) ...@@ -897,7 +897,9 @@ int TPpContext::readCPPline(TPpToken* ppToken)
token = CPPifdef(0, ppToken); token = CPPifdef(0, ppToken);
break; break;
case PpAtomInclude: case PpAtomInclude:
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include"); if(!parseContext.isReadingHLSL()) {
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include");
}
token = CPPinclude(ppToken); token = CPPinclude(ppToken);
break; break;
case PpAtomLine: case PpAtomLine:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment