aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@ad.corp.google.com>2016-08-02 10:50:29 -0600
committerTobin Ehlis <tobine@google.com>2016-08-02 11:36:11 -0600
commit9ebf86e556fab3468ee29b2d806a375806745d88 (patch)
tree8d41cd3a5f0f32bc3d7e2cccac06452d81a492fa
parent3d35c7b144fe0d819a1c36f29c4bec0033f5bcb6 (diff)
downloadusermoji-9ebf86e556fab3468ee29b2d806a375806745d88.tar.xz
layers: Fix object_tracker build
This moves a static array of maps to be a vector of maps. Building android from Windows crashes clang without this change. clang in the NDK doesn't like arrays of unordered_maps.
-rw-r--r--layers/object_tracker.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/layers/object_tracker.h b/layers/object_tracker.h
index 0d70bec2..8f514a6d 100644
--- a/layers/object_tracker.h
+++ b/layers/object_tracker.h
@@ -81,6 +81,7 @@ struct instance_extension_enables {
bool win32_enabled;
};
+typedef std::unordered_map<uint64_t, OBJTRACK_NODE *> object_map_type;
struct layer_data {
VkInstance instance;
VkPhysicalDevice physical_device;
@@ -101,8 +102,8 @@ struct layer_data {
std::vector<VkQueueFamilyProperties> queue_family_properties;
- // Array of unordered_maps per object type to hold OBJTRACK_NODE info
- std::unordered_map<uint64_t, OBJTRACK_NODE *> object_map[VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT + 1];
+ // Vector of unordered_maps per object type to hold OBJTRACK_NODE info
+ std::vector<object_map_type> object_map;
// Special-case map for swapchain images
std::unordered_map<uint64_t, OBJTRACK_NODE *> swapchainImageMap;
// Map of queue information structures, one per queue
@@ -112,7 +113,9 @@ struct layer_data {
layer_data()
: instance(nullptr), physical_device(nullptr), num_objects{}, num_total_objects(0), report_data(nullptr),
wsi_enabled(false), objtrack_extensions_enabled(false), num_tmp_callbacks(0), tmp_dbg_create_infos(nullptr),
- tmp_callbacks(nullptr), object_map{} {}
+ tmp_callbacks(nullptr), object_map{} {
+ object_map.resize(VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT + 1);
+ }
};