ValhallaTeam / angleproject

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

Initializer does not match type. #431

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Compile this shader:

    precision mediump int;

    void main(){
        float test1[4], test2;
        gl_FragColor = vec4(0.0,1.0,0.0,1.0);
    }

What is the expected output? What do you see instead?
Expected: a green triangle.

Compiling fails with this error:

(10,33-53): error X3017: '_test2': initializer does not match type

Warning: D3D shader compilation failed with default flags. Retrying with avoid 
flow control.
(10,33-53): error X3017: '_test2': initializer does not match type

Warning: D3D shader compilation failed with avoid flow control flags. Retrying 
with prefer flow control.
(10,33-53): error X3017: '_test2': initializer does not match type

What version of the product are you using? On what operating system?

Please provide any additional information below.

Actual shader is much complex than that, obviously, and it works if I change 
that line to this:
    float test1[4];
    float test2;

Original issue reported on code.google.com by kungfoobar@gmail.com on 5 Jun 2013 at 9:25

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. I was able to reproduce it with the latest revision 
as well by simply adding "float test1[4], test2;" to any shader.

Original comment by nico...@transgaming.com on 5 Jun 2013 at 2:50

GoogleCodeExporter commented 9 years ago
CLs to address this:

master: https://chromium-review.googlesource.com/#/c/179350/
es3proto: https://chromium-review.googlesource.com/#/c/179351/

Original comment by jmad...@chromium.org on 9 Dec 2013 at 9:22

GoogleCodeExporter commented 9 years ago
Ken, should this be a WebGL test somewhere? I could add one if there's no 
existing test, not sure how thorough we should go.

Original comment by jmad...@chromium.org on 9 Dec 2013 at 9:36

GoogleCodeExporter commented 9 years ago
A test should actually use the variables, to make sure they're not removed by 
possible future optimizations.

Original comment by kungfoobar@gmail.com on 9 Dec 2013 at 9:59

GoogleCodeExporter commented 9 years ago
Yes, please add a WebGL conformance test for this. It probably belongs under 
sdk/tests/conformance/glsl/, but I don't know the best place. Maybe bajones@ or 
zmo@ can advise. @kungfoobar is right; in the test, the variables need to be 
used to prevent them from being optimized out.

Original comment by kbr@chromium.org on 9 Dec 2013 at 10:08

GoogleCodeExporter commented 9 years ago
I think it should go to conformance/glsl/misc

Original comment by zmo@chromium.org on 10 Dec 2013 at 7:23

GoogleCodeExporter commented 9 years ago
Added https://github.com/KhronosGroup/WebGL/pull/960

Original comment by jmad...@chromium.org on 28 Apr 2015 at 1:57