aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorIan Elliott <ianelliott@google.com>2015-12-29 17:52:10 -0700
committerJon Ashburn <jon@lunarg.com>2016-01-06 12:23:09 -0700
commitcac973f2a797d2c7a9732e7f03c376e45e7caa9e (patch)
treee4583a5565b58ac1dfb93eb9fef6588a93b2dd54 /layers
parent5b2258c3dcb90522841fd68c5b69033dbe1eed03 (diff)
downloadusermoji-cac973f2a797d2c7a9732e7f03c376e45e7caa9e.tar.xz
Swapchain: Fixes and improvements validating vkAcquireNextImageKHR().
Diffstat (limited to 'layers')
-rw-r--r--layers/swapchain.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index ff768167..9a3c2faf 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -1705,8 +1705,14 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(
VkFence fence,
uint32_t* pImageIndex)
{
-// TODO: Record/update the state of the swapchain, in case an error occurs
-// (e.g. VK_ERROR_OUT_OF_DATE_KHR).
+// TODOs:
+//
+// - Address the timeout. Possibilities include looking at the state of the
+// swapchain's images, depending on the timeout value.
+// - Validate that semaphore and fence are either VK_NULL_HANDLE or valid
+// handles.
+// - Record/update the state of the swapchain, in case an error occurs
+// (e.g. VK_ERROR_OUT_OF_DATE_KHR).
VkResult result = VK_SUCCESS;
VkBool32 skipCall = VK_FALSE;
layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
@@ -1757,6 +1763,11 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(
__FUNCTION__, __FUNCTION__);
}
}
+ if (!pImageIndex) {
+ skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
+ device,
+ "pImageIndex");
+ }
if (VK_FALSE == skipCall) {
// Call down the call chain: