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);
|
int token = scanToken(ppToken);
|
||||||
|
|
||||||
if (errorOnVersion || versionSeen)
|
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", "");
|
parseContext.ppError(ppToken->loc, "must occur first in shader", "#version", "");
|
||||||
|
}
|
||||||
versionSeen = true;
|
versionSeen = true;
|
||||||
|
|
||||||
if (token == '\n') {
|
if (token == '\n') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user