Skip to content

feat: Struct default constructor #1480

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aleksanderkatan
Copy link
Contributor

@aleksanderkatan aleksanderkatan commented Jul 11, 2025

Structs can now be called with no arguments in order to get a default value of the struct (as long as there are no nested arrays inside).

This is a prerequisite for #1254 (d.arrayOf(myStruct, 4)())

Copy link

github-actions bot commented Jul 11, 2025

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

@aleksanderkatan aleksanderkatan marked this pull request as ready for review July 11, 2025 09:55
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