mem_tracker: Provide ctor for embedded union (and name it so we can)
VkSwapChainCreateInfoWSI has a nontrivial default constructor due to
having an embedded VkSwapChain handle.
From the C++11 standard, 9.5:
"If any non-static data member of a union has a non-trivial default
constructor (12.1), copy constructor (12.8), move constructor (12.8),
copy assignment operator (12.8), move assignment operator (12.8), or
destructor (12.4), the corresponding member function of the union must
be user-provided or it will be implicitly deleted (8.4.3) for the
union."
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
diff --git a/layers/mem_tracker.h b/layers/mem_tracker.h
index b8607ab..48d4f14 100644
--- a/layers/mem_tracker.h
+++ b/layers/mem_tracker.h
@@ -100,10 +100,12 @@
// This only applies to Buffers and Images, which can have memory bound to them
struct MT_OBJ_BINDING_INFO {
VkDeviceMemory mem;
- union {
+ union create_info {
VkImageCreateInfo image;
VkBufferCreateInfo buffer;
VkSwapChainCreateInfoWSI swapchain;
+
+ create_info() : image() {}
} create_info;
};