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

TODO:

  • Rename 'ref' to 'origin' to not confuse with the upcoming explicit pointers (refs)
  • Make implicit pointers (e.g.: const some = layout.$.data) local to functions, and not leak into shell-less functions signatures. This ensures that a function doesn't accidentally have access to a value it shouldn't have access to.
  • Check if Disco got fixed
  • Automatically deref implicit pointers in dualImpl

Reference assignment errors:

image

Invalid 'let' statement errors:
image

@github-actions
Copy link

github-actions bot commented Sep 26, 2025

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

@iwoplaza iwoplaza marked this pull request as ready for review October 7, 2025 14:45
@aleksanderkatan
Copy link
Contributor

aleksanderkatan commented Oct 8, 2025

Something weird happened to the vaporrave example, some of the effects seem to have disappeared.

Also, Slime Mold 3D throws when switching to another example, but this might have been the case before.

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.

3 participants