HLSL: Add better diagnostic when using in/out qualifiers in global scope (#2258)

This commit is contained in:
rdb
2020-06-02 08:32:35 +02:00
committed by GitHub
parent b56e0e441b
commit 78a3c915a1
4 changed files with 61 additions and 0 deletions

View File

@@ -382,6 +382,16 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
if (forbidDeclarators)
return true;
// Check if there are invalid in/out qualifiers
switch (declaredType.getQualifier().storage) {
case EvqIn:
case EvqOut:
case EvqInOut:
parseContext.error(token.loc, "in/out qualifiers are only valid on parameters", token.string->c_str(), "");
default:
break;
}
// declarator_list
// : declarator
// : identifier