MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

GLSL shader generator allows for invalid "__" substring in identifiers

Open kwokcb opened this issue 3 years ago • 2 comments

If a shader node has a name with "__" substring within the it's name the GLSL shader generator will generate identifiers with that string in it. This is not allowed so shader compilation will fail. Error is:

error C7528: OpenGL reserves names containing '__'

kwokcb avatar Jun 29 '22 21:06 kwokcb

@kwokcb Is there an example of a node with __? Do we need to place a restriction on node name specification or handle this in shader generation?

ashwinbhat avatar Jul 07 '22 01:07 ashwinbhat

A name with __ in the middle of the name fails. I believe __ at the start of the name is okay. Would be a pretty easy fix to add in some additional logic into the GLSL shader generator, so all inherited generators pick it up.

kwokcb avatar Jul 07 '22 02:07 kwokcb