Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  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 "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);
  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->NumUserUniformStorage = 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_TYPES; sh++) {
  120.       prog->UniformStorage[index_to_set].sampler[sh].index = ~0;
  121.       prog->UniformStorage[index_to_set].sampler[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_TYPES; sh++) {
  141.          prog->UniformStorage[i].sampler[sh].index = ~0;
  142.          prog->UniformStorage[i].sampler[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->NumUserUniformStorage; 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);
  183.  
  184.    verify_initialization(prog, actual_index);
  185.    verify_data(prog->UniformStorage[actual_index].storage, 0, val,
  186.                red_zone_components);
  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.  
  340.    verify_initialization(prog, actual_index);
  341.    verify_data(prog->UniformStorage[actual_index].storage, array_size,
  342.                val, red_zone_components);
  343. }
  344.  
  345. TEST_F(set_uniform_initializer, int_array_uniform)
  346. {
  347.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 1, 4, 0);
  348. }
  349.  
  350. TEST_F(set_uniform_initializer, ivec2_array_uniform)
  351. {
  352.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 2, 4, 0);
  353. }
  354.  
  355. TEST_F(set_uniform_initializer, ivec3_array_uniform)
  356. {
  357.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 3, 4, 0);
  358. }
  359.  
  360. TEST_F(set_uniform_initializer, ivec4_array_uniform)
  361. {
  362.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 4, 4, 0);
  363. }
  364.  
  365. TEST_F(set_uniform_initializer, uint_array_uniform)
  366. {
  367.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 1, 4, 0);
  368. }
  369.  
  370. TEST_F(set_uniform_initializer, uvec2_array_uniform)
  371. {
  372.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 2, 4, 0);
  373. }
  374.  
  375. TEST_F(set_uniform_initializer, uvec3_array_uniform)
  376. {
  377.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 3, 4, 0);
  378. }
  379.  
  380. TEST_F(set_uniform_initializer, uvec4_array_uniform)
  381. {
  382.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 4, 4, 0);
  383. }
  384.  
  385. TEST_F(set_uniform_initializer, bool_array_uniform)
  386. {
  387.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 1, 4, 0);
  388. }
  389.  
  390. TEST_F(set_uniform_initializer, bvec2_array_uniform)
  391. {
  392.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 2, 4, 0);
  393. }
  394.  
  395. TEST_F(set_uniform_initializer, bvec3_array_uniform)
  396. {
  397.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 3, 4, 0);
  398. }
  399.  
  400. TEST_F(set_uniform_initializer, bvec4_array_uniform)
  401. {
  402.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 4, 4, 0);
  403. }
  404.  
  405. TEST_F(set_uniform_initializer, float_array_uniform)
  406. {
  407.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 1, 4, 0);
  408. }
  409.  
  410. TEST_F(set_uniform_initializer, vec2_array_uniform)
  411. {
  412.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 2, 4, 0);
  413. }
  414.  
  415. TEST_F(set_uniform_initializer, vec3_array_uniform)
  416. {
  417.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 3, 4, 0);
  418. }
  419.  
  420. TEST_F(set_uniform_initializer, vec4_array_uniform)
  421. {
  422.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 4, 4, 0);
  423. }
  424.  
  425. TEST_F(set_uniform_initializer, mat2x2_array_uniform)
  426. {
  427.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 2, 4, 0);
  428. }
  429.  
  430. TEST_F(set_uniform_initializer, mat2x3_array_uniform)
  431. {
  432.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 3, 4, 0);
  433. }
  434.  
  435. TEST_F(set_uniform_initializer, mat2x4_array_uniform)
  436. {
  437.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 4, 4, 0);
  438. }
  439.  
  440. TEST_F(set_uniform_initializer, mat3x2_array_uniform)
  441. {
  442.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 2, 4, 0);
  443. }
  444.  
  445. TEST_F(set_uniform_initializer, mat3x3_array_uniform)
  446. {
  447.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 3, 4, 0);
  448. }
  449.  
  450. TEST_F(set_uniform_initializer, mat3x4_array_uniform)
  451. {
  452.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 4, 4, 0);
  453. }
  454.  
  455. TEST_F(set_uniform_initializer, mat4x2_array_uniform)
  456. {
  457.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 2, 4, 0);
  458. }
  459.  
  460. TEST_F(set_uniform_initializer, mat4x3_array_uniform)
  461. {
  462.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 3, 4, 0);
  463. }
  464.  
  465. TEST_F(set_uniform_initializer, mat4x4_array_uniform)
  466. {
  467.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 4, 4, 0);
  468. }
  469.  
  470. TEST_F(set_uniform_initializer, int_array_uniform_excess_initializer)
  471. {
  472.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 1, 4, 5);
  473. }
  474.  
  475. TEST_F(set_uniform_initializer, ivec2_array_uniform_excess_initializer)
  476. {
  477.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 2, 4, 5);
  478. }
  479.  
  480. TEST_F(set_uniform_initializer, ivec3_array_uniform_excess_initializer)
  481. {
  482.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 3, 4, 5);
  483. }
  484.  
  485. TEST_F(set_uniform_initializer, ivec4_array_uniform_excess_initializer)
  486. {
  487.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_INT, 1, 4, 4, 5);
  488. }
  489.  
  490. TEST_F(set_uniform_initializer, uint_array_uniform_excess_initializer)
  491. {
  492.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 1, 4, 5);
  493. }
  494.  
  495. TEST_F(set_uniform_initializer, uvec2_array_uniform_excess_initializer)
  496. {
  497.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 2, 4, 5);
  498. }
  499.  
  500. TEST_F(set_uniform_initializer, uvec3_array_uniform_excess_initializer)
  501. {
  502.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 3, 4, 5);
  503. }
  504.  
  505. TEST_F(set_uniform_initializer, uvec4_array_uniform_excess_initializer)
  506. {
  507.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_UINT, 1, 4, 4, 5);
  508. }
  509.  
  510. TEST_F(set_uniform_initializer, bool_array_uniform_excess_initializer)
  511. {
  512.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 1, 4, 5);
  513. }
  514.  
  515. TEST_F(set_uniform_initializer, bvec2_array_uniform_excess_initializer)
  516. {
  517.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 2, 4, 5);
  518. }
  519.  
  520. TEST_F(set_uniform_initializer, bvec3_array_uniform_excess_initializer)
  521. {
  522.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 3, 4, 5);
  523. }
  524.  
  525. TEST_F(set_uniform_initializer, bvec4_array_uniform_excess_initializer)
  526. {
  527.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_BOOL, 1, 4, 4, 5);
  528. }
  529.  
  530. TEST_F(set_uniform_initializer, float_array_uniform_excess_initializer)
  531. {
  532.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 1, 4, 5);
  533. }
  534.  
  535. TEST_F(set_uniform_initializer, vec2_array_uniform_excess_initializer)
  536. {
  537.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 2, 4, 5);
  538. }
  539.  
  540. TEST_F(set_uniform_initializer, vec3_array_uniform_excess_initializer)
  541. {
  542.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 3, 4, 5);
  543. }
  544.  
  545. TEST_F(set_uniform_initializer, vec4_array_uniform_excess_initializer)
  546. {
  547.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 1, 4, 4, 5);
  548. }
  549.  
  550. TEST_F(set_uniform_initializer, mat2x2_array_uniform_excess_initializer)
  551. {
  552.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 2, 4, 5);
  553. }
  554.  
  555. TEST_F(set_uniform_initializer, mat2x3_array_uniform_excess_initializer)
  556. {
  557.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 3, 4, 5);
  558. }
  559.  
  560. TEST_F(set_uniform_initializer, mat2x4_array_uniform_excess_initializer)
  561. {
  562.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 2, 4, 4, 5);
  563. }
  564.  
  565. TEST_F(set_uniform_initializer, mat3x2_array_uniform_excess_initializer)
  566. {
  567.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 2, 4, 5);
  568. }
  569.  
  570. TEST_F(set_uniform_initializer, mat3x3_array_uniform_excess_initializer)
  571. {
  572.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 3, 4, 5);
  573. }
  574.  
  575. TEST_F(set_uniform_initializer, mat3x4_array_uniform_excess_initializer)
  576. {
  577.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 3, 4, 4, 5);
  578. }
  579.  
  580. TEST_F(set_uniform_initializer, mat4x2_array_uniform_excess_initializer)
  581. {
  582.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 2, 4, 5);
  583. }
  584.  
  585. TEST_F(set_uniform_initializer, mat4x3_array_uniform_excess_initializer)
  586. {
  587.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 3, 4, 5);
  588. }
  589.  
  590. TEST_F(set_uniform_initializer, mat4x4_array_uniform_excess_initializer)
  591. {
  592.    array_test(mem_ctx, prog, actual_index, name, GLSL_TYPE_FLOAT, 4, 4, 4, 5);
  593. }
  594.