Hi,
This code leads to a parse error:
#version 400
struct B
{
vec3 t;
};
struct K
{
float A, B; // parse error here
};
void main(){}
glslang.exe .\test.frag
ERROR: 0:8: '' : syntax error, unexpected TYPE_NAME, expecting IDENTIFIER
ERROR: 1 compilation errors. No code generated.
To workaround this error, I can either:
- rename the field B (so that it's not the same name as the first struct;
- or split the line into
float A; float B;
- or switch the order of fields:
float B, A;
So the parse error happens when I define multiple fields of the same type, and one of them (except the first one) has the same name as a struct define above.
For the context, I'm working on a shader minifier, so using single-letter names is useful.
Hi,
This code leads to a parse error:
To workaround this error, I can either:
float A; float B;float B, A;So the parse error happens when I define multiple fields of the same type, and one of them (except the first one) has the same name as a struct define above.
For the context, I'm working on a shader minifier, so using single-letter names is useful.