BBBsmoke / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Shader parsing accepts structure definition as a structure constructor #939

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile the following shader code:
void main() {
    struct a { float b; } (0.0);
}

What is the expected output? What do you see instead?
Expected: An error is produced when parsing the code.
Actual: The code is parsed and produces output where an undefined structure 
constructor is called.

The specs (ESSL1 and ESSL3) say:
"Once a structure is defined, and its type is given a name, a constructor is 
available with the same name to construct instances of that structure."

This seems to imply that the structure needs to be defined separately before 
its constructor is used.

Original issue reported on code.google.com by oetu...@nvidia.com on 9 Mar 2015 at 3:55