Mesa (staging/19.3): anv/tests: Zero-initialize instances
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Oct 31 22:15:30 UTC 2019
Module: Mesa
Branch: staging/19.3
Commit: bb9d1ed2bd4450cb9177d0ff40d5fcb4634f3bfd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb9d1ed2bd4450cb9177d0ff40d5fcb4634f3bfd
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Wed Oct 30 11:43:53 2019 -0500
anv/tests: Zero-initialize instances
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 at lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
(cherry picked from commit 9076e9f3751341063679eb227116060070549a37)
---
src/intel/vulkan/tests/block_pool_grow_first.c | 6 +++++-
src/intel/vulkan/tests/block_pool_no_free.c | 2 +-
src/intel/vulkan/tests/state_pool.c | 2 +-
src/intel/vulkan/tests/state_pool_free_list_only.c | 2 +-
src/intel/vulkan/tests/state_pool_no_free.c | 2 +-
src/intel/vulkan/tests/state_pool_padding.c | 6 +++++-
6 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/intel/vulkan/tests/block_pool_grow_first.c b/src/intel/vulkan/tests/block_pool_grow_first.c
index aea12b29de8..48989f174ed 100644
--- a/src/intel/vulkan/tests/block_pool_grow_first.c
+++ b/src/intel/vulkan/tests/block_pool_grow_first.c
@@ -27,7 +27,11 @@
int main(int argc, char **argv)
{
- struct anv_instance instance;
+ struct anv_instance instance = {
+ .physicalDevice = {
+ .use_softpin = true,
+ },
+ };
struct anv_device device = {
.instance = &instance,
};
diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c
index f6aa47688af..34b9e8c6a0d 100644
--- a/src/intel/vulkan/tests/block_pool_no_free.c
+++ b/src/intel/vulkan/tests/block_pool_no_free.c
@@ -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,
};
diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c
index 34743c601c3..04ac809bf5d 100644
--- a/src/intel/vulkan/tests/state_pool.c
+++ b/src/intel/vulkan/tests/state_pool.c
@@ -36,7 +36,7 @@
int main(int argc, char **argv)
{
- struct anv_instance instance;
+ struct anv_instance instance = { };
struct anv_device device = {
.instance = &instance,
};
diff --git a/src/intel/vulkan/tests/state_pool_free_list_only.c b/src/intel/vulkan/tests/state_pool_free_list_only.c
index 9f1eb866e4e..d4bdbddef9b 100644
--- a/src/intel/vulkan/tests/state_pool_free_list_only.c
+++ b/src/intel/vulkan/tests/state_pool_free_list_only.c
@@ -35,7 +35,7 @@
int main(int argc, char **argv)
{
- struct anv_instance instance;
+ struct anv_instance instance = { };
struct anv_device device = {
.instance = &instance,
};
diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c
index cb6591266e8..af2c199bf6d 100644
--- a/src/intel/vulkan/tests/state_pool_no_free.c
+++ b/src/intel/vulkan/tests/state_pool_no_free.c
@@ -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,
};
diff --git a/src/intel/vulkan/tests/state_pool_padding.c b/src/intel/vulkan/tests/state_pool_padding.c
index 44509cde07a..c37de4ff6cc 100644
--- a/src/intel/vulkan/tests/state_pool_padding.c
+++ b/src/intel/vulkan/tests/state_pool_padding.c
@@ -27,7 +27,11 @@
int main(int argc, char **argv)
{
- struct anv_instance instance;
+ struct anv_instance instance = {
+ .physicalDevice = {
+ .use_softpin = true,
+ },
+ };
struct anv_device device = {
.instance = &instance,
};
More information about the mesa-commit
mailing list