diff options
| author | Yong He <yonghe@outlook.com> | 2018-01-16 15:38:36 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2018-01-16 15:38:36 -0500 |
| commit | a74a5494b34e2b41a294042ab8b3e7bce115dcba (patch) | |
| tree | 9895842d33893b9a233f58964cfa55b3974d6134 /source/slang/ir.cpp | |
| parent | 59691aeeb013c5bb7cdaa31a6fc572eebd8be610 (diff) | |
bug fixes to get falcor example shader code to compile.
1. prevent cyclic lookups when an interface inherits transitively from itself.
2. in `createGlobalGenericParamSubstitution`, create a default substitution for the base type declref before using it to lookup the witness table.
Diffstat (limited to 'source/slang/ir.cpp')
| -rw-r--r-- | source/slang/ir.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp index 45ad71b67..f65af2ba4 100644 --- a/source/slang/ir.cpp +++ b/source/slang/ir.cpp @@ -4889,8 +4889,10 @@ namespace Slang { if (auto subDeclRefType = subtypeWitness->sub.As<DeclRefType>()) { - auto genericWitnessTableName = getMangledNameForConformanceWitness(DeclRef<Decl>(subDeclRefType->declRef.getDecl(), nullptr), subtypeWitness->sup); + auto defaultSubst = createDefaultSubstitutions(entryPointRequest->compileRequest->mSession, subDeclRefType->declRef.getDecl()); + auto genericWitnessTableName = getMangledNameForConformanceWitness(DeclRef<Decl>(subDeclRefType->declRef.getDecl(), defaultSubst), subtypeWitness->sup); table = findWitnessTableByName(genericWitnessTableName); + SLANG_ASSERT(table); WitnessTableSpecializationWorkItem workItem; workItem.srcTable = (IRWitnessTable*)table; workItem.dstTable = context->builder->createWitnessTable(); |
