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

Interface for IDevice::createShaderProgram #15

Open
skallweitNV opened this issue Sep 3, 2024 · 0 comments
Open

Interface for IDevice::createShaderProgram #15

skallweitNV opened this issue Sep 3, 2024 · 0 comments
Labels

Comments

@skallweitNV
Copy link
Collaborator

We currently have this descriptor:

struct ShaderProgramDesc
{
    // TODO: Tess doesn't like this but doesn't know what to do about it
    // The linking style of this program.
    LinkingStyle linkingStyle = LinkingStyle::SingleProgram;

    // The global scope or a Slang composite component that represents the entire program.
    slang::IComponentType* slangGlobalScope;

    // An array of Slang entry points. The size of the array must be `slangEntryPointCount`.
    // Each element must define only 1 Slang EntryPoint.
    slang::IComponentType** slangEntryPoints = nullptr;

    // Number of separate entry point components in the `slangEntryPoints` array to link in.
    // If set to 0, then `slangGlobalScope` must contain Slang EntryPoint components.
    // If not 0, then `slangGlobalScope` must not contain any EntryPoint components.
    GfxCount slangEntryPointCount = 0;
};

The linkingSyle allows to select between two styles for linking and we have the following use cases:

  • SingleProgram
    • a) we can pass a fully linked program in slangGlobalScope that potentially contains multiple entry-points
    • b) we can pass a global scope + entry point components and let the program be composed
  • SeparateEntryPointCompilation
    • c) we pass a global scope + multiple entry points that may contain specializations (type conformances)

Case (b) seems obsolete as we can achieve the same by just passing in a fully composed/linked program.
Case (c) is important for raytracing pipelines.

Is there a better design for handling these use cases?

@skallweitNV skallweitNV changed the title Interface for createShaderProgram Interface for IDevice::createShaderProgram Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant