• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 130
2
3uniform int c;
4uniform usampler2D us2D;
5
6in ivec2 x;
7in vec2 v2a;
8in float c1D;
9in vec2  c2D;
10in vec3  c3D;
11smooth vec4  c4D;  // ??
12
13uniform vec4 v4;
14
15void main()
16{
17    float f = 3;
18    switch (c) {     // full switch testing in switch.frag
19    case 1:
20        f = sin(f);
21        break;
22    case 2:
23        f = f * f;
24    default:
25        f = 3.0;
26    }
27
28    uint i;
29    i = texture(us2D, x).w;          // full uint testing in uint.frag
30    i << 3u | 0x8Au >> 1u & 0xFFu;
31
32    vec3 modfOut, modfIn;
33    vec3 v11 = modf(modfIn, modfOut);
34    float t = trunc(f);
35    vec2 v12 = round(v2a);
36    vec2 v13 = roundEven(v2a);
37    bvec2 b10 = isnan(v2a);
38    bvec4 b11 = isinf(v4);
39
40    sinh(c1D) +
41    cosh(c1D) * tanh(c2D);
42    asinh(c4D) + acosh(c4D);
43    atanh(c3D);
44
45    int id = gl_VertexID;
46    gl_ClipDistance[1] = 0.3;
47}
48
49// version 140 features
50
51//uniform isamplerBuffer sbuf;
52
53//layout(std140) uniform blockName {
54//    int anonMem;
55//};
56
57void foo88()
58{
59    int id = gl_InstanceID;    // ERROR
60    //id += anonMem;
61    id += texelFetch(id, 8);
62
63    gl_ClipVertex;         // these are all present...
64    gl_Color;
65    gl_LightSource[0];
66    gl_DepthRange.far;
67    gl_TexCoord;
68    gl_FogFragCoord;
69    gl_FrontColor;
70}
71
72// token pasting
73
74#define mac abc##def
75int mac;
76
77#define macr(A,B) A##B
78int macr(qrs,tuv);
79