blob: 2bc2f59fe0c2a6df37d8d107f59f7137fdddcaab [file] [log] [blame]
John Kessenich564842b2013-01-10 18:20:47 +00001#version 140
2
3varying vec4 v;
4
5in vec4 i;
6out vec4 o;
7
John Kesseniche7c59c12013-10-16 22:28:35 +00008in float gl_ClipDistance[5];
9
John Kessenich564842b2013-01-10 18:20:47 +000010void main()
11{
John Kesseniche7c59c12013-10-16 22:28:35 +000012 float clip = gl_ClipDistance[2];
John Kessenich564842b2013-01-10 18:20:47 +000013}
John Kessenichb51f62c2013-04-11 16:31:09 +000014#ifdef GL_ES
15#error GL_ES is set
16#else
17#error GL_ES is not set
18#endif
John Kessenichafda2412013-12-04 20:41:33 +000019
20in struct S { float f; } s; // ERROR
John Kesseniche8fe7b82013-12-18 18:47:12 +000021
John Kessenich782aa832014-02-12 05:15:49 +000022float patch = 3.1;
23
24layout(location=3) in vec4 vl; // ERROR
25
John Kessenichf8565992014-07-29 19:31:13 +000026layout(location = 3) out vec4 factorBad; // ERROR
27
28#extension GL_ARB_explicit_attrib_location : enable
29
30layout(location = 5) out vec4 factor;
31
John Kessenich782aa832014-02-12 05:15:49 +000032#extension GL_ARB_separate_shader_objects : enable
33
34layout(location=4) in vec4 vl2;
John Kessenichf5dd2f52014-03-26 03:17:31 +000035
John Kessenich968c8f82015-04-30 03:22:41 +000036float fooi();
37
John Kessenichf5dd2f52014-03-26 03:17:31 +000038void foo()
39{
40 vec2 r1 = modf(v.xy, v.zw); // ERROR, v.zw not l-value
41 vec2 r2 = modf(o.xy, o.zw);
John Kessenich968c8f82015-04-30 03:22:41 +000042 o.z = fooi();
43}
44
45// Test extra-function initializers
46
47float i1 = gl_FrontFacing ? -2.0 : 2.0;
48float i2 = 102;
49
50float fooi()
51{
52 return i1 + i2;
John Kessenichf5dd2f52014-03-26 03:17:31 +000053}