diff options
| author | Yong He <yonghe@outlook.com> | 2022-01-31 16:26:03 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-31 16:26:03 -0800 |
| commit | e59516fa8c3a16eb7b99a928c5b85b97bf44fd72 (patch) | |
| tree | 869c2b8df0cc0d368af928324d53079a9f7999e0 /source/slang/slang-parameter-binding.cpp | |
| parent | 2bb43bbe4709533e0c6e53df1c62d368132dcd73 (diff) | |
Revise entrypoint renaming interface. (#2113)
Changed the interface from `IEntryPoint::getRenamedEntryPoint` to `IComponentType::renameEntryPoint`.
The underlying implementation creates a `RenamedEntryPointComponentType` wrapper object around the base entry-point.
This new implementation allows the user to specify entry point renaming on an IComponentType that isn't just a `EntryPoint`, but also on `SpecializedComponentType` or `CompositeComponentType` as long as the component defines a single entry point.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
| -rw-r--r-- | source/slang/slang-parameter-binding.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 6f9f127f8..48e637047 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -2729,6 +2729,13 @@ struct CollectGlobalGenericArgumentsVisitor : ComponentTypeVisitor ParameterBindingContext* m_context; + void visitRenamedEntryPoint( + RenamedEntryPointComponentType* entryPoint, + EntryPoint::EntryPointSpecializationInfo* specializationInfo) SLANG_OVERRIDE + { + entryPoint->getBase()->acceptVisitor(this, specializationInfo); + } + void visitEntryPoint(EntryPoint* entryPoint, EntryPoint::EntryPointSpecializationInfo* specializationInfo) SLANG_OVERRIDE { SLANG_UNUSED(entryPoint); @@ -2889,6 +2896,13 @@ struct CollectParametersVisitor : ComponentTypeVisitor collectEntryPointParameters(context, entryPoint, specializationInfo); } + void visitRenamedEntryPoint( + RenamedEntryPointComponentType* renamedEntryPoint, + EntryPoint::EntryPointSpecializationInfo* specializationInfo) SLANG_OVERRIDE + { + renamedEntryPoint->getBase()->acceptVisitor(this, specializationInfo); + } + void visitModule(Module* module, Module::ModuleSpecializationInfo* specializationInfo) SLANG_OVERRIDE { // A single module represents a leaf case for layout. @@ -3107,6 +3121,13 @@ struct CompleteBindingsVisitor : ComponentTypeVisitor completeBindingsForParameter(m_context, globalEntryPointInfo->parametersLayout); } + void visitRenamedEntryPoint( + RenamedEntryPointComponentType* renamedEntryPoint, + EntryPoint::EntryPointSpecializationInfo* specializationInfo) SLANG_OVERRIDE + { + renamedEntryPoint->getBase()->acceptVisitor(this, specializationInfo); + } + void visitModule(Module* module, Module::ModuleSpecializationInfo* specializationInfo) SLANG_OVERRIDE { SLANG_UNUSED(specializationInfo); @@ -3236,6 +3257,13 @@ struct FlushPendingDataVisitor : ComponentTypeVisitor _allocateBindingsForPendingData(m_context, globalEntryPointInfo->parametersLayout->pendingVarLayout); } + void visitRenamedEntryPoint( + RenamedEntryPointComponentType* entryPoint, + EntryPoint::EntryPointSpecializationInfo* specializationInfo) SLANG_OVERRIDE + { + entryPoint->getBase()->acceptVisitor(this, specializationInfo); + } + void visitModule(Module* module, Module::ModuleSpecializationInfo* specializationInfo) SLANG_OVERRIDE { SLANG_UNUSED(specializationInfo); |
