From 9996e6a75ef0a1ab2d96c2a13f7e6a17444e1d16 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 2 Nov 2016 17:56:50 +1300 Subject: [PATCH] layers: Use uniform initialization better in PV::layer_data Signed-off-by: Chris Forbes --- layers/parameter_validation.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index 3dd15cc..885e1bc 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -54,31 +54,27 @@ namespace parameter_validation { struct layer_data { - VkInstance instance; + VkInstance instance = VK_NULL_HANDLE; - debug_report_data *report_data; + debug_report_data *report_data = nullptr; std::vector logging_callback; // The following are for keeping track of the temporary callbacks that can // be used in vkCreateInstance and vkDestroyInstance: - uint32_t num_tmp_callbacks; - VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; - VkDebugReportCallbackEXT *tmp_callbacks; + uint32_t num_tmp_callbacks = 0; + VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos = nullptr; + VkDebugReportCallbackEXT *tmp_callbacks = nullptr; // TODO: Split instance/device structs // Device Data // Map for queue family index to queue count std::unordered_map queueFamilyIndexMap; - VkPhysicalDeviceLimits device_limits; - VkPhysicalDeviceFeatures physical_device_features; - VkPhysicalDevice physical_device; + VkPhysicalDeviceLimits device_limits = {}; + VkPhysicalDeviceFeatures physical_device_features = {}; + VkPhysicalDevice physical_device = VK_NULL_HANDLE; - bool swapchain_enabled; - bool display_swapchain_enabled; - - layer_data() - : report_data(nullptr), num_tmp_callbacks(0), tmp_dbg_create_infos(nullptr), tmp_callbacks(nullptr), device_limits{}, - physical_device_features{}, physical_device{}, swapchain_enabled(false), display_swapchain_enabled(false) {}; + bool swapchain_enabled = false; + bool display_swapchain_enabled = false; }; static std::unordered_map instance_extension_map; -- 2.7.4