1#version 140 2 3varying vec4 v; 4 5in vec4 i; 6out vec4 o; 7 8in float gl_ClipDistance[5]; 9 10void main() 11{ 12 float clip = gl_ClipDistance[2]; 13} 14#ifdef GL_ES 15#error GL_ES is set 16#else 17#error GL_ES is not set 18#endif 19 20in struct S { float f; } s; // ERROR 21 22float patch = 3.1; 23 24layout(location=3) in vec4 vl; // ERROR 25 26layout(location = 3) out vec4 factorBad; // ERROR 27 28#extension GL_ARB_explicit_attrib_location : enable 29 30layout(location = 5) out vec4 factor; 31 32#extension GL_ARB_separate_shader_objects : enable 33 34layout(location=4) in vec4 vl2; 35 36float fooi(); 37 38void foo() 39{ 40 vec2 r1 = modf(v.xy, v.zw); // ERROR, v.zw not l-value 41 vec2 r2 = modf(o.xy, o.zw); 42 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; 53} 54