layers: GL84, Reset vkQueuePresentKHR semaphore state in mem_tracker
authorMark Lobodzinski <mark@lunarg.com>
Tue, 19 Jan 2016 23:27:27 +0000 (16:27 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Tue, 19 Jan 2016 23:27:27 +0000 (16:27 -0700)
layers/mem_tracker.cpp

index f2f1871..b621c6e 100644 (file)
@@ -2970,6 +2970,16 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(
     if (!skip_call) {
         result = my_data->device_dispatch_table->QueuePresentKHR(queue, pPresentInfo);
     }
+
+    loader_platform_thread_lock_mutex(&globalLock);
+    for (uint32_t i = 0; i < pPresentInfo->waitSemaphoreCount; i++) {
+        VkSemaphore sem = pPresentInfo->pWaitSemaphores[i];
+        if (my_data->semaphoreMap.find(sem) != my_data->semaphoreMap.end()) {
+            my_data->semaphoreMap[sem] = MEMTRACK_SEMAPHORE_STATE_UNSET;
+        }
+    }
+    loader_platform_thread_unlock_mutex(&globalLock);
+
     return result;
 }