From 2a2d6e12d0698a88d5d05a6311e1dbdf4a6dc95f Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 11 Jul 2015 16:06:23 +1200 Subject: 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 --- layers/mem_tracker.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layers/mem_tracker.h b/layers/mem_tracker.h index b8607ab2..48d4f143 100644 --- a/layers/mem_tracker.h +++ b/layers/mem_tracker.h @@ -100,10 +100,12 @@ struct MT_MEM_OBJ_INFO { // 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; }; -- cgit v1.2.3