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