glsl: move to compiler/
[mesa.git] / src / compiler / glsl / tests / set_uniform_initializer_tests.cpp
1 /*
2 * Copyright © 2012 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23 #include <gtest/gtest.h>
24 #include "main/compiler.h"
25 #include "main/mtypes.h"
26 #include "main/macros.h"
27 #include "util/ralloc.h"
28 #include "uniform_initializer_utils.h"
29
30 namespace linker {
31 extern void
32 set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
33 const char *name, const glsl_type *type,
34 ir_constant *val, unsigned int boolean_true);
35 }
36
37 class set_uniform_initializer : public ::testing::Test {
38 public:
39 virtual void SetUp();
40 virtual void TearDown();
41
42 /**
43 * Index of the uniform to be tested.
44 *
45 * All of the \c set_uniform_initializer tests create several slots for
46 * unifroms. All but one of the slots is fake. This field holds the index
47 * of the slot for the uniform being tested.
48 */
49 unsigned actual_index;
50
51 /**
52 * Name of the uniform to be tested.
53 */
54 const char *name;
55
56 /**
57 * Shader program used in the test.
58 */
59 struct gl_shader_program *prog;
60
61 /**
62 * Ralloc memory context used for all temporary allocations.
63 */
64 void *mem_ctx;
65 };
66
67 void
68 set_uniform_initializer::SetUp()
69 {
70 this->mem_ctx = ralloc_context(NULL);
71 this->prog = rzalloc(NULL, struct gl_shader_program);
72
73 /* Set default values used by the test cases.
74 */
75 this->actual_index = 1;
76 this->name = "i";
77 }
78
79 void
80 set_uniform_initializer::TearDown()
81 {
82 ralloc_free(this->mem_ctx);
83 this->mem_ctx = NULL;
84
85 ralloc_free(this->prog);
86 this->prog = NULL;
87 }
88
89 /**
90 * Create some uniform storage for a program.
91 *
92 * \param prog Program to get some storage
93 * \param num_storage Total number of storage slots
94 * \param index_to_set Storage slot that will actually get a value
95 * \param name Name for the actual storage slot
96 * \param type Type for the elements of the actual storage slot
97 * \param array_size Size for the array of the actual storage slot. This
98 * should be zero for non-arrays.
99 */
100 static unsigned
101 establish_uniform_storage(struct gl_shader_program *prog, unsigned num_storage,
102 unsigned index_to_set, const char *name,
103 const glsl_type *type, unsigned array_size)
104 {
105 const unsigned elements = MAX2(1, array_size);
106 const unsigned data_components = elements * type->components();
107 const unsigned total_components = MAX2(17, (data_components
108 + type->components()));
109 const unsigned red_zone_components = total_components - data_components;
110
111 prog->UniformStorage = rzalloc_array(prog, struct gl_uniform_storage,
112 num_storage);
113 prog->NumUniformStorage = num_storage;
114
115 prog->UniformStorage[index_to_set].name = (char *) name;
116 prog->UniformStorage[index_to_set].type = type;
117 prog->UniformStorage[index_to_set].array_elements = array_size;
118 prog->UniformStorage[index_to_set].initialized = false;
119 for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) {
120 prog->UniformStorage[index_to_set].opaque[sh].index = ~0;
121 prog->UniformStorage[index_to_set].opaque[sh].active = false;
122 }
123 prog->UniformStorage[index_to_set].num_driver_storage = 0;
124 prog->UniformStorage[index_to_set].driver_storage = NULL;
125 prog->UniformStorage[index_to_set].storage =
126 rzalloc_array(prog, union gl_constant_value, total_components);
127
128 fill_storage_array_with_sentinels(prog->UniformStorage[index_to_set].storage,
129 data_components,
130 red_zone_components);
131
132 for (unsigned i = 0; i < num_storage; i++) {
133 if (i == index_to_set)
134 continue;
135
136 prog->UniformStorage[i].name = (char *) "invalid slot";
137 prog->UniformStorage[i].type = glsl_type::void_type;
138 prog->UniformStorage[i].array_elements = 0;
139 prog->UniformStorage[i].initialized = false;
140 for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) {
141 prog->UniformStorage[i].opaque[sh].index = ~0;
142 prog->UniformStorage[i].opaque[sh].active = false;
143 }
144 prog->UniformStorage[i].num_driver_storage = 0;
145 prog->UniformStorage[i].driver_storage = NULL;
146 prog->UniformStorage[i].storage = NULL;
147 }
148
149 return red_zone_components;
150 }
151
152 /**
153 * Verify that the correct uniform is marked as having been initialized.
154 */
155 static void
156 verify_initialization(struct gl_shader_program *prog, unsigned actual_index)
157 {
158 for (unsigned i = 0; i < prog->NumUniformStorage; i++) {
159 if (i == actual_index) {
160 EXPECT_TRUE(prog->UniformStorage[actual_index].initialized);
161 } else {
162 EXPECT_FALSE(prog->UniformStorage[i].initialized);
163 }
164 }
165 }
166
167 static void
168 non_array_test(void *mem_ctx, struct gl_shader_program *prog,
169 unsigned actual_index, const char *name,
170 enum glsl_base_type base_type,
171 unsigned columns, unsigned rows)
172 {
173 const glsl_type *const type =
174 glsl_type::get_instance(base_type, rows, columns);
175
176 unsigned red_zone_components =
177 establish_uniform_storage(prog, 3, actual_index, name, type, 0);
178
179 ir_constant *val;
180 generate_data(mem_ctx, base_type, columns, rows, val);
181
182 linker::set_uniform_initializer(mem_ctx, prog, name, type, val, 0xF00F);
183
184 verify_initialization(prog, actual_index);
185 verify_data(prog->UniformStorage[actual_index].storage, 0, val,
186 red_zone_components, 0xF00F);
187 }
188
189 TEST_F(set_uniform_initializer, int_uniform)
190 {
191 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 1);
192 }
193
194 TEST_F(set_uniform_initializer, ivec2_uniform)
195 {
196 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 2);
197 }
198
199 TEST_F(set_uniform_initializer, ivec3_uniform)
200 {
201 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 3);
202 }
203
204 TEST_F(set_uniform_initializer, ivec4_uniform)
205 {
206 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 4);
207 }
208
209 TEST_F(set_uniform_initializer, uint_uniform)
210 {
211 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 1);
212 }
213
214 TEST_F(set_uniform_initializer, uvec2_uniform)
215 {
216 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 2);
217 }
218
219 TEST_F(set_uniform_initializer, uvec3_uniform)
220 {
221 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 3);
222 }
223
224 TEST_F(set_uniform_initializer, uvec4_uniform)
225 {
226 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 4);
227 }
228
229 TEST_F(set_uniform_initializer, bool_uniform)
230 {
231 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 1);
232 }
233
234 TEST_F(set_uniform_initializer, bvec2_uniform)
235 {
236 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 2);
237 }
238
239 TEST_F(set_uniform_initializer, bvec3_uniform)
240 {
241 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 3);
242 }
243
244 TEST_F(set_uniform_initializer, bvec4_uniform)
245 {
246 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 4);
247 }
248
249 TEST_F(set_uniform_initializer, float_uniform)
250 {
251 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 2);
252 }
253
254 TEST_F(set_uniform_initializer, vec2_uniform)
255 {
256 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 2);
257 }
258
259 TEST_F(set_uniform_initializer, vec3_uniform)
260 {
261 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 3);
262 }
263
264 TEST_F(set_uniform_initializer, vec4_uniform)
265 {
266 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 4);
267 }
268
269 TEST_F(set_uniform_initializer, mat2x2_uniform)
270 {
271 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 2);
272 }
273
274 TEST_F(set_uniform_initializer, mat2x3_uniform)
275 {
276 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 3);
277 }
278
279 TEST_F(set_uniform_initializer, mat2x4_uniform)
280 {
281 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 4);
282 }
283
284 TEST_F(set_uniform_initializer, mat3x2_uniform)
285 {
286 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 2);
287 }
288
289 TEST_F(set_uniform_initializer, mat3x3_uniform)
290 {
291 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 3);
292 }
293
294 TEST_F(set_uniform_initializer, mat3x4_uniform)
295 {
296 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 4);
297 }
298
299 TEST_F(set_uniform_initializer, mat4x2_uniform)
300 {
301 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 2);
302 }
303
304 TEST_F(set_uniform_initializer, mat4x3_uniform)
305 {
306 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 3);
307 }
308
309 TEST_F(set_uniform_initializer, mat4x4_uniform)
310 {
311 non_array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 4);
312 }
313
314 static void
315 array_test(void *mem_ctx, struct gl_shader_program *prog,
316 unsigned actual_index, const char *name,
317 enum glsl_base_type base_type,
318 unsigned columns, unsigned rows, unsigned array_size,
319 unsigned excess_data_size)
320 {
321 const glsl_type *const element_type =
322 glsl_type::get_instance(base_type, rows, columns);
323
324 const unsigned red_zone_components =
325 establish_uniform_storage(prog, 3, actual_index, name, element_type,
326 array_size);
327
328 /* The constant value generated may have more array elements than the
329 * uniform that it initializes. In the real compiler and linker this can
330 * happen when a uniform array is compacted because some of the tail
331 * elements are not used. In this case, the type of the uniform will be
332 * modified, but the initializer will not.
333 */
334 ir_constant *val;
335 generate_array_data(mem_ctx, base_type, columns, rows,
336 array_size + excess_data_size, val);
337
338 linker::set_uniform_initializer(mem_ctx, prog, name, element_type, val,
339 0xF00F);
340
341 verify_initialization(prog, actual_index);
342 verify_data(prog->UniformStorage[actual_index].storage, array_size,
343 val, red_zone_components, 0xF00F);
344 }
345
346 TEST_F(set_uniform_initializer, int_array_uniform)
347 {
348 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 1, 4, 0);
349 }
350
351 TEST_F(set_uniform_initializer, ivec2_array_uniform)
352 {
353 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 2, 4, 0);
354 }
355
356 TEST_F(set_uniform_initializer, ivec3_array_uniform)
357 {
358 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 3, 4, 0);
359 }
360
361 TEST_F(set_uniform_initializer, ivec4_array_uniform)
362 {
363 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 4, 4, 0);
364 }
365
366 TEST_F(set_uniform_initializer, uint_array_uniform)
367 {
368 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 1, 4, 0);
369 }
370
371 TEST_F(set_uniform_initializer, uvec2_array_uniform)
372 {
373 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 2, 4, 0);
374 }
375
376 TEST_F(set_uniform_initializer, uvec3_array_uniform)
377 {
378 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 3, 4, 0);
379 }
380
381 TEST_F(set_uniform_initializer, uvec4_array_uniform)
382 {
383 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 4, 4, 0);
384 }
385
386 TEST_F(set_uniform_initializer, bool_array_uniform)
387 {
388 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 1, 4, 0);
389 }
390
391 TEST_F(set_uniform_initializer, bvec2_array_uniform)
392 {
393 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 2, 4, 0);
394 }
395
396 TEST_F(set_uniform_initializer, bvec3_array_uniform)
397 {
398 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 3, 4, 0);
399 }
400
401 TEST_F(set_uniform_initializer, bvec4_array_uniform)
402 {
403 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 4, 4, 0);
404 }
405
406 TEST_F(set_uniform_initializer, float_array_uniform)
407 {
408 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 1, 4, 0);
409 }
410
411 TEST_F(set_uniform_initializer, vec2_array_uniform)
412 {
413 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 2, 4, 0);
414 }
415
416 TEST_F(set_uniform_initializer, vec3_array_uniform)
417 {
418 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 3, 4, 0);
419 }
420
421 TEST_F(set_uniform_initializer, vec4_array_uniform)
422 {
423 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 4, 4, 0);
424 }
425
426 TEST_F(set_uniform_initializer, mat2x2_array_uniform)
427 {
428 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 2, 4, 0);
429 }
430
431 TEST_F(set_uniform_initializer, mat2x3_array_uniform)
432 {
433 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 3, 4, 0);
434 }
435
436 TEST_F(set_uniform_initializer, mat2x4_array_uniform)
437 {
438 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 4, 4, 0);
439 }
440
441 TEST_F(set_uniform_initializer, mat3x2_array_uniform)
442 {
443 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 2, 4, 0);
444 }
445
446 TEST_F(set_uniform_initializer, mat3x3_array_uniform)
447 {
448 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 3, 4, 0);
449 }
450
451 TEST_F(set_uniform_initializer, mat3x4_array_uniform)
452 {
453 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 4, 4, 0);
454 }
455
456 TEST_F(set_uniform_initializer, mat4x2_array_uniform)
457 {
458 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 2, 4, 0);
459 }
460
461 TEST_F(set_uniform_initializer, mat4x3_array_uniform)
462 {
463 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 3, 4, 0);
464 }
465
466 TEST_F(set_uniform_initializer, mat4x4_array_uniform)
467 {
468 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 4, 4, 0);
469 }
470
471 TEST_F(set_uniform_initializer, int_array_uniform_excess_initializer)
472 {
473 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 1, 4, 5);
474 }
475
476 TEST_F(set_uniform_initializer, ivec2_array_uniform_excess_initializer)
477 {
478 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 2, 4, 5);
479 }
480
481 TEST_F(set_uniform_initializer, ivec3_array_uniform_excess_initializer)
482 {
483 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 3, 4, 5);
484 }
485
486 TEST_F(set_uniform_initializer, ivec4_array_uniform_excess_initializer)
487 {
488 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 4, 4, 5);
489 }
490
491 TEST_F(set_uniform_initializer, uint_array_uniform_excess_initializer)
492 {
493 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 1, 4, 5);
494 }
495
496 TEST_F(set_uniform_initializer, uvec2_array_uniform_excess_initializer)
497 {
498 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 2, 4, 5);
499 }
500
501 TEST_F(set_uniform_initializer, uvec3_array_uniform_excess_initializer)
502 {
503 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 3, 4, 5);
504 }
505
506 TEST_F(set_uniform_initializer, uvec4_array_uniform_excess_initializer)
507 {
508 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 4, 4, 5);
509 }
510
511 TEST_F(set_uniform_initializer, bool_array_uniform_excess_initializer)
512 {
513 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 1, 4, 5);
514 }
515
516 TEST_F(set_uniform_initializer, bvec2_array_uniform_excess_initializer)
517 {
518 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 2, 4, 5);
519 }
520
521 TEST_F(set_uniform_initializer, bvec3_array_uniform_excess_initializer)
522 {
523 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 3, 4, 5);
524 }
525
526 TEST_F(set_uniform_initializer, bvec4_array_uniform_excess_initializer)
527 {
528 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 4, 4, 5);
529 }
530
531 TEST_F(set_uniform_initializer, float_array_uniform_excess_initializer)
532 {
533 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 1, 4, 5);
534 }
535
536 TEST_F(set_uniform_initializer, vec2_array_uniform_excess_initializer)
537 {
538 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 2, 4, 5);
539 }
540
541 TEST_F(set_uniform_initializer, vec3_array_uniform_excess_initializer)
542 {
543 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 3, 4, 5);
544 }
545
546 TEST_F(set_uniform_initializer, vec4_array_uniform_excess_initializer)
547 {
548 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 4, 4, 5);
549 }
550
551 TEST_F(set_uniform_initializer, mat2x2_array_uniform_excess_initializer)
552 {
553 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 2, 4, 5);
554 }
555
556 TEST_F(set_uniform_initializer, mat2x3_array_uniform_excess_initializer)
557 {
558 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 3, 4, 5);
559 }
560
561 TEST_F(set_uniform_initializer, mat2x4_array_uniform_excess_initializer)
562 {
563 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 4, 4, 5);
564 }
565
566 TEST_F(set_uniform_initializer, mat3x2_array_uniform_excess_initializer)
567 {
568 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 2, 4, 5);
569 }
570
571 TEST_F(set_uniform_initializer, mat3x3_array_uniform_excess_initializer)
572 {
573 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 3, 4, 5);
574 }
575
576 TEST_F(set_uniform_initializer, mat3x4_array_uniform_excess_initializer)
577 {
578 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 4, 4, 5);
579 }
580
581 TEST_F(set_uniform_initializer, mat4x2_array_uniform_excess_initializer)
582 {
583 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 2, 4, 5);
584 }
585
586 TEST_F(set_uniform_initializer, mat4x3_array_uniform_excess_initializer)
587 {
588 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 3, 4, 5);
589 }
590
591 TEST_F(set_uniform_initializer, mat4x4_array_uniform_excess_initializer)
592 {
593 array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 4, 4, 5);
594 }