Skip to content

Conversation

@aleksanderkatan
Copy link
Contributor

@aleksanderkatan aleksanderkatan commented Jan 7, 2026

Edit: Actually, let's make this PR only about updating autonaming

Changes:

  • autoname private items in classes,
  • made guarded compute pipelines and texture views namable,
  • autoname guarded compute pipelines and texture views,
  • some cleanup in naming functions.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@e218f449fd578ecd3a0d212349a4dfce7d90e0c4
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@e218f449fd578ecd3a0d212349a4dfce7d90e0c4
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@e218f449fd578ecd3a0d212349a4dfce7d90e0c4

benchmark
view benchmark

commit
view commit

@aleksanderkatan aleksanderkatan changed the title feat: Private identifiers feat: More autonaming Jan 9, 2026
Copy link

Copilot AI left a 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 TgpuGuardedComputePipeline and TgpuTextureView namable by implementing the TgpuNamable interface
  • Refactored all $name method implementations to consistently use setName(this, label), relying on the $getNameForward mechanism
  • 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.

@aleksanderkatan aleksanderkatan marked this pull request as ready for review January 9, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants