diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-11 14:19:00 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-11 14:19:00 -0800 |
| commit | c17369a507c9b2e3a2db409896dbdc7e250122c1 (patch) | |
| tree | ff1f60a0b62d541b756b419549c8c4327607c81d /source | |
| parent | 0af589bf2ddf383eb8e6014e8e9da3309284ce0f (diff) | |
Fix the logic to determine whether lower generic pass should run. (#5837)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 04ad55c1f..f9118bb45 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -429,7 +429,14 @@ void calcRequiredLoweringPassSet( { // If any instruction has an interface type, we need to run // the generics lowering pass. - auto type = inst->getDataType(); + auto type = as<IRType>(inst) ? inst : inst->getDataType(); + for (;;) + { + if (auto ptrType = as<IRPtrTypeBase>(type)) + type = ptrType->getValueType(); + else + break; + } if (type && type->getOp() == kIROp_InterfaceType) { result.generics = true; |
