Merge vk-gl-cts/vulkan-cts-1.0.0 into vk-gl-cts/vulkan-cts-1.0.1
authorPyry Haulos <phaulos@google.com>
Wed, 1 Mar 2017 15:53:44 +0000 (07:53 -0800)
committerPyry Haulos <phaulos@google.com>
Wed, 1 Mar 2017 15:53:44 +0000 (07:53 -0800)
Change-Id: I9eec4dd1fa88a85374eba8d0851b00a28c50b4ac

external/vulkancts/framework/vulkan/vkAllocationCallbackUtil.cpp

index 2224665..946c087 100644 (file)
@@ -482,9 +482,18 @@ void validateAllocationCallbacks (const AllocationCallbackRecorder& recorder, Al
 
                                        if (record.data.reallocation.returnedPtr)
                                        {
-                                               DE_ASSERT(!de::contains(ptrToSlotIndex, record.data.reallocation.returnedPtr));
-                                               ptrToSlotIndex[record.data.reallocation.returnedPtr] = allocations.size();
-                                               allocations.push_back(AllocationSlot(record, true));
+                                               if (!de::contains(ptrToSlotIndex, record.data.reallocation.returnedPtr))
+                                               {
+                                                       ptrToSlotIndex[record.data.reallocation.returnedPtr] = allocations.size();
+                                                       allocations.push_back(AllocationSlot(record, true));
+                                               }
+                                               else
+                                               {
+                                                       const size_t slotNdx = ptrToSlotIndex[record.data.reallocation.returnedPtr];
+                                                       DE_ASSERT(!allocations[slotNdx].isLive);
+                                                       allocations[slotNdx].isLive = true;
+                                                       allocations[slotNdx].record = record;
+                                               }
                                        }
                                }