summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-14 10:06:16 -0700
committerGitHub <noreply@github.com>2024-10-14 10:06:16 -0700
commit2e08f33386b65502e16eea33613bddf98ab8b440 (patch)
treefc2b0f8808b5c8bb8659d054387e77c617220f16 /source
parente57736bdec06246e32f9deea0ad3cc05a433acb1 (diff)
Fix assert when compiling an entrypoint that calls another entrypoint. (#5268)
* Fix assert when compiling an entrypoint that calls another entrypoint. * Fix test.
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-entry-point-uniforms.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/slang/slang-ir-entry-point-uniforms.cpp b/source/slang/slang-ir-entry-point-uniforms.cpp
index a269ec171..aa327caf6 100644
--- a/source/slang/slang-ir-entry-point-uniforms.cpp
+++ b/source/slang/slang-ir-entry-point-uniforms.cpp
@@ -200,8 +200,15 @@ struct CollectEntryPointUniformParams : PerEntryPointPass
// defensive and bail out in the failure case in release builds.
//
auto funcLayoutDecoration = entryPointFunc->findDecoration<IRLayoutDecoration>();
- SLANG_ASSERT(funcLayoutDecoration);
- if(!funcLayoutDecoration)
+
+ // If the module contains two functions with entrypoint decorations,
+ // and one entrypoint calls the other entrypoint, and the user
+ // tells us to compile the caller entrypoint but not the callee
+ // entrypoint, we will not have the layout decoration created for
+ // the callee entrypoint. In this case, we should simply treat the
+ // callee entrypoint as if it is an ordinary function and skip the
+ // rest of the logic here.
+ if (!funcLayoutDecoration)
return;
auto entryPointLayout = as<IREntryPointLayout>(funcLayoutDecoration->getLayout());