Skip to content
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

feat: Allow passing raw wgsl implementation to shell à la template literal #1128

Merged
merged 21 commits into from
Apr 11, 2025

Conversation

aleksanderkatan
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Apr 8, 2025

pkg.pr.new

packages

pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@1128
pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@e31e8532096ee32b8c138b401a80ad931afcd00c

benchmark
view benchmark

commit
view commit

@aleksanderkatan aleksanderkatan marked this pull request as ready for review April 8, 2025 09:32
@aleksanderkatan aleksanderkatan requested review from mhawryluk, iwoplaza and reczkok and removed request for mhawryluk April 8, 2025 09:32
Copy link
Collaborator

@mhawryluk mhawryluk left a comment

Choose a reason for hiding this comment

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

please implement the same thing for vertexFn, fragmentFn and computeFn. and update some examples to use this api (I suggest box raytracing), and functions documentation

@aleksanderkatan aleksanderkatan marked this pull request as draft April 8, 2025 11:58
@aleksanderkatan aleksanderkatan marked this pull request as ready for review April 9, 2025 14:26
createComputeFn(
shell,
options.workgroupSize,
implementation as Implementation,
stripTemplate(arg as Implementation | TemplateStringsArray, ...values),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
stripTemplate(arg as Implementation | TemplateStringsArray, ...values),
stripTemplate(arg, ...values),

and same for all the other functions. I believe arg parameter of the call function can be typed as Implementation | TemplateStringsArray in fragment and vertex too, but we should check

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we can replace those argument types with raw Implementation | TemplateStringsArray, however I think that our Implementation type needs tweaking. I failed to come up with something right now, so I created issue #1147

Copy link
Collaborator

@mhawryluk mhawryluk left a comment

Choose a reason for hiding this comment

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

Great work! 🎉

@aleksanderkatan aleksanderkatan merged commit 12d31e3 into main Apr 11, 2025
6 checks passed
@aleksanderkatan aleksanderkatan deleted the feat/allow-passing-raw-wgsl-to-shell branch April 11, 2025 08:41
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.

Allow passing raw wgsl implementation to shell à la template literal
2 participants