Skip to content

Conversation

@reczkok
Copy link
Contributor

@reczkok reczkok commented Aug 5, 2025

I also added a builtin struct for internal use. These represent return types for some std functions. They do not add definitions and do not alter their names.

@reczkok reczkok force-pushed the feat/all-std-wgsl-impl branch from ec41eb0 to a2bc9f6 Compare August 5, 2025 09:21
@reczkok reczkok marked this pull request as ready for review August 5, 2025 09:21
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

pkg.pr.new

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

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

benchmark
view benchmark

commit
view commit

Copy link
Collaborator

@iwoplaza iwoplaza left a comment

Choose a reason for hiding this comment

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

Yeppers!

Copy link
Contributor

@lursz lursz left a comment

Choose a reason for hiding this comment

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

Checked for types mismatch against wgsl spec, everything checks out!
Great work

@reczkok reczkok force-pushed the feat/all-std-wgsl-impl branch from 93356f3 to 6aea8ec Compare August 5, 2025 12:00
Copy link
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

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

Great! 🐥

Comment on lines 55 to 57
[$internal]: {
builtinName: undefined,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

How about we make this property optional and just put {} here? Could we make {} a default instead of true for internals in general, or is it too much overhead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I like the verbosity in this particular case - but now that I think about it it should be null instead of undefined. Also I don't see a reason to change it to {} at least for this particular pr.

Copy link
Contributor

Choose a reason for hiding this comment

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

Some of the functions are missing the private remarks. I wonder, are they even necessary? I would either opt to remove them entirely, or to make them regular jsdocs so that users can easily check which functions are WGSL builtins and which are not (allEq, operators, isCloseTo, potentially ulog2 in the future etc.).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think turning them into regular jscocs is a good idea

Copy link
Collaborator

@iwoplaza iwoplaza left a comment

Choose a reason for hiding this comment

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

Let's gooooo

@reczkok reczkok force-pushed the feat/all-std-wgsl-impl branch from 1d1284b to cc5d9cd Compare August 7, 2025 10:25
@iwoplaza iwoplaza merged commit dc4da0d into main Aug 7, 2025
6 checks passed
@iwoplaza iwoplaza deleted the feat/all-std-wgsl-impl branch August 7, 2025 16: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.

feat: Represent the full WGSL standard library, without focusing on the JS implementation

5 participants