From df99aa1debf6df6d63c2e54a58571cd6af95c95d Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 24 Apr 2017 15:31:38 -0600 Subject: layers:Validate display_timing swapchainCount For the VK_GOOGLE_display_timing extension validate that the swapchainCount in the VkPresentTimesInfoGOOGLE extension struct matches the swapchainCount in the VkPresentInfoKHR struct. Update unique ID database. --- layers/core_validation.cpp | 14 ++++++++++++++ layers/vk_validation_error_database.txt | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'layers') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 6b92b5ba..2673602d 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -10744,6 +10744,20 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf } } } + } else if (VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE == pnext->sType) { + VkPresentTimesInfoGOOGLE *present_times_info = (VkPresentTimesInfoGOOGLE *)pnext; + if (pPresentInfo->swapchainCount != present_times_info->swapchainCount) { + skip |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, + reinterpret_cast(pPresentInfo->pSwapchains[0]), __LINE__, + + VALIDATION_ERROR_03214, "DS", + "vkQueuePresentKHR(): VkPresentTimesInfoGOOGLE.swapchainCount is %i but " + "pPresentInfo->swapchainCount is %i. For VkPresentTimesInfoGOOGLE down pNext " + "chain of VkPresentInfoKHR, VkPresentTimesInfoGOOGLE.swapchainCount " + "must equal VkPresentInfoKHR.swapchainCount.", + present_times_info->swapchainCount, pPresentInfo->swapchainCount); + } } pnext = (std_header *)pnext->pNext; } diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index be851197..5076422a 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -3034,7 +3034,7 @@ VALIDATION_ERROR_03210~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information VALIDATION_ERROR_03211~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'sType must be VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkDeviceGroupPresentInfoKHX)~^~implicit VALIDATION_ERROR_03212~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'If swapchainCount is not 0, pDeviceMasks must be a pointer to an array of swapchainCount uint32_t values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkDeviceGroupPresentInfoKHX)~^~implicit VALIDATION_ERROR_03213~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'mode must be a valid VkDeviceGroupPresentModeFlagBitsKHX value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkDeviceGroupPresentInfoKHX)~^~implicit -VALIDATION_ERROR_03214~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext chain of this VkPresentTimesInfoGOOGLE structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkPresentTimesInfoGOOGLE)~^~ +VALIDATION_ERROR_03214~^~Y~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where VkPresentInfoKHR is in the pNext chain of this VkPresentTimesInfoGOOGLE structure.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkPresentTimesInfoGOOGLE)~^~ VALIDATION_ERROR_03215~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'sType must be VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkPresentTimesInfoGOOGLE)~^~implicit VALIDATION_ERROR_03216~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'If pTimes is not NULL, pTimes must be a pointer to an array of swapchainCount VkPresentTimeGOOGLE structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkPresentTimesInfoGOOGLE)~^~implicit VALIDATION_ERROR_03217~^~N~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '30.8. WSI Swapchain' which states 'swapchainCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkPresentTimesInfoGOOGLE)~^~implicit -- cgit v1.2.3