-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
intro to wgsl-tooling-wg #225
Comments
Hi @mighdoll! Thank you for reaching out! That's a great project! I will take a deeper look to it. yes! some Yes! some precompilation macros (defines and conditionals) would be amazing. As you can see in GLSL, HLSL and Metal, we use them extensively for templating, name collisions and back compatibility between different language version. In my wish list for WGSL I also have function overloading! It allow us to build simple and friendly interfaces. |
+1 to both ideas, this looks awesome @mighdoll. Some of my thoughts: A standard for imports / code splitting with conditional imports is much needed. An important request for WGSL extensions - they can not break vanilla code. I.e. if While translating some files from GLSL to WGSL here, I ran into a few issues. Not all have solutions, but I'll enumerate anyway: 1. Function Overloading gpuweb tracking issueI attempted to document a working pattern in function naming for method overloading, here: DESIGN.md#wgsl-specifics. At the time of writing, I was working on a GLSL -> WGSL translator, attempting to automate this process. I believe it is possible, but more generally, a way to support method overloading with a preprocessor merits investigation, in my opinion. ExampleI could not find a good solution to setting the 2. Macro ArgumentsExampleSee the GLSL file here: generative/voronoi.glsl.
At the time of translating to WGSL, I omitted this option, so I would not have to impose a specific preprocessor library on users. Many do not currently support macro arguments. |
Hey, wanted to introduce our effort over in the wgsl-tooling-wg to extend WGSL with community tooling. The idea is to extend WGSL to support features like
import
from local files and cargo/npm packages. We're also looking to add extensions for things like conditional compilation (@if
), etc.It looks like Lygia could really use some standard tooling for
import
, and maybe conditional compilation.. Is there anything else Lygia would need?The text was updated successfully, but these errors were encountered: