From 04329077988a2b1f7a87b1d116457599039e5e12 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 28 Oct 2024 08:53:41 -0700 Subject: More wasm binding for playground. (#5420) --- source/slang/slang.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b77a3efc8..b3ac7f73d 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -5040,13 +5040,21 @@ IArtifact* ComponentType::getTargetArtifact(Int targetIndex, slang::IBlob** outD }); List> components; components.add(this); + bool entryPointsDiscovered = false; for (auto module : modules) { for (auto entryPoint : module->getEntryPoints()) { components.add(entryPoint); + entryPointsDiscovered = true; } } + // If no entry points were discovered, then we should return nullptr. + if (!entryPointsDiscovered) + { + return nullptr; + } + RefPtr composite = new CompositeComponentType(linkage, components); ComPtr linkedComponentType; SLANG_RETURN_NULL_ON_FAIL(composite->link(linkedComponentType.writeRef(), outDiagnostics)); -- cgit v1.2.3