John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 1 | #version 440 core
|
| 2 |
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 3 | layout(std140, row_major) uniform nameless {
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 4 | vec3 anonMember1;
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 5 | mat3x2 m23;
|
| 6 | int scalarAfterm23;
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 7 | vec4 anonDeadMember2;
|
| 8 | vec4 anonMember3;
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 9 | int scalarBeforeArray;
|
| 10 | float floatArray[5];
|
| 11 | int scalarAfterArray;
|
John Kessenich | 12f9221 | 2013-11-15 01:34:27 +0000 | [diff] [blame] | 12 | mat2x2 m22[9];
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 13 | };
|
| 14 |
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 15 | layout(std140, column_major) uniform c_nameless {
|
| 16 | vec3 c_anonMember1;
|
| 17 | mat3x2 c_m23;
|
| 18 | int c_scalarAfterm23;
|
| 19 | vec4 c_anonDeadMember2;
|
| 20 | vec4 c_anonMember3;
|
| 21 | };
|
| 22 |
|
| 23 | layout(std140) uniform named {
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 24 | vec3 deadMember1;
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 25 | int scalar;
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 26 | vec4 member2;
|
| 27 | vec4 member3;
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 28 | vec2 memvec2;
|
| 29 | float memf1;
|
| 30 | bool memf2;
|
| 31 | int memf3;
|
| 32 | vec2 memvec2a;
|
John Kessenich | 12f9221 | 2013-11-15 01:34:27 +0000 | [diff] [blame] | 33 | mat2x2 m22[7];
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 34 | } ablock;
|
| 35 |
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 36 | layout(std140) uniform namelessdead {
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 37 | int a;
|
| 38 | };
|
| 39 |
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 40 | layout(std140) uniform namedDead {
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 41 | int b;
|
| 42 | } bblock;
|
| 43 |
|
John Kessenich | 12f9221 | 2013-11-15 01:34:27 +0000 | [diff] [blame] | 44 | struct N1 {
|
| 45 | float a;
|
| 46 | };
|
| 47 |
|
| 48 | struct N2 {
|
| 49 | float b;
|
| 50 | float c;
|
| 51 | float d;
|
| 52 | };
|
| 53 |
|
| 54 | struct N3 {
|
| 55 | N1 n1;
|
| 56 | N2 n2;
|
| 57 | };
|
| 58 |
|
| 59 | layout(std140) uniform nested {
|
| 60 | N3 foo;
|
| 61 | } nest;
|
| 62 |
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 63 | struct TS {
|
| 64 | int a;
|
| 65 | int dead;
|
| 66 | };
|
| 67 |
|
| 68 | uniform TS s;
|
| 69 |
|
| 70 | uniform float uf1;
|
| 71 | uniform float uf2;
|
| 72 | uniform float ufDead3;
|
| 73 | uniform float ufDead4;
|
| 74 |
|
John Kessenich | ec252df | 2013-11-13 19:07:43 +0000 | [diff] [blame] | 75 | uniform uimage2D image_ui2D;
|
| 76 | uniform sampler2D sampler_2D;
|
| 77 | uniform sampler2DMSArray sampler_2DMSArray;
|
| 78 |
|
John Kessenich | 12f9221 | 2013-11-15 01:34:27 +0000 | [diff] [blame] | 79 | uniform mat2 dm22[10];
|
| 80 |
|
John Kessenich | 43e43ce | 2013-11-15 20:41:31 +0000 | [diff] [blame] | 81 | struct deep1 {
|
| 82 | vec2 va[3];
|
| 83 | bool b;
|
| 84 | };
|
| 85 |
|
| 86 | struct deep2 {
|
| 87 | int i;
|
| 88 | deep1 d1[4];
|
| 89 | };
|
| 90 |
|
| 91 | struct deep3 {
|
| 92 | vec4 iv4;
|
| 93 | deep2 d2;
|
| 94 | ivec3 v3;
|
| 95 | };
|
| 96 |
|
| 97 | uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2];
|
| 98 |
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 99 | const bool control = true;
|
| 100 |
|
| 101 | void deadFunction()
|
| 102 | {
|
| 103 | vec3 v3 = ablock.deadMember1;
|
| 104 | vec4 v = anonDeadMember2;
|
| 105 | float f = ufDead4;
|
| 106 | }
|
| 107 |
|
| 108 | void liveFunction2()
|
| 109 | {
|
| 110 | vec3 v = anonMember1;
|
| 111 | float f = uf1;
|
| 112 | }
|
| 113 |
|
John Kessenich | ec252df | 2013-11-13 19:07:43 +0000 | [diff] [blame] | 114 | void liveFunction1(uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray)
|
| 115 |
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 116 | {
|
| 117 | liveFunction2();
|
| 118 | float f = uf2;
|
| 119 | vec4 v = ablock.member3;
|
| 120 | }
|
| 121 |
|
John Kessenich | 04884e4 | 2013-11-21 00:54:57 +0000 | [diff] [blame] | 122 | uniform abl {
|
| 123 | float foo;
|
| 124 | } arrBl[4];
|
| 125 |
|
John Kessenich | 5b9f988 | 2013-11-23 00:44:18 +0000 | [diff] [blame] | 126 | uniform abl2 {
|
| 127 | float foo;
|
| 128 | } arrBl2[4];
|
| 129 |
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 130 | void main()
|
| 131 | {
|
John Kessenich | ec252df | 2013-11-13 19:07:43 +0000 | [diff] [blame] | 132 | liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray);
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 133 | liveFunction2();
|
| 134 |
|
| 135 | if (! control)
|
| 136 | deadFunction();
|
| 137 |
|
| 138 | float f;
|
John Kessenich | 12f9221 | 2013-11-15 01:34:27 +0000 | [diff] [blame] | 139 | int i;
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 140 | if (control) {
|
| 141 | liveFunction2();
|
| 142 | f = anonMember3.z;
|
| 143 | f = s.a;
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 144 | f = ablock.scalar;
|
| 145 | f = m23[1].y + scalarAfterm23;
|
| 146 | f = c_m23[1].y + c_scalarAfterm23;
|
| 147 | f += scalarBeforeArray;
|
| 148 | f += floatArray[2];
|
John Kessenich | 43e43ce | 2013-11-15 20:41:31 +0000 | [diff] [blame] | 149 | f += floatArray[4];
|
John Kessenich | 568bc3a | 2013-11-13 05:40:44 +0000 | [diff] [blame] | 150 | f += scalarAfterArray;
|
| 151 | f += ablock.memvec2.x;
|
| 152 | f += ablock.memf1;
|
| 153 | f += float(ablock.memf2);
|
| 154 | f += ablock.memf3;
|
| 155 | f += ablock.memvec2a.y;
|
John Kessenich | 12f9221 | 2013-11-15 01:34:27 +0000 | [diff] [blame] | 156 | f += ablock.m22[i][1][0];
|
| 157 | f += dm22[3][0][1];
|
| 158 | f += m22[2][1].y;
|
| 159 | f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d;
|
John Kessenich | 43e43ce | 2013-11-15 20:41:31 +0000 | [diff] [blame] | 160 | f += deepA[i].d2.d1[2].va[1].x;
|
| 161 | f += deepB[1].d2.d1[i].va[1].x;
|
| 162 | f += deepB[i].d2.d1[i].va[1].x;
|
| 163 | deep3 d = deepC[1];
|
| 164 | deep3 da[2] = deepD;
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 165 | } else
|
| 166 | f = ufDead3;
|
John Kessenich | 04884e4 | 2013-11-21 00:54:57 +0000 | [diff] [blame] | 167 |
|
John Kessenich | 5b9f988 | 2013-11-23 00:44:18 +0000 | [diff] [blame] | 168 | f += arrBl[2].foo + arrBl[0].foo;
|
| 169 | f += arrBl2[i].foo;
|
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 170 | }
|