-
-
Notifications
You must be signed in to change notification settings - Fork 45
feat: More autonaming #2012
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: More autonaming #2012
Conversation
|
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 PR enhances the auto-naming functionality in TypeGPU by adding support for naming private class properties, guarded compute pipelines, and texture views. The PR also includes a significant refactoring to simplify and standardize how naming is handled across the codebase.
Key Changes:
- Extended auto-naming to support private properties (using # syntax) in classes
- Made
TgpuGuardedComputePipelineandTgpuTextureViewnamable by implementing theTgpuNamableinterface - Refactored all
$namemethod implementations to consistently usesetName(this, label), relying on the$getNameForwardmechanism - Added 'uniform' and 'storage' as banned tokens since they are WGSL keywords
- Added 'createView' to the resource constructors list for auto-naming support
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/unplugin-typegpu/test/auto-naming.test.ts |
Added tests for private property naming and guarded pipeline auto-naming |
packages/typegpu/tests/unplugin/autoname.test.ts |
Added tests for views naming and private property naming; reorganized existing tests |
packages/typegpu/tests/texture.test.ts |
Added test verifying texture views can be named |
packages/typegpu/tests/guardedComputePipeline.test.ts |
New test file for guarded compute pipeline naming functionality |
packages/typegpu/tests/examples/individual/probability.test.ts |
Updated test snapshots reflecting new WGSL naming (avoiding 'uniform' keyword) |
packages/typegpu/tests/examples/individual/jelly-switch.test.ts |
Updated test snapshots reflecting new WGSL naming |
packages/typegpu/tests/examples/individual/jelly-slider.test.ts |
Updated test snapshots reflecting new WGSL naming |
packages/typegpu/tests/examples/individual/gravity.test.ts |
Updated test snapshots reflecting new WGSL naming |
packages/unplugin-typegpu/src/common.ts |
Added PrivateName/PrivateIdentifier support; added 'createView'; reorganized resource constructors |
packages/typegpu/src/shared/symbols.ts |
Updated comment clarifying $getNameForward behavior |
packages/typegpu/src/shared/meta.ts |
Updated TgpuNamable interface documentation |
packages/typegpu/src/nameRegistry.ts |
Added 'uniform' and 'storage' to banned tokens |
packages/typegpu/src/core/texture/texture.ts |
Made TgpuTextureView namable by adding $name method |
packages/typegpu/src/core/slot/accessor.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/root/rootTypes.ts |
Extended TgpuGuardedComputePipeline interface with TgpuNamable |
packages/typegpu/src/core/root/init.ts |
Implemented naming support for TgpuGuardedComputePipeline |
packages/typegpu/src/core/pipeline/renderPipeline.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/pipeline/computePipeline.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/function/tgpuVertexFn.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/function/tgpuFragmentFn.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/function/tgpuFn.ts |
Updated $name implementations to call setName(this, label) |
packages/typegpu/src/core/function/tgpuComputeFn.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/buffer/bufferUsage.ts |
Updated $name to call setName(this, label) |
packages/typegpu/src/core/buffer/bufferShorthand.ts |
Updated $name to call setName(this, label) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Edit: Actually, let's make this PR only about updating autonaming
Changes: