summaryrefslogtreecommitdiffstats
path: root/source/slang/ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-01-16 15:38:36 -0500
committerYong He <yonghe@outlook.com>2018-01-16 15:38:36 -0500
commita74a5494b34e2b41a294042ab8b3e7bce115dcba (patch)
tree9895842d33893b9a233f58964cfa55b3974d6134 /source/slang/ir.cpp
parent59691aeeb013c5bb7cdaa31a6fc572eebd8be610 (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.cpp4
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();