aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2016-02-10 09:55:49 -0600
committerTobin Ehlis <tobine@google.com>2016-02-11 13:53:19 -0700
commitf120511084554d66f495d6090f16c75112586bfd (patch)
tree2767b51fa025cee230d04ff7f433621b962ab1b5
parentd20128ab3f1e98295d32626124f094320835c004 (diff)
downloadusermoji-f120511084554d66f495d6090f16c75112586bfd.tar.xz
layers: Also allow fences to be submitted via acquire next image.
-rw-r--r--layers/mem_tracker.cpp19
-rw-r--r--layers/mem_tracker.h2
2 files changed, 18 insertions, 3 deletions
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index e883c7a2..9a26a7e2 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -1995,9 +1995,18 @@ verifyFenceStatus(
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);
+ if (!pFenceInfo->second.queue &&
+ !pFenceInfo->second
+ .swapchain) { // 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,
+ reinterpret_cast<uint64_t &>(fence),
+ __LINE__, MEMTRACK_INVALID_FENCE_STATE, "MEM",
+ "%s called for fence %#" PRIxLEAST64
+ " which has not been submitted on a Queue or during "
+ "acquire next image.",
+ apiCall, reinterpret_cast<uint64_t &>(fence));
}
} else {
pFenceInfo->second.firstTimeFlag = VK_FALSE;
@@ -3118,6 +3127,10 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(
}
my_data->semaphoreMap[semaphore] = MEMTRACK_SEMAPHORE_STATE_SIGNALLED;
}
+ auto fence_data = my_data->fenceMap.find(fence);
+ if (fence_data != my_data->fenceMap.end()) {
+ fence_data->second.swapchain = swapchain;
+ }
loader_platform_thread_unlock_mutex(&globalLock);
if (VK_FALSE == skipCall) {
result = my_data->device_dispatch_table->AcquireNextImageKHR(device,
diff --git a/layers/mem_tracker.h b/layers/mem_tracker.h
index 23b57f68..414ae483 100644
--- a/layers/mem_tracker.h
+++ b/layers/mem_tracker.h
@@ -185,6 +185,8 @@ 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
+ VkSwapchainKHR
+ swapchain; // Swapchain that this fence is submitted against or NULL
VkBool32 firstTimeFlag; // Fence was created in signaled state, avoid warnings for first use
VkFenceCreateInfo createInfo;
};