layers: UO: split device and instance data
diff --git a/layers/unique_objects.h b/layers/unique_objects.h
index eebb01e..76420a6 100644
--- a/layers/unique_objects.h
+++ b/layers/unique_objects.h
@@ -41,13 +41,12 @@
: desc_update_template(update_template), create_info(*pCreateInfo) {}
};
-struct layer_data {
+struct instance_layer_data {
VkInstance instance;
debug_report_data *report_data;
std::vector<VkDebugReportCallbackEXT> logging_callback;
- VkLayerDispatchTable *device_dispatch_table;
- VkLayerInstanceDispatchTable *instance_dispatch_table;
+ VkLayerInstanceDispatchTable *dispatch_table;
// The following are for keeping track of the temporary callbacks that can
// be used in vkCreateInstance and vkDestroyInstance:
@@ -55,6 +54,19 @@
VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos;
VkDebugReportCallbackEXT *tmp_callbacks;
+ bool wsi_enabled;
+ std::unordered_map<uint64_t, uint64_t> unique_id_mapping; // Map uniqueID to actual object handle
+ VkPhysicalDevice gpu;
+
+ instance_layer_data() : wsi_enabled(false), gpu(VK_NULL_HANDLE){};
+};
+
+struct layer_data {
+ VkInstance instance;
+
+ debug_report_data *report_data;
+ VkLayerDispatchTable *dispatch_table;
+
std::unordered_map<uint64_t, std::unique_ptr<TEMPLATE_STATE>> desc_template_map;
bool wsi_enabled;
@@ -76,6 +88,7 @@
};
static std::unordered_map<void *, struct instance_extension_enables> instance_ext_map;
+static std::unordered_map<void *, instance_layer_data *> instance_layer_data_map;
static std::unordered_map<void *, layer_data *> layer_data_map;
static std::mutex global_lock; // Protect map accesses and unique_id increments