aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-10-03 17:18:42 +1300
committerChris Forbes <chrisforbes@google.com>2016-10-04 08:37:27 +1300
commitdf3ad1c02ac787e523e7b8a1da2f40e3f8a31bfa (patch)
tree09e36c9072a5f7c7a67535d53a5eb38d9dd546d5 /layers/core_validation.cpp
parente222d2f9f3738ee61cac022b8ca1b086555ecf0c (diff)
downloadusermoji-df3ad1c02ac787e523e7b8a1da2f40e3f8a31bfa.tar.xz
layers: Use member initialization for CV state
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 755e2cd1..0d335333 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -98,16 +98,16 @@ struct shader_module;
// TODO : Split this into separate structs for instance and device level data?
struct layer_data {
- VkInstance instance;
- unique_ptr<INSTANCE_STATE> instance_state;
+ VkInstance instance = VK_NULL_HANDLE;
+ unique_ptr<INSTANCE_STATE> instance_state = nullptr;
- debug_report_data *report_data;
+ debug_report_data *report_data = nullptr;
std::vector<VkDebugReportCallbackEXT> logging_callback;
- VkLayerDispatchTable *device_dispatch_table;
- VkLayerInstanceDispatchTable *instance_dispatch_table;
+ VkLayerDispatchTable *device_dispatch_table = nullptr;
+ VkLayerInstanceDispatchTable *instance_dispatch_table = nullptr;
- devExts device_extensions;
+ devExts device_extensions = {};
unordered_set<VkQueue> queues; // All queues under given device
// Vector indices correspond to queueFamilyIndex
vector<unique_ptr<VkQueueFamilyProperties>> queue_family_properties;
@@ -138,18 +138,13 @@ struct layer_data {
unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> imageLayoutMap;
unordered_map<VkRenderPass, unique_ptr<RENDER_PASS_NODE>> renderPassMap;
unordered_map<VkShaderModule, unique_ptr<shader_module>> shaderModuleMap;
- VkDevice device;
+ VkDevice device = VK_NULL_HANDLE;
// Device specific data
- PHYS_DEV_PROPERTIES_NODE phys_dev_properties;
- VkPhysicalDeviceMemoryProperties phys_dev_mem_props;
- VkPhysicalDeviceFeatures physical_device_features;
- unique_ptr<PHYSICAL_DEVICE_STATE> physical_device_state;
-
- layer_data()
- : instance_state(nullptr), report_data(nullptr), device_dispatch_table(nullptr), instance_dispatch_table(nullptr),
- device_extensions(), device(VK_NULL_HANDLE), phys_dev_properties{}, phys_dev_mem_props{}, physical_device_features{},
- physical_device_state(nullptr){};
+ PHYS_DEV_PROPERTIES_NODE phys_dev_properties = {};
+ VkPhysicalDeviceMemoryProperties phys_dev_mem_props = {};
+ VkPhysicalDeviceFeatures physical_device_features = {};
+ unique_ptr<PHYSICAL_DEVICE_STATE> physical_device_state = nullptr;
};
// TODO : Do we need to guard access to layer_data_map w/ lock?