diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-09-22 16:40:27 +1200 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-09-27 09:08:44 +1300 |
| commit | 6a441764d9b4f423860811e1be23d6afdc4a5bc2 (patch) | |
| tree | 30430fb6af7843e336fe7edcc96a77bf49b1c1d2 | |
| parent | 24ef81b5f1ce35b94050521724ba2750bcc85b1d (diff) | |
| download | usermoji-6a441764d9b4f423860811e1be23d6afdc4a5bc2.tar.xz | |
layers: Move ACQUIRE_NO_SYNC check from Swapchain to Core Validation
Signed-off-by: Chris Forbes <chrisforbes@google.com>
| -rw-r--r-- | layers/core_validation.cpp | 8 | ||||
| -rw-r--r-- | layers/core_validation_error_enums.h | 1 | ||||
| -rw-r--r-- | layers/swapchain.cpp | 7 | ||||
| -rw-r--r-- | layers/swapchain.h | 1 | ||||
| -rw-r--r-- | layers/vk_validation_layer_details.md | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 114a34ec..129ab922 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11314,6 +11314,14 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainK bool skip_call = false; std::unique_lock<std::mutex> lock(global_lock); + + if (fence == VK_NULL_HANDLE && semaphore == VK_NULL_HANDLE) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + reinterpret_cast<uint64_t &>(device), __LINE__, DRAWSTATE_NO_SYNC_FOR_ACQUIRE, "DS", + "vkAcquireNextImageKHR: Semaphore and fence cannot both be VK_NULL_HANDLE. There would be no way " + "to determine the completion of this operation."); + } + auto pSemaphore = getSemaphoreNode(dev_data, semaphore); if (pSemaphore && pSemaphore->signaled) { skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, diff --git a/layers/core_validation_error_enums.h b/layers/core_validation_error_enums.h index 0bb18d89..12e56d54 100644 --- a/layers/core_validation_error_enums.h +++ b/layers/core_validation_error_enums.h @@ -235,6 +235,7 @@ enum DRAW_STATE_ERROR { // granularity DRAWSTATE_PUSH_CONSTANTS_ERROR, // Push constants exceed maxPushConstantSize DRAWSTATE_INVALID_SUBPASS_INDEX, // Stepping beyond last subpass, or not reaching it + DRAWSTATE_NO_SYNC_FOR_ACQUIRE, // AcquireNextImageKHR with no sync object }; // Shader Checker ERROR codes diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 5aca7f68..4ca28a6d 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -2089,13 +2089,6 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainK "vkAcquireNextImageKHR() called even though the %s extension was not enabled for this VkDevice.", VK_KHR_SWAPCHAIN_EXTENSION_NAME); } - if ((semaphore == VK_NULL_HANDLE) && (fence == VK_NULL_HANDLE)) { - skip_call |= - log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - reinterpret_cast<uint64_t>(device), __LINE__, SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, swapchain_layer_name, - "vkAcquireNextImageKHR() called with both the semaphore and fence parameters set to VK_NULL_HANDLE (at " - "least one should be used)."); - } SwpSwapchain *pSwapchain = NULL; { auto it = my_data->swapchainMap.find(swapchain); diff --git a/layers/swapchain.h b/layers/swapchain.h index 9b84f20b..f28b92ed 100644 --- a/layers/swapchain.h +++ b/layers/swapchain.h @@ -73,7 +73,6 @@ enum SWAPCHAIN_ERROR { // vkGetPhysicalDeviceQueueFamilyProperties() SWAPCHAIN_SURFACE_NOT_SUPPORTED_WITH_QUEUE, // A surface is not supported by a given queueFamilyIndex, as seen by // vkGetPhysicalDeviceSurfaceSupportKHR() - SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, // vkAcquireNextImageKHR should be called with a valid semaphore and/or fence SWAPCHAIN_GET_SUPPORTED_DISPLAYS_WITHOUT_QUERY, // vkGetDisplayPlaneSupportedDisplaysKHR should be called after querying // device display plane properties SWAPCHAIN_PLANE_INDEX_TOO_LARGE, // a planeIndex value is larger than what vkGetDisplayPlaneSupportedDisplaysKHR returns diff --git a/layers/vk_validation_layer_details.md b/layers/vk_validation_layer_details.md index 3c97fdac..56738637 100644 --- a/layers/vk_validation_layer_details.md +++ b/layers/vk_validation_layer_details.md @@ -120,6 +120,7 @@ The Draw State portion of the core validation layer tracks state leading into Dr | NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | TODO | None | | NA | Enum used when VK_LAYER_LUNARG_core_validation attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | TODO | None | | Bad subpass indexing | Must not step beyond last subpass in a renderpass instance, and must reach the last subpass before CmdEndRenderPass. | INVALID_SUBPASS_INDEX | vkCmdNextSubpass | RenderPassExcessiveNextSubpass | NA | +| Proper synchronization of acquired images | vkAcquireNextImageKHR should be called with a valid semaphore and/or fence | NO_SYNC_FOR_ACQUIRE | vkAcquireNextImageKHR | TODO | None | ### VK_LAYER_LUNARG_core_validation Draw State Pending Work @@ -360,7 +361,6 @@ This layer is a work in progress. VK_LAYER_LUNARG_swapchain layer is intended to | Valid use of queueFamilyIndex | Validates that a queueFamilyIndex not used before vkGetPhysicalDeviceQueueFamilyProperties() was called | DID_NOT_QUERY_QUEUE_FAMILIES | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | None | | Valid queueFamilyIndex value | Validates that a queueFamilyIndex value is less-than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyProperties | QUEUE_FAMILY_INDEX_TOO_LARGE | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | None | | Supported combination of queue and surface | Validates that the surface associated with a swapchain was seen to support the queueFamilyIndex of a given queue | SURFACE_NOT_SUPPORTED_WITH_QUEUE | vkQueuePresentKHR | TODO | None | -| Proper synchronization of acquired images | vkAcquireNextImageKHR should be called with a valid semaphore and/or fence | NO_SYNC_FOR_ACQUIRE | vkAcquireNextImageKHR | TODO | None | | Potential use before query | Validates that Display Plane Properties are queried before getting supported Display Planes | GET_SUPPORTED_DISPLAYS_WITHOUT_QUERY | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | actually: vkGetDisplayPlaneSupportedDisplaysKHR | | Index too large | Validates index is in range of phys device display plane props | PLANE_INDEX_TOO_LARGE | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | actually: vkGetDisplayPlaneSupportedDisplaysKHR | | Index too large | Validates index is in range of phys device display plane props | PLANE_INDEX_TOO_LARGE | vkGetPhysicalDeviceSurfaceSupportKHR | TODO | actually: vkGetDisplayPlaneCapabilitiesKHR | |
