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 | |
Chow | a8f9886 | 2019-11-26 16:28:52 +0800 | [diff] [blame] | 20 | |
John Kessenich | afda241 | 2013-12-04 20:41:33 +0000 | [diff] [blame] | 21 | in struct S { float f; } s; // ERROR |
John Kessenich | e8fe7b8 | 2013-12-18 18:47:12 +0000 | [diff] [blame] | 22 | |
John Kessenich | 782aa83 | 2014-02-12 05:15:49 +0000 | [diff] [blame] | 23 | float patch = 3.1; |
| 24 | |
| 25 | layout(location=3) in vec4 vl; // ERROR |
| 26 | |
John Kessenich | f856599 | 2014-07-29 19:31:13 +0000 | [diff] [blame] | 27 | layout(location = 3) out vec4 factorBad; // ERROR |
| 28 | |
| 29 | #extension GL_ARB_explicit_attrib_location : enable |
| 30 | |
| 31 | layout(location = 5) out vec4 factor; |
| 32 | |
John Kessenich | 782aa83 | 2014-02-12 05:15:49 +0000 | [diff] [blame] | 33 | #extension GL_ARB_separate_shader_objects : enable |
| 34 | |
| 35 | layout(location=4) in vec4 vl2; |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 36 | |
John Kessenich | 968c8f8 | 2015-04-30 03:22:41 +0000 | [diff] [blame] | 37 | float fooi(); |
| 38 | |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 39 | void foo() |
| 40 | { |
| 41 | vec2 r1 = modf(v.xy, v.zw); // ERROR, v.zw not l-value |
| 42 | vec2 r2 = modf(o.xy, o.zw); |
John Kessenich | 968c8f8 | 2015-04-30 03:22:41 +0000 | [diff] [blame] | 43 | o.z = fooi(); |
| 44 | } |
| 45 | |
| 46 | // Test extra-function initializers |
| 47 | |
| 48 | float i1 = gl_FrontFacing ? -2.0 : 2.0; |
| 49 | float i2 = 102; |
| 50 | |
| 51 | float fooi() |
| 52 | { |
| 53 | return i1 + i2; |
John Kessenich | f5dd2f5 | 2014-03-26 03:17:31 +0000 | [diff] [blame] | 54 | } |
Chow | a8f9886 | 2019-11-26 16:28:52 +0800 | [diff] [blame] | 55 | |
| 56 | uniform sampler2DMS aaa1; // ERROR |
| 57 | |
| 58 | #extension GL_ARB_texture_multisample : enable |
| 59 | |
| 60 | uniform sampler2DMS aaa2; |