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

GLSL code generation fails if identifiers start with numbers #2112

Closed
kwokcb opened this issue Nov 13, 2024 · 2 comments
Closed

GLSL code generation fails if identifiers start with numbers #2112

kwokcb opened this issue Nov 13, 2024 · 2 comments

Comments

@kwokcb
Copy link
Contributor

kwokcb commented Nov 13, 2024

Issue

Identifiers which start with numbers are not being sanitized properly for GLSL. This may be true for other languages like MSL.

Example

<?xml version="1.0"?>
<materialx version="1.39">
  <surfacematerial name="surfacematerial" type="material" xpos="16.782608" ypos="-0.844828">
    <input name="surfaceshader" type="surfaceshader" nodename="1_node" />
  </surfacematerial>
  <standard_surface name="1_node" type="surfaceshader" xpos="12.471014" ypos="-1.482759" />
</materialx>

Workflow

This was created using the node editor, with these errors:

Error in compiling fragment shader:
0(1898) : error C0000: syntax error, unexpected integer constant, expecting ';' or '(' at token "<int-const>"
0(1899) : error C0000: syntax error, unexpected identifier, expecting ')' at token "_node_out"
0(1900) : error C0000: syntax error, unexpected identifier, expecting ',' or ')' at token "_node_out"

It would be nice if these strings were disallowed based on shading language but a different issue.

@jstone-lucasfilm
Copy link
Member

@kwokcb This sounds like a familiar topic, and I think it may be a subset of this GitHub Issue from October?

#2045

@kwokcb
Copy link
Contributor Author

kwokcb commented Nov 13, 2024

Ah. Your correct. Closing this as a duplicate.

@kwokcb kwokcb closed this as completed Nov 13, 2024
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