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

Invalid characters in function names #27

Open
luithefirst opened this issue Aug 24, 2022 · 1 comment
Open

Invalid characters in function names #27

luithefirst opened this issue Aug 24, 2022 · 1 comment

Comments

@luithefirst
Copy link
Collaborator

I've tried to use a function with a prime character in its name in a compute shader (like we do so often in the f# world). This is translated 1:1 to glsl:

...
float HiliteShaders_SpecularDenoiseCompute_getSpecMagicCurve'_zyS3pDZ51CZk00MS3tzYpQ1Q0FyI(float roughness, float power)
...

and then you get an error like: error C0160: invalid character literal

It would be nice if we add a check if a function name is valid (ascii only) and if not find an appropriate substitute. A general scheme might be to replace "invalid" chars with their char code as sting. The prime character would then be replaced by "U2023", which should give us a deterministic (almost) unique name (I would not expect someone to actually write another function with this exact name). This is just a suggestion to start the discussion, for me any other mechanism that lets me use the code I naturally write (without needing to remember all the FShade restrictions) would be fine.

@krauthaufen
Copy link
Owner

There is name-mangling and afaik it handled these things correctly in the past

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