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

'@publish import' and explicit control of the host visible shader interface #65

Open
mighdoll opened this issue Jan 14, 2025 · 0 comments
Milestone

Comments

@mighdoll
Copy link
Contributor

From discord discussion:

WGSL statements that change the host visible interface of the shader, like override or @compute, should only be linked if they're referenced from the root module (e.g. ./main.wesl).

Host visible names are: override, entry points (@compute, @vertex, @frag), and resource binding numbers (@group(0) @binding(1))

  • host visible names are only linked as host visible names if they are:
    • declared in the root module, or
    • if they are explicitly mentioned in the root module with in an @publish import statement like:
      • @publish import super::util::over;

Error conditions:

  • it's a link error to use @publish import in any module other than the root module.
  • override elements declared in non-root modules and not imported via with @publish import are converted to const elements. (or simply dropped if they are not referenced even indirectly from a root module element)
  • it's a link error if a non-root module resource binding is referenced indirectly from a root element but not made visible with @publish import in the root module. (but it's ok to have non-root module resource binding that's unreferenced.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant