anv/tests: Zero-initialize instances
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 30 Oct 2019 16:43:53 +0000 (11:43 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 31 Oct 2019 13:46:09 +0000 (13:46 +0000)
Some of the tests were actually relying on some of those uninitialized
bits to be non-zero.  In particular, a couple want use_softpin = true.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/tests/block_pool_grow_first.c
src/intel/vulkan/tests/block_pool_no_free.c
src/intel/vulkan/tests/state_pool.c
src/intel/vulkan/tests/state_pool_free_list_only.c
src/intel/vulkan/tests/state_pool_no_free.c
src/intel/vulkan/tests/state_pool_padding.c

index 8c221f7300b00cd0260d02f58fdda68bd03265f1..0738f648034d00e43a6fb38802eb6ca451d690d3 100644 (file)
 
 int main(int argc, char **argv)
 {
-   struct anv_instance instance;
+   struct anv_instance instance = {
+      .physicalDevice = {
+         .use_softpin = true,
+      },
+   };
    struct anv_device device = {
       .instance = &instance,
    };
index 49fda232dbd0f4d4cf79cba7f5ca92549cc3fd9a..361336a8e8ee39b392eb26952de5ab2baf45e82b 100644 (file)
@@ -111,7 +111,7 @@ static void validate_monotonic(int32_t **blocks)
 
 static void run_test()
 {
-   struct anv_instance instance;
+   struct anv_instance instance = { };
    struct anv_device device = {
       .instance = &instance,
    };
index d79583e70bbd44d21740f5eda70b97757857379f..0f28afe9f5fc923991db7e4b258ce37c59662d47 100644 (file)
@@ -36,7 +36,7 @@
 
 int main(int argc, char **argv)
 {
-   struct anv_instance instance;
+   struct anv_instance instance = { };
    struct anv_device device = {
       .instance = &instance,
    };
index e34deba2f1aa896745a880912835cddb1dba152f..744ccae350cecbaa7e9eb2a9228096b4611f16ec 100644 (file)
@@ -35,7 +35,7 @@
 
 int main(int argc, char **argv)
 {
-   struct anv_instance instance;
+   struct anv_instance instance = { };
    struct anv_device device = {
       .instance = &instance,
    };
index ae4a3c16bdc1e3104e6a3c0ea849ddeb1bcc90cd..687e52606c1ccae3a9a513b70bef86cfad9f9f70 100644 (file)
@@ -56,7 +56,7 @@ static void *alloc_states(void *_job)
 
 static void run_test()
 {
-   struct anv_instance instance;
+   struct anv_instance instance = { };
    struct anv_device device = {
       .instance = &instance,
    };
index b51300a39ffb7031f0bee5a44e7e80d3b8441fa9..e1cec6086783fc9daaa3ba194f33d12fe937a9b7 100644 (file)
 
 int main(int argc, char **argv)
 {
-   struct anv_instance instance;
+   struct anv_instance instance = {
+      .physicalDevice = {
+         .use_softpin = true,
+      },
+   };
    struct anv_device device = {
       .instance = &instance,
    };