John Kessenich | 564842b | 2013-01-10 18:20:47 +0000 | [diff] [blame] | 1 | #version 140 |
| 2 | |
| 3 | varying vec4 v; |
| 4 | |
| 5 | in vec4 i; |
| 6 | out vec4 o; |
| 7 | |
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 8 | in float gl_ClipDistance[5]; |
| 9 | |
John Kessenich | 564842b | 2013-01-10 18:20:47 +0000 | [diff] [blame] | 10 | void main() |
| 11 | { |
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 12 | float clip = gl_ClipDistance[2]; |
John Kessenich | 564842b | 2013-01-10 18:20:47 +0000 | [diff] [blame] | 13 | } |
John Kessenich | b51f62c | 2013-04-11 16:31:09 +0000 | [diff] [blame] | 14 | #ifdef GL_ES |
| 15 | #error GL_ES is set |
| 16 | #else |
| 17 | #error GL_ES is not set |
| 18 | #endif |
John Kessenich | afda241 | 2013-12-04 20:41:33 +0000 | [diff] [blame] | 19 | |
| 20 | in struct S { float f; } s; // ERROR |
John Kessenich | e8fe7b8 | 2013-12-18 18:47:12 +0000 | [diff] [blame] | 21 | |
John Kessenich | 782aa83 | 2014-02-12 05:15:49 +0000 | [diff] [blame] | 22 | float patch = 3.1; |
| 23 | |
| 24 | layout(location=3) in vec4 vl; // ERROR |
| 25 | |
John Kessenich | f856599 | 2014-07-29 19:31:13 +0000 | [diff] [blame] | 26 | layout(location = 3) out vec4 factorBad; // ERROR |
| 27 | |
| 28 | #extension GL_ARB_explicit_attrib_location : enable |
| 29 | |
| 30 | layout(location = 5) out vec4 factor; |
| 31 | |
John Kessenich | 782aa83 | 2014-02-12 05:15:49 +0000 | [diff] [blame] | 32 | #extension GL_ARB_separate_shader_objects : enable |
| 33 | |
| 34 | layout(location=4) in vec4 vl2; |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 35 | |
John Kessenich | 968c8f8 | 2015-04-30 03:22:41 +0000 | [diff] [blame] | 36 | float fooi(); |
| 37 | |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 38 | void 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 Kessenich | 968c8f8 | 2015-04-30 03:22:41 +0000 | [diff] [blame] | 42 | o.z = fooi(); |
| 43 | } |
| 44 | |
| 45 | // Test extra-function initializers |
| 46 | |
| 47 | float i1 = gl_FrontFacing ? -2.0 : 2.0; |
| 48 | float i2 = 102; |
| 49 | |
| 50 | float fooi() |
| 51 | { |
| 52 | return i1 + i2; |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 53 | } |