Skip to content

Conversation

iwoplaza
Copy link
Collaborator

@iwoplaza iwoplaza commented Sep 26, 2025

Changes:

  • Track referentiality of snippets (and their address space)
  • Generate pointer types for shell-less arguments if the passed-in values are referential
  • Forbid assignment of references
  • Not allowing references to be returned from a function (unless it’s a reference to something define in that function)
  • Make JS const statements be pointers if they take in a referential type (let statements)
  • Treat JS const statements with naturally non-referential types to be WGSL const 🎉
  • Track constant expressions

Reference assignment errors:

image

Invalid 'let' statement errors:
image

Copy link

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

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.

1 participant