summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index 623c57f2b..aa56bc0b2 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -48,29 +48,37 @@ enum class BuiltInCOp
//
EntryPointLayout* findEntryPointLayout(
- ProgramLayout* programLayout,
- EntryPoint* entryPoint)
+ ProgramLayout* programLayout,
+ EntryPoint* entryPoint,
+ EntryPointGroupLayout** outEntryPointGroupLayout = nullptr)
{
- for( auto entryPointLayout : programLayout->entryPoints )
+ for( auto entryPointGroupLayout : programLayout->entryPointGroups )
{
- if(entryPointLayout->entryPoint->getName() != entryPoint->getName())
- continue;
-
- // TODO: We need to be careful about this check, since it relies on
- // the profile information in the layout matching that in the request.
- //
- // What we really seem to want here is some dictionary mapping the
- // `EntryPoint` directly to the `EntryPointLayout`, and maybe
- // that is precisely what we should build...
- //
- if(entryPointLayout->profile != entryPoint->getProfile())
- continue;
-
- // TODO: can't easily filter on translation unit here...
- // Ideally the `EntryPoint` should get filled in with a pointer
- // the specific function declaration that represents the entry point.
-
- return entryPointLayout.Ptr();
+ for( auto entryPointLayout : entryPointGroupLayout->entryPoints )
+ {
+ if(entryPointLayout->entryPoint->getName() != entryPoint->getName())
+ continue;
+
+ // TODO: We need to be careful about this check, since it relies on
+ // the profile information in the layout matching that in the request.
+ //
+ // What we really seem to want here is some dictionary mapping the
+ // `EntryPoint` directly to the `EntryPointLayout`, and maybe
+ // that is precisely what we should build...
+ //
+ if(entryPointLayout->profile != entryPoint->getProfile())
+ continue;
+
+ // TODO: can't easily filter on translation unit here...
+ // Ideally the `EntryPoint` should get filled in with a pointer
+ // the specific function declaration that represents the entry point.
+
+ if( outEntryPointGroupLayout )
+ {
+ *outEntryPointGroupLayout = entryPointGroupLayout;
+ }
+ return entryPointLayout;
+ }
}
return nullptr;