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

@inline attribute #47

Open
k2d222 opened this issue Oct 1, 2024 · 1 comment
Open

@inline attribute #47

k2d222 opened this issue Oct 1, 2024 · 1 comment

Comments

@k2d222
Copy link
Contributor

k2d222 commented Oct 1, 2024

a @inline attribute would cause the function body to be copy-pasted in place of the function call.

Why would we want this? In my current understanding of driver's shader compilation, we don't. Because since shader code has very few side-effects, drivers already inline functions by themselves.

It would be nice to get some insider's confirmation of this, or study whether that is really the case and if there can be any performance implications when inlining manually.

@mighdoll
Copy link
Contributor

mighdoll commented Oct 2, 2024

fwiw slang suggests that it's generally unnecessary, but supports it: http://shader-slang.com/slang/user-guide/convenience-features.html#force-inlining

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants