devwaker / angleproject

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

Too deeply nested struct member type is reported incorrectly #459

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Commit 0600ff1a7cf1 (Simplified TType class by carving out TStructure and 
TField.) breaks nested struct member type reporting.

What steps will reproduce the problem?
1. Use a shader with deeply nested structs:
$ cat broken.vert 
// shader with too-deep struct nesting should fail per WebGL spec

struct nesting5 {
    vec4 vector;
};

struct nesting4 {
    nesting5 field5;
};

struct nesting3 {
    nesting4 field4;
};

struct nesting2 {
    nesting3 field3;
};

struct nesting1 {
    nesting2 field2;
};

uniform nesting1 uniform1;

void main()
{
    gl_Position = uniform1.field2.field3.field4.field5.vector;
}

(taken from 
https://www.khronos.org/registry/webgl/conformance-suites/1.0.1/conformance/glsl
/misc/struct-nesting-exceeds-maximum.html)
2. Translate it, using for example the essl_to_glsl sample:

$ essl_to_glsl -o -s=w broken.vert

What is the expected output? What do you see instead?
Expected output (before commit 0600ff1a7cf1):
ERROR: 1:6: '' :  Reference of struct type nesting2 exceeds maximum struct 
nesting of 4

Output is instead:
ERROR: 1:6: '' :  Reference of struct type field2 exceeds maximum struct 
nesting of 4

What version of the product are you using? On what operating system?
1.2.0.2428 on Ubuntu 12.04.

Original issue reported on code.google.com by matias.j...@gmail.com on 13 Aug 2013 at 10:44

GoogleCodeExporter commented 9 years ago

Original comment by alokp@chromium.org on 13 Aug 2013 at 4:21

GoogleCodeExporter commented 9 years ago
Fixed in re06002a.
https://codereview.appspot.com/12891043/

Original comment by alokp@chromium.org on 13 Aug 2013 at 10:12