-
-
Notifications
You must be signed in to change notification settings - Fork 21
fix: TypeGPU functions using TGSL dependencies declaration order #1522
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
Conversation
pkg.pr.new packages
benchmark commit |
People coming from a non-WGSL background, or people that don't yet know recursion is not permitted in WGSL could look at that error and think it's a problem with the library. I think we should throw a descriptive error in this case. I'll make an issue for this. |
Here's the issue: #1523 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please! 💜
This reverts commit a56e883.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 🏗️
The change allows for a function to reference another function defined later on.
This could potentially lead to people attempting to write recursive functions.
TypeScript screams when either of the following happens (something something any):
However, the following is fine:
and in this case we get a stack overflow:
Should we try to detect this situation? This would probably require resolve to hold a set of items it is currently trying to resolve, it seems pretty doable. On the other hand, this is already illegal in wgsl, and it is not too difficult to know what is going on when seeing an error like this.