7 void test_function(const in int in_int, inout int out_int);
8 int test_function1(in int in_int, inout int out_int);
10 int test_function1(in int in_int1, inout int , out int);
11 int test_function1(in int in_int1, inout int , out int);
13 uniform float array_float[2];
28 varying struct light3 {
32 attribute struct light4 {
41 uniform light3 uniformLight3;
43 uniform struct light6 {
46 uniform light6 uniformLight6;
60 light3 struct_var = light3(5.0);
62 // Attribute variables can only be Global
63 attribute float flt_attrib;
64 attribute vec2 vec2_attrib;
65 attribute vec3 vec3_attrib;
66 attribute vec4 vec4_attrib;
67 attribute mat2 mat2_attrib;
68 attribute mat3 mat3_attrib;
69 attribute mat4 mat4_attrib;
71 uniform float flt_uniform;
72 uniform vec3 uniform_vec3;
73 uniform mat3 uniform_mat3;
75 uniform sampler1D samp[];
76 uniform sampler1D samp1;
78 const struct light12 {
80 } uniform_struct = light12(2);
82 varying vec3 varying_vec3;
83 varying vec2 varying_vec2;
84 varying vec4 varying_vec4;
85 varying mat4 varying_mat4;
86 varying mat2 varying_mat2;
87 varying mat3 varying_mat3;
88 varying float varying_flt;
92 void test_function2(int func_int)
96 void test_function3(light3);
97 void test_function4(light5 ll20);
98 void test_function5(light1);
99 light6 test_function6(int a);
101 const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0;
102 const bool BoolConst1 = true && true || false;
103 const bool BoolConst2 = false || !false && false;
121 structMain newStruct, newStruct1;
122 testStruct = newStruct;
123 newStruct = newStruct1;
125 lightVar.light2.f = 1.1;
130 const struct const_struct {
132 } const_struct_inst = const_struct(1.0);
135 ll1.light2 = ll2.light2;
136 ll1.light2 = ll1.light2;
137 ll1.light2.f = ll2.light2.f;
138 ll1.light2.f = ll1.light2.f;
146 structMain newStruct2[2];
147 newStruct2[0].i = 1.1;
149 ll7[0].light8.light9.light10.f = 1.1;
152 bool test_bool4 = false ;
154 bool test_bool5 = 1.2 > 3.0 ;
157 int test_int4 = 0xa8; // testing for hexadecimal numbers
159 float test_float1 = 1.5;
160 float test_float2 = .01;
161 float test_float3 = 10.;
162 float test_float4 = 10.01;
163 float test_float5 = 23e+2;
164 float test_float6 = 23E-3;
165 float test_float8 = 23E2;
166 bool test_bool6 = BoolConst1 && ! (test_int1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (test_float1 != 0.0);
168 vec4 color = vec4(0.0, 1.0, 0.0, 1.0);
169 vec4 color2 = vec4(0.0);
171 vec3 color4 = vec3(test_float8);
173 ivec4 test_int_vect1 = ivec4(1.0,1.0,1.0,1.0);
174 ivec3 test_int_vec3 = ivec3(1, 1, 1) ;
176 bvec4 test_bool_vect1 = bvec4(1., 1., 1. , 1. );
178 vec2 test_vec2 = vec2(1., 1.);
179 vec2 test_vec3 = vec2(1., 1);
180 vec4 test_vec4 = vec4(test_int_vect1);
182 vec2 test_vec5 = vec2(color4);
183 vec3 test_vec7 = vec3(color);
184 vec3 test_vec8 = vec3(test_vec2, test_float4);
185 vec3 test_vec9 = vec3(test_float4, test_vec2);
187 vec4 test_vec10 = vec4(test_vec9, 0.01);
188 vec4 test_vec11 = vec4(0.01, test_vec9);
190 vec4 test_vec12 = vec4(test_vec2, test_vec2);
192 mat2 test_mat2 = mat2(test_float3);
193 mat3 test_mat3 = mat3(test_float3);
194 mat4 test_mat4 = mat4(test_float3);
196 mat2 test_mat7 = mat2(test_vec2, test_vec2);
197 mat2 test_mat8 = mat2(01.01, 2.01, 3.01, 4.01);
199 mat3 test_mat9 = mat3(test_vec7, test_vec7, test_vec7);
200 mat4 test_mat10 = mat4(test_vec10, test_vec10, test_vec10, test_vec10);
201 test_mat10[1] = test_vec10;
204 mat2 test_mat12 = mat2(test_vec2, 0.01, 0.01);
205 mat2 test_mat13 = mat2(0.01, 5., test_vec2);
206 mat2 test_mat15 = mat2(0.1, 5., test_vec2 );
208 //mat2 test_mat16 = mat2(test_mat9);
209 //mat2 test_mat17 = mat2(test_mat10);
214 while(test_float1 < 1.0);
219 const int array_index = 2;
220 freq2[test_int1] = 1.9 ;
221 freq2[array_index] = 1.8;
223 const int const_int = 5;
225 test_float1 = varying_flt;
229 test_function(test_int1, test_int1);
230 test_function(test_int1, intArray[2]);
232 vec3 vv = vec3(test_function1(test_int1, out_int));
233 bool bool_var = true;
234 int test_int6 = int(bool_var);
235 test_float1 = float(bool_var);
236 test_float1 = float(test_int6);
237 test_int6 = int(test_float1);
238 bool_var = bool(test_int6);
239 bool_var = bool(test_float1);
240 test_float1 = float(test_vec9);
247 color.zy = test_vec2;
251 test_mat2[0][0] = 1.1;
258 test_mat12 *= test_mat13 ;
259 test_mat12 *= test_float1;
260 test_vec2 *= test_float1;
261 test_vec2 *= test_mat12;
270 test_vec2 = test_vec2 + test_float1;
271 test_vec2 = test_float1 + test_vec2;
273 test_mat12 = test_mat12 * test_mat13;
274 test_vec2 = test_vec2 * test_vec5;
279 bool test_bool2 = test_float2 > test_float3;
281 bool test_bool3 = test_int1 > test_int6 ;
283 test_bool3 = test_vec2 == test_vec5;
285 test_bool2 = test_bool3 && test_bool4;
286 test_bool2 = test_bool3 || test_bool4;
287 test_bool2 = test_bool3 ^^ test_bool4;
289 test_bool2 = !test_bool3;
291 test_bool3 = !(test_int1 > test_int6) ;
293 test_float1 = test_int1 > test_int6 ? test_float2 : test_float3;
294 test_vec2 = test_int1 > test_int6 ? test_vec2 : test_vec5;
300 if(test_float1 > test_float2)
314 for(int for_int=0; for_int < 5; for_int++)
316 // do nothing as such
325 for(; test_bool2 = (test_float1 > test_float2); )
329 for(int for_int1; test_bool2; )
334 for(; test_bool2; test_float1++)
339 while(bool b = (test_float1 > test_float2))
365 // VERTEX SHADER ONLY VARIABLES
367 gl_ClipVertex = vec4(2.0, 3.0, 1.0, 1.1);
369 gl_Position = vec4(2.0, 3.0, 1.0, 1.1);
370 gl_Position = gl_Vertex;
373 // VERTEX SHADER BUILT-IN ATTRIBUTES
375 vec4 builtInV4 = gl_Color + gl_SecondaryColor + gl_Vertex + gl_MultiTexCoord0 + gl_MultiTexCoord1 + gl_MultiTexCoord2 + gl_MultiTexCoord3 + gl_MultiTexCoord4 + gl_MultiTexCoord5 + gl_MultiTexCoord6 + gl_MultiTexCoord7;
378 int builtInI = gl_MaxLights + gl_MaxClipPlanes + gl_MaxTextureUnits + gl_MaxTextureCoords + gl_MaxVertexAttribs + gl_MaxVertexUniformComponents + gl_MaxVaryingFloats + gl_MaxVertexTextureImageUnits + gl_MaxCombinedTextureImageUnits + gl_MaxTextureImageUnits + gl_MaxFragmentUniformComponents + gl_MaxDrawBuffers ;
381 mat4 builtInM4 = gl_ModelViewMatrix + gl_ModelViewProjectionMatrix + gl_ProjectionMatrix;
385 gl_TextureMatrix[gl_MaxTextureCoords-1];
391 test_float1 = gl_DepthRange.near;
392 test_float1 = gl_DepthRange.far;
393 test_float1 = gl_DepthRange.diff;
395 gl_ClipPlane[gl_MaxClipPlanes-1] ;
400 gl_Point.fadeThresholdSize ;
401 gl_Point.distanceConstantAttenuation;
402 gl_Point.distanceLinearAttenuation ;
403 gl_Point.distanceQuadraticAttenuation;
405 gl_MaterialParameters test;
406 gl_FrontMaterial.emission;
408 color = gl_FrontMaterial.emission;
409 color = gl_FrontMaterial.ambient;
410 color = gl_FrontMaterial.diffuse;
411 color = gl_FrontMaterial.specular;
412 test_float1 = gl_FrontMaterial.shininess;
414 gl_LightSourceParameters lightSource;
416 float builtInFloat1 = gl_LightSource[0].spotExponent;
417 color = gl_LightSource[0].ambient;
418 color = lightSource.ambient;
419 color = lightSource.diffuse;
420 color = lightSource.specular;
421 color = lightSource.position;
422 color = lightSource.halfVector;
423 color4 = lightSource.spotDirection;
424 test_float1 = lightSource.spotExponent;
425 test_float1 = lightSource.spotCutoff;
426 test_float1 = lightSource.spotCosCutoff;
427 test_float1 = lightSource.constantAttenuation;
428 test_float1 = lightSource.linearAttenuation;
429 test_float1 = lightSource.quadraticAttenuation;
431 color = gl_LightModel.ambient;
433 gl_LightModelParameters lightModel;
434 color = gl_LightModel.ambient;
435 color = lightModel.ambient;
437 color = gl_FrontLightModelProduct.sceneColor ;
439 gl_LightModelProducts lightModelProd;
441 color = lightModelProd.sceneColor;
442 color = gl_FrontLightModelProduct.sceneColor;
444 color = gl_FrontLightProduct[0].ambient;
445 color = gl_FrontLightProduct[0].ambient;
446 gl_LightProducts lightProd;
448 color = lightProd.ambient;
449 color = lightProd.diffuse;
450 color = lightProd.specular;
453 color = gl_TextureEnvColor[gl_MaxTextureUnits-1];
455 color = gl_EyePlaneS[gl_MaxTextureCoords-1] ;
457 color = gl_EyePlaneT[gl_MaxTextureCoords-1];
459 color = gl_EyePlaneR[gl_MaxTextureCoords-1];
461 color = gl_EyePlaneQ[gl_MaxTextureCoords-1];
463 color = gl_ObjectPlaneS[gl_MaxTextureCoords-1];
465 color = gl_ObjectPlaneT[gl_MaxTextureCoords-1] ;
467 color = gl_ObjectPlaneR[gl_MaxTextureCoords-1];
469 color = gl_ObjectPlaneQ[gl_MaxTextureCoords-1];
471 test_float1 = gl_Fog.density ;
472 test_float1 = gl_Fog.start ;
473 test_float1 = gl_Fog.end ;
474 test_float1 = gl_Fog.scale ;
475 color = gl_Fog.color ;
477 gl_FrontColor = vec4(1.0, 1.0, 1.0, 1.0);
478 gl_BackColor = vec4(1.0, 1.0, 1.0, 1.0);
479 gl_FrontSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0);
480 gl_BackSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0);
483 // VARYING VARIABLES AVAILABLE IN FRAGMENT AND VERTEX SHADERS BOTH
484 gl_TexCoord[0] = vec4(1.0, 1.0, 1.0, 1.0);
485 gl_FogFragCoord = 1.0;
489 void test_function(const in int in_int, inout int out_int)
496 int test_function1(in int in_int1, inout int unused1, out int unused2)
503 void test_function3(light3 ll)
509 void test_function4(light5 ll20)
514 void test_function5(light1 struct_light1)
516 struct_light1.light2.a = 1;
518 struct_light1.light2.f = ll5.i;
519 struct_light1.light2.f++;
520 struct_light1.light2.a++;
523 light6 test_function6(int a)
537 float test_function7(light1 ll1, int light1 )