blob: 28465525921f6dab886e2cb5611fae8213bf85a6 [file] [log] [blame]
John Kessenich01fc0642013-06-24 21:22:03 +00001#version 420 core
2
3varying vec2 v2; // ERROR, varying reserved
4in vec4 bad[10];
5highp in vec4 badorder;
6out invariant vec4 badorder2;
7in centroid vec4 badorder4; // ERROR, no centroid input to vertex stage
8out flat vec4 badorder3;
9void bar(in const float a);
10void bar2(highp in float b);
11smooth flat out vec4 rep; // ERROR, replicating interpolation qualification
12centroid sample out vec4 rep2; // ERROR, replicating auxiliary qualification
13in uniform vec4 rep3; // ERROR, replicating storage qualification
John Kessenichd46b31f2013-08-27 03:59:04 +000014
John Kesseniche46b0872013-10-17 20:55:30 +000015int anonconst;
16const int aconst = 5;
17const int a = aconst;
18const int b = anonconst; // ERROR at global scope
19
20const int foo() // ERROR, no const functions
21{
22 const int a = aconst;
23 const int b = anonconst;
24 const int c = a; // still compile-time const
25 const int d = b; // not a compile-time const
26 float x[c]; // okay
27 float y[d]; // ERROR
28
29 return b;
30}
31
John Kessenichd46b31f2013-08-27 03:59:04 +000032void main()
33{
34 int i;
35 if (i == 3)
36 int j = i;
37 else
38 int k = j; // ERROR, j is undeclared
39 int m = k; // ERROR, k is undeclared
40 int n = j; // ERROR, j is undeclared
41
42 while (true)
43 int jj;
44 int kk = jj; // ERROR, jj is undeclared
45}
46
John Kessenich8f13e132013-10-18 03:56:23 +000047const float cx = 4.20;
48const float dx = 4.20;
49
John Kessenichd46b31f2013-08-27 03:59:04 +000050void bar(in highp volatile vec4 v)
51{
John Kessenich8f13e132013-10-18 03:56:23 +000052 int s;
53 s.x; // okay
54 s.y; // ERROR
55 if (bad[0].x == cx.x)
56 ;
57 if (cx.x == dx.x)
58 badorder3 = bad[0];
59
60 float f;
61 vec3 smeared = f.xxx;
62 f.xxxxx; // ERROR
63 f.xxy; // ERROR
64}
John Kessenichab308032013-10-18 21:37:55 +000065
66layout(binding = 3) uniform; // ERROR
67layout(binding = 3) uniform boundblock { int aoeu; } boundInst;
68layout(binding = 7) uniform anonblock { int aoeu; } ;
69layout(location = 1) in; // ERROR
70layout(binding = 1) in inblock { int aoeua; }; // ERROR
71layout(binding = 100000) uniform anonblock2 { int aooeu; } ;
72layout(binding = 4) uniform sampler2D sampb1;
73layout(binding = 5) uniform sampler2D sampb2[10];
John Kessenich1fbaa352013-11-27 02:41:52 +000074layout(binding = 32) uniform sampler2D sampb3; // ERROR, binding too big
75layout(binding = 31) uniform sampler2D sampb4;
76layout(binding = 31) uniform sampler2D sampb5[2]; // ERROR, binding too big
John Kessenich143c8bf2013-12-03 21:04:03 +000077
78int fgfg(float f, mediump int i);
79int fgfg(float f, highp int i);