mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-24 03:39:51 +00:00
HLSL: Fix #834: Report #version is an illegal command.
This commit is contained in:
parent
a0c578a6df
commit
a4c64c988c
@ -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') {
|
||||
|
Loading…
Reference in New Issue
Block a user