3 GL_ARB_uniform_buffer_object
6 #extension GL_ARB_uniform_buffer_object : require
21 layout(std140) uniform Example {
22 // Base types below consume 4 basic machine units
25 // rule align off. off. bytes used
26 // ---- ------ ---- ---- -----------------------
27 float a; // 1 4 0 0 0..3
28 vec2 b; // 2 8 4 8 8..15
29 vec3 c; // 3 16 16 16 16..27
30 f_struct // 9 16 28 32 (align begin)
31 // int d; // 1 4 32 32 32..35
32 // bvec2 e; // 2 8 36 40 40..47
33 f; // 9 16 48 48 (pad end)
34 float g; // 1 4 48 48 48..51
35 float h[2]; // 4 16 52 64 64..67 (h[0])
37 // 4 16 84 96 (pad end of h)
38 mat2x3 i; // 5/4 16 96 96 96..107 (i, column 0)
39 // 112 112..123 (i, column 1)
40 // 5/4 16 124 128 (pad end of i)
41 o_struct // 10 16 128 128 (align begin)
42 // uvec3 j; // 3 16 128 128 128..139 (o[0].j)
43 // vec2 k; // 2 8 140 144 144..151 (o[0].k)
44 // float l[2]; // 4 16 152 160 160..163 (o[0].l[0])
45 // 176 176..179 (o[0].l[1])
46 // 4 16 180 192 (pad end of o[0].l)
47 // vec2 m; // 2 8 192 192 192..199 (o[0].m)
48 // mat3 n[2]; // 6/4 16 200 208 208..219 (o[0].n[0], column 0)
49 // 224 224..235 (o[0].n[0], column 1)
50 // 240 240..251 (o[0].n[0], column 2)
51 // 256 256..267 (o[0].n[1], column 0)
52 // 272 272..283 (o[0].n[1], column 1)
53 // 288 288..299 (o[0].n[1], column 2)
54 // 6/4 16 300 304 (pad end of o[0].n)
55 // 9 16 304 304 (pad end of o[0])
56 // 3 16 304 304 304..315 (o[1].j)
57 // 2 8 316 320 320..327 (o[1].k)
58 // 4 16 328 336 336..347 (o[1].l[0])
59 // 352 352..355 (o[1].l[1])
60 // 4 16 356 368 (pad end of o[1].l)
61 // 2 8 368 368 368..375 (o[1].m)
62 // 6/4 16 376 384 384..395 (o[1].n[0], column 0)
63 // 400 400..411 (o[1].n[0], column 1)
64 // 416 416..427 (o[1].n[0], column 2)
65 // 432 432..443 (o[1].n[1], column 0)
66 // 448 448..459 (o[1].n[1], column 1)
67 // 464 464..475 (o[1].n[1], column 2)
68 // 6/4 16 476 480 (pad end of o[1].n)
69 // 9 16 480 480 (pad end of o[1])
75 /* std140 (or shared) layout prevents any fields or blocks from being
76 * eliminted. Section 2.11.6 of the OpenGL ES 3.0 spec makes this
77 * explicit, but desktop GL specs only say it implicitly. Either way,
78 * there is no need to reference any field of the std140 block.
80 gl_Position = vec4(0);
84 out vec4 piglit_fragcolor;
88 piglit_fragcolor = vec4(0);
94 active uniform a GL_UNIFORM_TYPE GL_FLOAT
95 active uniform a GL_UNIFORM_SIZE 1
96 active uniform a GL_UNIFORM_OFFSET 0
97 active uniform a GL_UNIFORM_ARRAY_STRIDE 0
98 active uniform a GL_UNIFORM_MATRIX_STRIDE 0
99 active uniform a GL_UNIFORM_IS_ROW_MAJOR 0
101 active uniform b GL_UNIFORM_TYPE GL_FLOAT_VEC2
102 active uniform b GL_UNIFORM_SIZE 1
103 active uniform b GL_UNIFORM_OFFSET 8
104 active uniform b GL_UNIFORM_ARRAY_STRIDE 0
105 active uniform b GL_UNIFORM_MATRIX_STRIDE 0
106 active uniform b GL_UNIFORM_IS_ROW_MAJOR 0
108 active uniform c GL_UNIFORM_TYPE GL_FLOAT_VEC3
109 active uniform c GL_UNIFORM_SIZE 1
110 active uniform c GL_UNIFORM_OFFSET 16
111 active uniform c GL_UNIFORM_ARRAY_STRIDE 0
112 active uniform c GL_UNIFORM_MATRIX_STRIDE 0
113 active uniform c GL_UNIFORM_IS_ROW_MAJOR 0
115 active uniform f.d GL_UNIFORM_TYPE GL_INT
116 active uniform f.d GL_UNIFORM_SIZE 1
117 active uniform f.d GL_UNIFORM_OFFSET 32
118 active uniform f.d GL_UNIFORM_ARRAY_STRIDE 0
119 active uniform f.d GL_UNIFORM_MATRIX_STRIDE 0
120 active uniform f.d GL_UNIFORM_IS_ROW_MAJOR 0
122 active uniform f.e GL_UNIFORM_TYPE GL_BOOL_VEC2
123 active uniform f.e GL_UNIFORM_SIZE 1
124 active uniform f.e GL_UNIFORM_OFFSET 40
125 active uniform f.e GL_UNIFORM_ARRAY_STRIDE 0
126 active uniform f.e GL_UNIFORM_MATRIX_STRIDE 0
127 active uniform f.e GL_UNIFORM_IS_ROW_MAJOR 0
129 active uniform g GL_UNIFORM_TYPE GL_FLOAT
130 active uniform g GL_UNIFORM_SIZE 1
131 active uniform g GL_UNIFORM_OFFSET 48
132 active uniform g GL_UNIFORM_ARRAY_STRIDE 0
133 active uniform g GL_UNIFORM_MATRIX_STRIDE 0
134 active uniform g GL_UNIFORM_IS_ROW_MAJOR 0
136 active uniform h[0] GL_UNIFORM_TYPE GL_FLOAT
137 active uniform h[0] GL_UNIFORM_SIZE 2
138 active uniform h[0] GL_UNIFORM_OFFSET 64
139 active uniform h[0] GL_UNIFORM_ARRAY_STRIDE 16
140 active uniform h[0] GL_UNIFORM_MATRIX_STRIDE 0
141 active uniform h[0] GL_UNIFORM_IS_ROW_MAJOR 0
143 active uniform i GL_UNIFORM_TYPE GL_FLOAT_MAT2x3
144 active uniform i GL_UNIFORM_SIZE 1
145 active uniform i GL_UNIFORM_OFFSET 96
146 active uniform i GL_UNIFORM_ARRAY_STRIDE 0
147 active uniform i GL_UNIFORM_MATRIX_STRIDE 16
148 active uniform i GL_UNIFORM_IS_ROW_MAJOR 0
150 active uniform o[0].j GL_UNIFORM_TYPE GL_UNSIGNED_INT_VEC3
151 active uniform o[0].j GL_UNIFORM_SIZE 1
152 active uniform o[0].j GL_UNIFORM_OFFSET 128
153 active uniform o[0].j GL_UNIFORM_ARRAY_STRIDE 0
154 active uniform o[0].j GL_UNIFORM_MATRIX_STRIDE 0
155 active uniform o[0].j GL_UNIFORM_IS_ROW_MAJOR 0
157 active uniform o[0].k GL_UNIFORM_TYPE GL_FLOAT_VEC2
158 active uniform o[0].k GL_UNIFORM_SIZE 1
159 active uniform o[0].k GL_UNIFORM_OFFSET 144
160 active uniform o[0].k GL_UNIFORM_ARRAY_STRIDE 0
161 active uniform o[0].k GL_UNIFORM_MATRIX_STRIDE 0
162 active uniform o[0].k GL_UNIFORM_IS_ROW_MAJOR 0
164 active uniform o[0].l[0] GL_UNIFORM_TYPE GL_FLOAT
165 active uniform o[0].l[0] GL_UNIFORM_SIZE 2
166 active uniform o[0].l[0] GL_UNIFORM_OFFSET 160
167 active uniform o[0].l[0] GL_UNIFORM_ARRAY_STRIDE 16
168 active uniform o[0].l[0] GL_UNIFORM_MATRIX_STRIDE 0
169 active uniform o[0].l[0] GL_UNIFORM_IS_ROW_MAJOR 0
171 active uniform o[0].m GL_UNIFORM_TYPE GL_FLOAT_VEC2
172 active uniform o[0].m GL_UNIFORM_SIZE 1
173 active uniform o[0].m GL_UNIFORM_OFFSET 192
174 active uniform o[0].m GL_UNIFORM_ARRAY_STRIDE 0
175 active uniform o[0].m GL_UNIFORM_MATRIX_STRIDE 0
176 active uniform o[0].m GL_UNIFORM_IS_ROW_MAJOR 0
178 active uniform o[0].n[0] GL_UNIFORM_TYPE GL_FLOAT_MAT3
179 active uniform o[0].n[0] GL_UNIFORM_SIZE 2
180 active uniform o[0].n[0] GL_UNIFORM_OFFSET 208
181 active uniform o[0].n[0] GL_UNIFORM_ARRAY_STRIDE 48
182 active uniform o[0].n[0] GL_UNIFORM_MATRIX_STRIDE 16
183 active uniform o[0].n[0] GL_UNIFORM_IS_ROW_MAJOR 0
185 active uniform o[1].j GL_UNIFORM_TYPE GL_UNSIGNED_INT_VEC3
186 active uniform o[1].j GL_UNIFORM_SIZE 1
187 active uniform o[1].j GL_UNIFORM_OFFSET 304
188 active uniform o[1].j GL_UNIFORM_ARRAY_STRIDE 0
189 active uniform o[1].j GL_UNIFORM_MATRIX_STRIDE 0
190 active uniform o[1].j GL_UNIFORM_IS_ROW_MAJOR 0
192 active uniform o[1].k GL_UNIFORM_TYPE GL_FLOAT_VEC2
193 active uniform o[1].k GL_UNIFORM_SIZE 1
194 active uniform o[1].k GL_UNIFORM_OFFSET 320
195 active uniform o[1].k GL_UNIFORM_ARRAY_STRIDE 0
196 active uniform o[1].k GL_UNIFORM_MATRIX_STRIDE 0
197 active uniform o[1].k GL_UNIFORM_IS_ROW_MAJOR 0
199 active uniform o[1].l[0] GL_UNIFORM_TYPE GL_FLOAT
200 active uniform o[1].l[0] GL_UNIFORM_SIZE 2
201 active uniform o[1].l[0] GL_UNIFORM_OFFSET 336
202 active uniform o[1].l[0] GL_UNIFORM_ARRAY_STRIDE 16
203 active uniform o[1].l[0] GL_UNIFORM_MATRIX_STRIDE 0
204 active uniform o[1].l[0] GL_UNIFORM_IS_ROW_MAJOR 0
206 active uniform o[1].m GL_UNIFORM_TYPE GL_FLOAT_VEC2
207 active uniform o[1].m GL_UNIFORM_SIZE 1
208 active uniform o[1].m GL_UNIFORM_OFFSET 368
209 active uniform o[1].m GL_UNIFORM_ARRAY_STRIDE 0
210 active uniform o[1].m GL_UNIFORM_MATRIX_STRIDE 0
211 active uniform o[1].m GL_UNIFORM_IS_ROW_MAJOR 0
213 active uniform o[1].n[0] GL_UNIFORM_TYPE GL_FLOAT_MAT3
214 active uniform o[1].n[0] GL_UNIFORM_SIZE 2
215 active uniform o[1].n[0] GL_UNIFORM_OFFSET 384
216 active uniform o[1].n[0] GL_UNIFORM_ARRAY_STRIDE 48
217 active uniform o[1].n[0] GL_UNIFORM_MATRIX_STRIDE 16
218 active uniform o[1].n[0] GL_UNIFORM_IS_ROW_MAJOR 0