Skip to content

feat: Make array schemas callable #1499

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

Merged
merged 35 commits into from
Jul 24, 2025

Conversation

aleksanderkatan
Copy link
Contributor

@aleksanderkatan aleksanderkatan commented Jul 16, 2025

Changes:

  • array schemas can be called with no arguments to create an array filled with default arguments (both JS and WGSL),
  • array schemas can be called with another array to create a deep clone on JS side, and to "do nothing" on WGSL side (just like structs, again, we assume the assignment will do the job),
  • some minor changes to struct and struct tests.

We concretisize the arrays a little too early, which results in some counterintuitive behavior. I created an issue for this: #1508

Also, here is another issue for unstructs and disarrays: #1504

Copy link

github-actions bot commented Jul 17, 2025

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

@aleksanderkatan aleksanderkatan marked this pull request as ready for review July 17, 2025 13:39
Copy link
Contributor

@reczkok reczkok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing🙇

@aleksanderkatan aleksanderkatan merged commit 6a95114 into main Jul 24, 2025
6 checks passed
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.

feat: Make array schemas callable, both for creating n-sized uninitialized arrays in TGSL, and for casting
3 participants