diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-10-12 10:21:19 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-11-22 11:45:12 +1300 |
| commit | 89fba1d446ca0aea1008835be82926ec9bb34f56 (patch) | |
| tree | 6629178b9f2d9c35fc3a37328e9064ac3f5b33ce /layers/core_validation.cpp | |
| parent | fc25df6e6d16e337fdd33e45fea0a6115c80da53 (diff) | |
| download | usermoji-89fba1d446ca0aea1008835be82926ec9bb34f56.tar.xz | |
layers: Move complaints about presenting on bad queues to CV
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 155d5bd6..01ab4496 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11735,6 +11735,8 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf bool skip_call = false; std::lock_guard<std::mutex> lock(global_lock); + auto queue_state = getQueueNode(dev_data, queue); + for (uint32_t i = 0; i < pPresentInfo->waitSemaphoreCount; ++i) { auto pSemaphore = getSemaphoreNode(dev_data, pPresentInfo->pWaitSemaphores[i]); if (pSemaphore && !pSemaphore->signaled) { @@ -11781,6 +11783,28 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf } } } + + // All physical devices and queue families are required to be able + // to present to any native window on Android; require the + // application to have established support on any other platform. + if (!dev_data->instance_data->androidSurfaceExtensionEnabled) { + auto surface_state = getSurfaceState(dev_data->instance_data, swapchain_data->createInfo.surface); + auto support_it = surface_state->gpu_queue_support.find({dev_data->physical_device, queue_state->queueFamilyIndex}); + + if (support_it == surface_state->gpu_queue_support.end()) { + skip_call |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, + reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__, + DRAWSTATE_SWAPCHAIN_UNSUPPORTED_QUEUE, "DS", "vkQueuePresentKHR: Presenting image without calling " + "vkGetPhysicalDeviceSurfaceSupportKHR"); + } else if (!support_it->second) { + skip_call |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, + reinterpret_cast<uint64_t const &>(pPresentInfo->pSwapchains[i]), __LINE__, + DRAWSTATE_SWAPCHAIN_UNSUPPORTED_QUEUE, "DS", "vkQueuePresentKHR: Presenting image on queue that cannot " + "present to this surface"); + } + } } } |
