layers: memtracker - waiting on only some fences
authorMike Stroyan <mike@LunarG.com>
Wed, 15 Apr 2015 21:37:47 +0000 (15:37 -0600)
committerChia-I Wu <olv@lunarg.com>
Thu, 16 Apr 2015 09:48:20 +0000 (17:48 +0800)
Record correctly when only some fences of a queue are waited for.

layers/mem_tracker.cpp

index 3dc0412..967272a 100644 (file)
@@ -185,13 +185,15 @@ static void updateFenceTracking(VkFence fence)
     MT_FENCE_INFO *pCurFenceInfo = NULL;
     uint64_t       fenceId       = 0;
     VkQueue      queue         = NULL;
+    bool found = false;
 
-    for (map<uint64_t, MT_FENCE_INFO*>::iterator ii=fenceMap.begin(); ii!=fenceMap.end(); ++ii) {
+    for (map<uint64_t, MT_FENCE_INFO*>::iterator ii=fenceMap.begin(); !found && ii!=fenceMap.end(); ++ii) {
         if ((*ii).second != NULL) {
             if (fence == ((*ii).second)->fence) {
                 queue = ((*ii).second)->queue;
                 MT_QUEUE_INFO *pQueueInfo = queueMap[queue];
                 pQueueInfo->lastRetiredId = (*ii).first;
+                found = true;
             } else {
                 deleteFenceInfo((*ii).first);
             }