From e59516fa8c3a16eb7b99a928c5b85b97bf44fd72 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 31 Jan 2022 16:26:03 -0800 Subject: 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 --- source/slang/slang-parameter-binding.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source/slang/slang-parameter-binding.cpp') 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); -- cgit v1.2.3