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

Pass vec4 to a fragment wgsl #3

Open
eduardfossas opened this issue Feb 1, 2022 · 1 comment
Open

Pass vec4 to a fragment wgsl #3

eduardfossas opened this issue Feb 1, 2022 · 1 comment

Comments

@eduardfossas
Copy link

Hello, I am following your examples in the book and the videos on youtube and I see you decided to go for a template string inside a typescript file instead of using wgsl extension. I have two questions regarding this:

  • Is there a performance impact on doing so? Does it decrease the performance of WebGPU using a template string instead of a .wgsl file?
  • How can you pass a vec4 from the pipeline to a fragment wgsl shader?

Thank you very much for sharing your experience.

@jack1232
Copy link
Owner

no performance impact. wgsl file will be converted to string in the pipeline. starting from video series 42, I started to use wgsl extension to write shader code because it it easier to code that the string.

use uniform buffer to pass vec4 to shader.

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

No branches or pull requests

2 participants