1#version 310 es 2 3#extension GL_OES_tessellation_shader : enable 4 5layout(vertices = 4) out; 6out int outa[gl_out.length()]; 7 8layout(quads) in; // ERROR 9layout(ccw) out; // ERROR 10layout(fractional_even_spacing) in; // ERROR 11 12patch in vec4 patchIn; // ERROR 13patch out vec4 patchOut; 14 15void main() 16{ 17 barrier(); 18 19 int a = gl_MaxTessControlInputComponents + 20 gl_MaxTessControlOutputComponents + 21 gl_MaxTessControlTextureImageUnits + 22 gl_MaxTessControlUniformComponents + 23 gl_MaxTessControlTotalOutputComponents; 24 25 vec4 p = gl_in[1].gl_Position; 26 float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension 27 float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES 28 29 int pvi = gl_PatchVerticesIn; 30 int pid = gl_PrimitiveID; 31 int iid = gl_InvocationID; 32 33 gl_out[gl_InvocationID].gl_Position = p; 34 gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension 35 gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES 36 37 gl_TessLevelOuter[3] = 3.2; 38 gl_TessLevelInner[1] = 1.3; 39 40 if (a > 10) 41 barrier(); // ERROR 42 else 43 barrier(); // ERROR 44 45 barrier(); 46 47 do { 48 barrier(); // ERROR 49 } while (a > 10); 50 51 switch (a) { 52 default: 53 barrier(); // ERROR 54 break; 55 } 56 a < 12 ? a : (barrier(), a); // ERROR 57 { 58 barrier(); 59 } 60 61 return; 62 63 barrier(); // ERROR 64} 65 66layout(vertices = 4) in; // ERROR, not on in 67layout(vertices = 5) out; // ERROR, changing # 68 69void foo() 70{ 71 gl_out[4].gl_Position; // ERROR, out of range 72 73 barrier(); // ERROR, not in main 74} 75 76in vec2 ina; // ERROR, not array 77in vec2 inb[]; 78in vec2 inc[18]; // ERROR, wrong size 79in vec2 ind[gl_MaxPatchVertices]; 80patch out float implA[]; // ERROR, not sized 81 82#extension GL_ARB_separate_shader_objects : enable 83 84layout(location = 3) in vec4 ivla[]; 85layout(location = 4) in vec4 ivlb[]; 86layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping 87 88layout(location = 3) out vec4 ovla[]; 89layout(location = 4) out vec4 ovlb[]; 90layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping 91 92void foop() 93{ 94 precise float d; // ERROR without gpu_shader5 95 d = fma(d, d, d); // ERROR without gpu_shader5 96} 97 98patch out pinbn { 99 int a; 100} pinbi; 101 102centroid out vec3 myColor2[]; 103centroid in vec3 centr[]; 104sample out vec4 perSampleColor[]; // ERROR without sample extensions 105 106layout(vertices = 4) out float badlay[]; // ERROR, not on a variable 107out float misSized[5]; // ERROR, size doesn't match 108out float okaySize[4]; 109 110#extension GL_OES_tessellation_point_size : enable 111 112void pointSize2() 113{ 114 float ps = gl_in[1].gl_PointSize; 115 gl_out[gl_InvocationID].gl_PointSize = ps; 116} 117 118#extension GL_OES_gpu_shader5 : enable 119 120precise vec3 pv3; 121 122void goodfoop() 123{ 124 precise float d; 125 126 pv3 *= pv3; 127 pv3 = fma(pv3, pv3, pv3); 128 d = fma(d, d, d); 129} 130 131void bbextBad() 132{ 133 gl_BoundingBoxEXT; // ERROR without GL_EXT_primitive_bounding_box 134 gl_BoundingBox; // ERROR, version < 320 135} 136 137#extension GL_EXT_primitive_bounding_box : enable 138 139void bbext() 140{ 141 gl_BoundingBoxEXT[0] = vec4(0.0); 142 gl_BoundingBoxEXT[1] = vec4(1.0); 143 gl_BoundingBoxEXT[2] = vec4(2.0); // ERROR, overflow 144} 145 146void bbBad() 147{ 148 gl_BoundingBoxOES; // ERROR without GL_OES_primitive_bounding_box 149} 150 151#extension GL_OES_primitive_bounding_box : enable 152 153void bb() 154{ 155 gl_BoundingBoxOES[0] = vec4(0.0); 156 gl_BoundingBoxOES[1] = vec4(1.0); 157 gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow 158} 159 160out patch badpatchBName { // ERROR, array size required 161 float f; 162} badpatchIName[]; 163 164out patch patchBName { 165 float f; 166} patchIName[4]; 167 168void outputtingOutparam(out int a) 169{ 170 a = 2; 171} 172 173void outputting() 174{ 175 outa[gl_InvocationID] = 2; 176 outa[1] = 2; // ERROR, not gl_InvocationID 177 gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID 178 outa[1]; 179 gl_out[0]; 180 outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID 181 outputtingOutparam(outa[gl_InvocationID]); 182 patchIName[1].f = 3.14; 183 outa[(gl_InvocationID)] = 2; 184} 185