Merge pull request #782 from steve-lunarg/builtin-methods-prefix

HLSL: use prefix for builtin functions names to avoid namespace colli…
This commit is contained in:
John Kessenich
2017-03-19 23:49:55 -06:00
committed by GitHub
4 changed files with 331 additions and 302 deletions

View File

@@ -2792,11 +2792,13 @@ bool HlslGrammar::acceptFunctionCall(HlslToken callToken, TIntermTyped*& node, T
{
// name
TString* functionName = nullptr;
if ((baseObject == nullptr && scope == nullptr) ||
parseContext.isBuiltInMethod(callToken.loc, baseObject, *callToken.string)) {
if ((baseObject == nullptr && scope == nullptr)) {
functionName = callToken.string;
} else if (parseContext.isBuiltInMethod(callToken.loc, baseObject, *callToken.string)) {
// Built-in methods are not in the symbol table as methods, but as global functions
// taking an explicit 'this' as the first argument.
functionName = callToken.string;
functionName = NewPoolTString(BUILTIN_PREFIX);
functionName->append(*callToken.string);
} else {
functionName = NewPoolTString("");
if (baseObject != nullptr)