Skip to content

Conversation

@iwoplaza
Copy link

@iwoplaza iwoplaza commented Aug 4, 2025

This is an updated version of the original PR, but instead of functions being implemented in WGSL, they're implemented in TypeScript. This allows type-safety to flow from host code directly to shader code.

The inclusion of unplugin-typegpu allows the implementations of tgpu.fn functions to be compiled to WGSL at bundle time

@nikelborm
Copy link

Oh, Wow! That's exactly as I would have intuitively expected such an API to look like! 😉

@nikelborm
Copy link

nikelborm commented Aug 4, 2025

Were any of the tools I mentioned in the previous PR helpful in the process of creating this implementation?

@iwoplaza
Copy link
Author

iwoplaza commented Aug 4, 2025

Were any of the tools I mentioned in the previous PR helpful in the process of creating this implementation?

Not this particular one, as we've already had plugins for other bundlers, so porting it over was relatively straightforward. The projects you mentioned are going to be really helpful when tackling the WGSL-literal inference and linting.

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.

2 participants