From 0234cd2e5685ff7b3787877b38870c0fcdf2bae4 Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Wed, 23 Mar 2016 08:28:54 -0600 Subject: layers: GH117: swapchain layer warns if app uses neither semaphore nor fence. This addresses github issue #117. Applications should call vkAcquireNextImageKHR with either a valid semaphore and/or fence. Issue a warning if both are set to VK_NULL_HANDLE. --- layers/swapchain.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'layers/swapchain.cpp') diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index d513208f..84bcaad1 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -1743,6 +1743,11 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice de "%s() called even though the %s extension was not enabled for this VkDevice.", __FUNCTION__, VK_KHR_SWAPCHAIN_EXTENSION_NAME); } + if ((semaphore == VK_NULL_HANDLE) && (fence == VK_NULL_HANDLE)) { + skipCall |= LOG_WARNING(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, device, "VkDevice", SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, + "%s() called with both the semaphore and fence parameters set to " + "VK_NULL_HANDLE (at least one should be used).", __FUNCTION__); + } SwpSwapchain *pSwapchain = &my_data->swapchainMap[swapchain]; if (pSwapchain) { // Look to see if the application is trying to own too many images at -- cgit v1.2.3