summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-01-31 16:26:03 -0800
committerGitHub <noreply@github.com>2022-01-31 16:26:03 -0800
commite59516fa8c3a16eb7b99a928c5b85b97bf44fd72 (patch)
tree869c2b8df0cc0d368af928324d53079a9f7999e0 /slang.h
parent2bb43bbe4709533e0c6e53df1c62d368132dcd73 (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 'slang.h')
-rw-r--r--slang.h42
1 files changed, 24 insertions, 18 deletions
diff --git a/slang.h b/slang.h
index 86a752f01..4d9effad3 100644
--- a/slang.h
+++ b/slang.h
@@ -4248,33 +4248,39 @@ namespace slang
(and hence the global layout) that results will be deterministic,
but is not currently documented.
*/
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL link(
- IComponentType** outLinkedComponentType,
- ISlangBlob** outDiagnostics = nullptr) = 0;
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL link(
+ IComponentType** outLinkedComponentType,
+ ISlangBlob** outDiagnostics = nullptr) = 0;
- /** Get entry point 'callable' functions accessible through the ISlangSharedLibrary interface.
+ /** Get entry point 'callable' functions accessible through the ISlangSharedLibrary interface.
- The functions remain in scope as long as the ISlangSharedLibrary interface is in scope.
+ The functions remain in scope as long as the ISlangSharedLibrary interface is in scope.
- NOTE! Requires a compilation target of SLANG_HOST_CALLABLE.
+ NOTE! Requires a compilation target of SLANG_HOST_CALLABLE.
- @param entryPointIndex The index of the entry point to get code for.
- @param targetIndex The index of the target to get code for (default: zero).
- @param outSharedLibrary A pointer to a ISharedLibrary interface which functions can be queried on.
- @returns A `SlangResult` to indicate success or failure.
- */
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointHostCallable(
- int entryPointIndex,
- int targetIndex,
- ISlangSharedLibrary** outSharedLibrary,
- slang::IBlob** outDiagnostics = 0) = 0;
+ @param entryPointIndex The index of the entry point to get code for.
+ @param targetIndex The index of the target to get code for (default: zero).
+ @param outSharedLibrary A pointer to a ISharedLibrary interface which functions can be queried on.
+ @returns A `SlangResult` to indicate success or failure.
+ */
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointHostCallable(
+ int entryPointIndex,
+ int targetIndex,
+ ISlangSharedLibrary** outSharedLibrary,
+ slang::IBlob** outDiagnostics = 0) = 0;
+
+ /** Get a new ComponentType object that represents a renamed entry point.
+
+ The current object must be a single EntryPoint, or a CompositeComponentType or
+ SpecializedComponentType that contains one EntryPoint component.
+ */
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL renameEntryPoint(
+ const char* newName, IComponentType** outEntryPoint) = 0;
};
#define SLANG_UUID_IComponentType IComponentType::getTypeGuid()
struct IEntryPoint : public IComponentType
{
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL getRenamedEntryPoint(const char* newName, IEntryPoint** outEntryPoint) = 0;
-
SLANG_COM_INTERFACE(0x8f241361, 0xf5bd, 0x4ca0, { 0xa3, 0xac, 0x2, 0xf7, 0xfa, 0x24, 0x2, 0xb8 })
};