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

VisualShader varyings names can break the shader #93205

Closed
Grandro opened this issue Jun 15, 2024 · 0 comments · Fixed by #93219
Closed

VisualShader varyings names can break the shader #93205

Grandro opened this issue Jun 15, 2024 · 0 comments · Fixed by #93219

Comments

@Grandro
Copy link

Grandro commented Jun 15, 2024

Tested versions

  • 4.2.2
  • 4.3-dev6

System information

Windows 10

Issue description

You can name a varying in a visual shader nearly however you want and the generated code just copies the name over 1:1, so you can (accidentally) choose protected keywords. E.g.:
varying, float, shader_type , ...
which breaks the shader.

A possible solution would be to always add some sort of suffix/prefix or to prevent the user from choosing such a name:
varying => Varying_varying
float => Varying_float

Steps to reproduce

  1. Create a new project
  2. Create a VisualShader, apply it to a Material and the Material to a Sprite
  3. Create any varying with a reserved keyword name

Minimal reproduction project (MRP)

VaryingNaming.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants