Commit a4c64c98 by John Kessenich

HLSL: Fix #834: Report #version is an illegal command.

parent a0c578a6
......@@ -776,8 +776,12 @@ int TPpContext::CPPversion(TPpToken* ppToken)
{
int token = scanToken(ppToken);
if (errorOnVersion || versionSeen)
parseContext.ppError(ppToken->loc, "must occur first in shader", "#version", "");
if (errorOnVersion || versionSeen) {
if (parseContext.isReadingHLSL())
parseContext.ppError(ppToken->loc, "invalid preprocessor command", "#version", "");
else
parseContext.ppError(ppToken->loc, "must occur first in shader", "#version", "");
}
versionSeen = true;
if (token == '\n') {
......
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