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:
commit
5a8390696d
4 changed files with 331 additions and 302 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue