John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 1 | #version 400 core
|
| 2 |
|
John Kessenich | 623833f | 2013-12-11 18:57:40 +0000 | [diff] [blame] | 3 | layout(vertices = 4) out;
|
| 4 | int outa[gl_out.length()];
|
| 5 |
|
| 6 | layout(quads) in; // ERROR
|
| 7 | layout(ccw) out; // ERROR
|
| 8 | layout(fractional_even_spacing) in; // ERROR
|
| 9 |
|
John Kessenich | 116c30b | 2013-12-12 01:25:37 +0000 | [diff] [blame] | 10 | patch in vec4 patchIn; // ERROR
|
| 11 | patch out vec4 patchOut;
|
John Kessenich | 623833f | 2013-12-11 18:57:40 +0000 | [diff] [blame] | 12 |
|
John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 13 | void main()
|
| 14 | {
|
| 15 | barrier();
|
John Kessenich | 623833f | 2013-12-11 18:57:40 +0000 | [diff] [blame] | 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;
|
| 25 | float cd = gl_in[1].gl_ClipDistance[2];
|
| 26 |
|
| 27 | int pvi = gl_PatchVerticesIn;
|
| 28 | int pid = gl_PrimitiveID;
|
| 29 | int iid = gl_InvocationID;
|
| 30 |
|
John Kessenich | 1be8063 | 2015-11-28 15:19:11 -0700 | [diff] [blame] | 31 | gl_out[gl_InvocationID].gl_Position = p;
|
| 32 | gl_out[gl_InvocationID].gl_PointSize = ps;
|
| 33 | gl_out[gl_InvocationID].gl_ClipDistance[1] = cd;
|
John Kessenich | 623833f | 2013-12-11 18:57:40 +0000 | [diff] [blame] | 34 |
|
| 35 | gl_TessLevelOuter[3] = 3.2;
|
| 36 | gl_TessLevelInner[1] = 1.3;
|
John Kessenich | 05a62bf | 2015-01-07 06:14:06 +0000 | [diff] [blame] | 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 | }
|
John Kessenich | 548ec2c | 2015-01-07 06:36:55 +0000 | [diff] [blame] | 54 | a < 12 ? a : (barrier(), a); // ERROR
|
John Kessenich | 05a62bf | 2015-01-07 06:14:06 +0000 | [diff] [blame] | 55 | {
|
| 56 | barrier();
|
| 57 | }
|
| 58 |
|
| 59 | return;
|
| 60 |
|
| 61 | barrier(); // ERROR
|
John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 62 | }
|
John Kessenich | f3e2a89 | 2013-12-13 18:38:43 +0000 | [diff] [blame] | 63 |
|
| 64 | layout(vertices = 4) in; // ERROR
|
| 65 | layout(vertices = 5) out; // ERROR
|
| 66 |
|
| 67 | void foo()
|
| 68 | {
|
| 69 | gl_out[4].gl_PointSize; // ERROR
|
John Kessenich | 05a62bf | 2015-01-07 06:14:06 +0000 | [diff] [blame] | 70 |
|
| 71 | barrier(); // ERROR
|
John Kessenich | 08d1824 | 2013-12-20 18:36:27 +0000 | [diff] [blame] | 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];
|
John Kessenich | c7776ec | 2014-01-26 01:37:13 +0000 | [diff] [blame] | 78 |
|
| 79 | #extension GL_ARB_separate_shader_objects : enable
|
John Kessenich | 08d1824 | 2013-12-20 18:36:27 +0000 | [diff] [blame] | 80 |
|
| 81 | layout(location = 3) in vec4 ivla[];
|
| 82 | layout(location = 4) in vec4 ivlb[];
|
John Kessenich | 6e76bdc | 2015-06-19 23:03:32 +0000 | [diff] [blame] | 83 | layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping
|
John Kessenich | 08d1824 | 2013-12-20 18:36:27 +0000 | [diff] [blame] | 84 |
|
| 85 | layout(location = 3) out vec4 ovla[];
|
| 86 | layout(location = 4) out vec4 ovlb[];
|
John Kessenich | 6e76bdc | 2015-06-19 23:03:32 +0000 | [diff] [blame] | 87 | layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping
|
John Kessenich | 58f5a5e | 2014-08-14 20:05:57 +0000 | [diff] [blame] | 88 |
|
| 89 | precise vec3 pv3;
|
| 90 |
|
| 91 | void foop()
|
| 92 | {
|
| 93 | precise double d;
|
| 94 |
|
| 95 | pv3 *= pv3;
|
| 96 | pv3 = fma(pv3, pv3, pv3);
|
| 97 | d = fma(d, d, d);
|
| 98 | }
|
John Kessenich | 7169338 | 2014-10-08 21:57:17 +0000 | [diff] [blame] | 99 |
|
| 100 | patch out pinbn {
|
| 101 | int a;
|
| 102 | } pinbi;
|
John Kessenich | 17f0786 | 2016-05-04 12:36:14 -0600 | [diff] [blame] | 103 |
|
| 104 | invariant precise out vec4 badOrder[]; // ERROR, precise must appear first
|
| 105 | void badp(out precise float f); // ERROR, precise must appear first
|
John Kessenich | c08fb8a | 2017-03-14 16:45:30 -0600 | [diff] [blame] | 106 | |
| 107 | void devi() |
| 108 | { |
| 109 | gl_DeviceIndex; // ERROR, no extension |
| 110 | gl_ViewIndex; // ERROR, no extension |
| 111 | } |
| 112 | |
| 113 | #ifdef GL_EXT_device_group |
| 114 | #extension GL_EXT_device_group : enable |
| 115 | #endif |
| 116 | |
| 117 | #ifdef GL_EXT_device_group |
| 118 | #extension GL_EXT_multiview : enable |
| 119 | #endif |
| 120 | |
| 121 | void devie() |
| 122 | { |
| 123 | gl_DeviceIndex; |
| 124 | gl_ViewIndex; |
| 125 | } |