From c17369a507c9b2e3a2db409896dbdc7e250122c1 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 11 Dec 2024 14:19:00 -0800 Subject: Fix the logic to determine whether lower generic pass should run. (#5837) --- source/slang/slang-emit.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source') 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(inst) ? inst : inst->getDataType(); + for (;;) + { + if (auto ptrType = as(type)) + type = ptrType->getValueType(); + else + break; + } if (type && type->getOp() == kIROp_InterfaceType) { result.generics = true; -- cgit v1.2.3