blob: 318f41d382f4d14dbefd455bb69e3b3f9c6bd9f3 [file] [log] [blame]
Jamie Madill96509e42014-05-29 14:33:27 -04001#include "ANGLETest.h"
2
3class GLSLStructTest : public ANGLETest
4{
5protected:
6 GLSLStructTest()
7 {
8 setWindowWidth(128);
9 setWindowHeight(128);
10 setConfigRedBits(8);
11 setConfigGreenBits(8);
12 setConfigBlueBits(8);
13 setConfigAlphaBits(8);
14 }
15};
16
17TEST_F(GLSLStructTest, scoped_structs_bug)
18{
19 const std::string vertexShaderSource = SHADER_SOURCE
20 (
21 attribute vec4 inputAttribute;
22 void main()
23 {
24 gl_Position = inputAttribute;
25 }
26 );
27
28 const std::string fragmentShaderSource = SHADER_SOURCE
29 (
30 precision mediump float;
31
32 struct T_0
33 {
34 float f;
35 };
36
37 void main()
38 {
39 gl_FragColor = vec4(1, 0, 0, 1);
40
41 struct T
42 {
43 vec2 v;
44 };
45
46 T_0 a;
47 T b;
48
49 gl_FragColor.a += a.f;
50 gl_FragColor.a += b.v.x;
51 }
52 );
53
54 GLuint program = compileProgram(vertexShaderSource, fragmentShaderSource);
55 EXPECT_NE(0u, program);
56}