summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-lower-com-methods.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-09-15 20:37:45 -0700
committerGitHub <noreply@github.com>2022-09-15 20:37:45 -0700
commita5d3bec25d70f23da1e79cd7773981ff34593611 (patch)
tree92c8cb983c57bbee141d4e6f3f91f265e04d6a08 /source/slang/slang-ir-lower-com-methods.cpp
parenta6032446c6bf7f64d1e201bf438a4c7605a3dbb4 (diff)
Run simple compute kernel in gfx-smoke test. (#2400)
Diffstat (limited to 'source/slang/slang-ir-lower-com-methods.cpp')
-rw-r--r--source/slang/slang-ir-lower-com-methods.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/slang/slang-ir-lower-com-methods.cpp b/source/slang/slang-ir-lower-com-methods.cpp
index 6d5ddb261..b991dbd03 100644
--- a/source/slang/slang-ir-lower-com-methods.cpp
+++ b/source/slang/slang-ir-lower-com-methods.cpp
@@ -30,9 +30,21 @@ struct ComMethodLoweringContext : public InstPassBase
auto callee = as<IRLookupWitnessMethod>(comCall->getCallee());
SLANG_ASSERT(callee);
+ IRLookupWitnessMethod* innerMostCallee = callee;
+ while (innerMostCallee->getOperand(0)->getOp() == kIROp_lookup_interface_method)
+ {
+ innerMostCallee = as<IRLookupWitnessMethod>(innerMostCallee->getOperand(0));
+ }
+ if (callee != innerMostCallee)
+ {
+ callee = (IRLookupWitnessMethod*)builder.emitLookupInterfaceMethodInst(
+ callee->getDataType(),
+ innerMostCallee->getWitnessTable(),
+ callee->getRequirementKey());
+ }
comCallees.Add(callee);
- auto calleeType = as<IRFuncType>(comCall->getCallee()->getDataType());
+ auto calleeType = as<IRFuncType>(callee->getDataType());
SLANG_ASSERT(calleeType);
auto nativeFuncType = marshal.getNativeFuncType(builder, calleeType);
@@ -45,7 +57,7 @@ struct ComMethodLoweringContext : public InstPassBase
builder,
calleeType,
nativeFuncType,
- comCall->getCallee(),
+ callee,
args.getCount(),
args.getArrayView().getBuffer());