3 #ifdef GL_EXT_geometry_shader
\r
4 #extension GL_EXT_geometry_shader : enable
\r
6 #error no GL_EXT_geometry_shader
\r
9 #ifndef GL_OES_geometry_shader
\r
10 #error no GL_OES_geometry_shader
\r
13 precision mediump float;
\r
19 in vec4 nonBlockUnsized[];
\r
25 out fromVertex { // okay to reuse a block name for another block name
\r
29 out fooB { // ERROR, cannot reuse block name as block instance
\r
33 int fromVertex; // ERROR, cannot reuse a block name for something else
\r
35 out fooC { // ERROR, cannot have same name for block and instance name
\r
43 EmitStreamVertex(1); // ERROR
\r
44 EndStreamPrimitive(0); // ERROR
\r
46 color = fromV[0].color;
\r
47 gl_ClipDistance[3] = // ERROR, no ClipDistance
\r
48 gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance
\r
49 gl_Position = gl_in[0].gl_Position;
\r
51 gl_PrimitiveID = gl_PrimitiveIDIn;
\r
55 layout(stream = 4) out vec4 ov4; // ERROR, no streams
\r
57 layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip"
\r
59 out ooutb { vec4 a; } ouuaa6;
\r
61 layout(max_vertices = 200) out;
\r
62 layout(max_vertices = 300) out; // ERROR, too big
\r
63 void foo(layout(max_vertices = 4) int a) // ERROR
\r
65 ouuaa6.a = vec4(1.0);
\r
68 layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive
\r
69 layout(line_strip, points) out; // ERROR, changing output primitive
\r
70 layout(triangle_strip) in; // ERROR, not an input primitive
\r
71 layout(triangle_strip) uniform; // ERROR
\r
72 layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
\r
73 layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input
\r
74 layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
\r
76 layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0
\r
77 layout(max_vertices = 3) int b; // ERROR, not on a block member
\r
78 layout(triangle_strip) int c; // ERROR, not on a block member
\r
81 layout(lines) out; // ERROR, not on output
\r
82 layout(lines_adjacency) in;
\r
83 layout(triangles) in; // ERROR, can't change it
\r
84 layout(triangles_adjacency) in; // ERROR, can't change it
\r
85 layout(invocations = 4) in;
\r
99 const int summ = gl_MaxVertexAttribs +
\r
100 gl_MaxGeometryInputComponents +
\r
101 gl_MaxGeometryOutputComponents +
\r
102 gl_MaxGeometryImageUniforms +
\r
103 gl_MaxGeometryTextureImageUnits +
\r
104 gl_MaxGeometryOutputVertices +
\r
105 gl_MaxGeometryTotalOutputComponents +
\r
106 gl_MaxGeometryUniformComponents +
\r
107 gl_MaxGeometryAtomicCounters +
\r
108 gl_MaxGeometryAtomicCounterBuffers +
\r
109 gl_MaxVertexTextureImageUnits +
\r
110 gl_MaxCombinedTextureImageUnits +
\r
111 gl_MaxTextureImageUnits +
\r
116 gl_ViewportIndex; // ERROR, not in ES
\r
117 gl_MaxViewports; // ERROR, not in ES
\r
118 insn.length(); // 4: lines_adjacency
\r
119 int inv = gl_InvocationID;
\r
122 in vec4 explArray[4];
\r
123 in vec4 explArrayBad[5]; // ERROR, wrong size
\r
124 in vec4 nonArrayed; // ERROR, not an array
\r
125 flat out vec3 myColor1;
\r
126 centroid out vec3 myColor2;
\r
127 centroid in vec3 centr[];
\r
128 sample out vec4 perSampleColor; // ERROR without sample extensions
\r
130 layout(max_vertices = 200) out; // matching redecl
\r
132 layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component
\r
136 gl_MaxGeometryVaryingComponents; // ERROR, not in ES
\r
137 gl_VerticesIn; // ERROR, not in ES
\r
142 highp float ps = gl_in[3].gl_PointSize; // ERROR, need point_size extension
\r
143 gl_PointSize = ps; // ERROR, need point_size extension
\r
146 #extension GL_OES_geometry_point_size : enable
\r
150 highp float ps = gl_in[3].gl_PointSize;
\r