diff options
| -rw-r--r-- | layers/mem_tracker.cpp | 24 | ||||
| -rw-r--r-- | layers/mem_tracker.h | 1 |
2 files changed, 15 insertions, 10 deletions
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index 4425c0b7..8f81834b 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -1886,6 +1886,9 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence( MT_FENCE_INFO* pFI = &my_data->fenceMap[*pFence]; memset(pFI, 0, sizeof(MT_FENCE_INFO)); memcpy(&(pFI->createInfo), pCreateInfo, sizeof(VkFenceCreateInfo)); + if (pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT) { + pFI->firstTimeFlag = VK_TRUE; + } loader_platform_thread_unlock_mutex(&globalLock); } return result; @@ -1934,16 +1937,17 @@ verifyFenceStatus( VkBool32 skipCall = VK_FALSE; auto pFenceInfo = my_data->fenceMap.find(fence); if (pFenceInfo != my_data->fenceMap.end()) { - if (pFenceInfo->second.createInfo.flags & VK_FENCE_CREATE_SIGNALED_BIT) { - // TODO: Possibly move this to a lower-level warning if we ever add, say, a VERBOSE warning option. There are too many - // cases where ISVs want to be able to do this to make it a normal warning or perf-warning. - skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, (uint64_t) fence, __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM", - "%s specified fence %#" PRIxLEAST64 " already in SIGNALED state.", apiCall, (uint64_t) fence); - } - if (!pFenceInfo->second.queue) { // Checking status of unsubmitted fence - // TODO: I don't see a Valid Usage section for ResetFences. This behavior should be documented there. - skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_WARN_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, (uint64_t) fence, __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM", - "%s called for fence %#" PRIxLEAST64 " which has not been submitted on a Queue.", apiCall, (uint64_t) fence); + if (pFenceInfo->second.firstTimeFlag != VK_TRUE) { + if ((pFenceInfo->second.createInfo.flags & VK_FENCE_CREATE_SIGNALED_BIT) & pFenceInfo->second.firstTimeFlag!= VK_TRUE) { + skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, (uint64_t) fence, __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM", + "%s specified fence %#" PRIxLEAST64 " already in SIGNALED state.", apiCall, (uint64_t) fence); + } + if (!pFenceInfo->second.queue) { // Checking status of unsubmitted fence + skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_WARN_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, (uint64_t) fence, __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM", + "%s called for fence %#" PRIxLEAST64 " which has not been submitted on a Queue.", apiCall, (uint64_t) fence); + } + } else { + pFenceInfo->second.firstTimeFlag = VK_FALSE; } } return skipCall; diff --git a/layers/mem_tracker.h b/layers/mem_tracker.h index debd5d3c..23cbb6f2 100644 --- a/layers/mem_tracker.h +++ b/layers/mem_tracker.h @@ -181,6 +181,7 @@ struct MT_PASS_INFO { struct MT_FENCE_INFO { uint64_t fenceId; // Sequence number for fence at last submit VkQueue queue; // Queue that this fence is submitted against or NULL + VkBool32 firstTimeFlag; // Fence was created in signaled state, avoid warnings for first use VkFenceCreateInfo createInfo; }; |
