diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-20 05:28:22 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-20 05:28:22 -0500 |
| commit | d6130baa8528c0a5b2e1b10b87fe02d8fc1a1b1a (patch) | |
| tree | 6aa5b2fe3a0fbfd8d2a02b38da9ca96f9fbd10ef /source/slang/syntax.cpp | |
| parent | 3dff5a53a21ab2404918e772962004767024c0f3 (diff) | |
fixup global generic parameters
1. simplify RoundUpToAlignment()
2. add new a render-compute test case to cover the situation where the entry-point interface (parameter/return types of an entry-point function) is dependent on the global generic type.
3. initial fixes to get this test case to compile (but is not producing correct HLSL output yet)
Diffstat (limited to 'source/slang/syntax.cpp')
| -rw-r--r-- | source/slang/syntax.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index e43dd9074..badfaea4f 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -1709,7 +1709,22 @@ void Type::accept(IValVisitor* visitor, void* extra) return sb.ProduceString(); } - + void insertSubstAtBottom(RefPtr<Substitutions> & substHead, RefPtr<Substitutions> substToInsert) + { + if (!substHead) + { + substHead = substToInsert; + return; + } + auto subst = substHead; + RefPtr<Substitutions> lastSubst = subst; + while (subst->outer) + { + lastSubst = subst; + subst = subst->outer; + } + lastSubst->outer = substToInsert; + } void insertSubstAtTop(DeclRefBase & declRef, RefPtr<Substitutions> substToInsert) { |
