-
-
Notifications
You must be signed in to change notification settings - Fork 47
feat: Better errors for illegal arguments in shellless #2124
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
base: main
Are you sure you want to change the base?
feat: Better errors for illegal arguments in shellless #2124
Conversation
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:
📋 All resultsClick to reveal the results table (334 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
|
pkg.pr.new packages benchmark commit |
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.
Pull request overview
This pull request enhances error messages for illegal arguments passed to shellless functions in TypeGPU. When developers incorrectly pass resources (like samplers, texture views, or uniforms) without dereferencing them using .$, they now receive clear, actionable error messages explaining what went wrong and how to fix it.
Changes:
- Enhanced error messages in shellless functions to provide clear guidance when illegal arguments are passed
- Added
toString()methods toTgpuTextureImplandTgpuBufferShorthandImplto improve error message clarity - Added comprehensive test coverage for both valid and invalid argument cases
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/typegpu/src/tgsl/shellless.ts |
Enhanced error message with multi-line explanation and guidance for fixing illegal argument errors |
packages/typegpu/src/core/texture/texture.ts |
Added toString() method to texture class for better error reporting |
packages/typegpu/src/core/buffer/bufferShorthand.ts |
Added toString() method and imported getName for buffer shorthand classes |
packages/typegpu/tests/tgsl/shellless.test.ts |
Added comprehensive test cases for valid sampler/texture view arguments and error cases for various illegal arguments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
reczkok
left a comment
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.
Looks good
No description provided.