Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve entry point lookup function documentation #6451

Merged
merged 6 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/user-guide/02-conventional-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ In this example, the `vertexMain` shader indicates that it is meant for the `ver
Rasterization, compute, and ray-tracing pipelines each define their own stages, and new versions of graphics APIs may introduce new stages.

For compatibility with legacy codebases, Slang supports code that leaves off `[shader(...)]` attributes; in these cases application developers must specify the names and stages for their entry points via explicit command-line or API options.
Such entry points will not be found via `IModule::findEntryPointByName()`. Instead `IModule::findAndCheckEntryPoint()` must be used, and a stage must be specified.
It is recommended that new codebases always use `[shader(...)]` attributes both to simplify their workflow, and to make code more explicit and "self-documenting."

> #### Note ####
Expand Down
4 changes: 4 additions & 0 deletions include/slang.h
Original file line number Diff line number Diff line change
Expand Up @@ -4361,6 +4361,10 @@ struct IModule : public IComponentType
{
SLANG_COM_INTERFACE(0xc720e64, 0x8722, 0x4d31, {0x89, 0x90, 0x63, 0x8a, 0x98, 0xb1, 0xc2, 0x79})

/// Find and an entry point by name.
/// Note that this does not work in case the function is not explicitly designated as an entry
/// point, e.g. using a `[shader("...")]` attribute. In such cases, consider using
/// `IModule::findAndCheckEntryPoint` instead.
virtual SLANG_NO_THROW SlangResult SLANG_MCALL
findEntryPointByName(char const* name, IEntryPoint** outEntryPoint) = 0;

Expand Down
Loading