diff options
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index fb81f7ad..3cd41e04 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -10345,13 +10345,20 @@ static bool PreCallValidateCreateSwapchainKHR(layer_data *dev_data, const char * // Validate state for shared presentable case if (VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR == pCreateInfo->presentMode || VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR == pCreateInfo->presentMode) { - if (pCreateInfo->minImageCount != 1) { - // TODO: Add unique error id when available. + if (!dev_data->device_extensions.khr_shared_presentable_image) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - reinterpret_cast<uint64_t>(dev_data->device), __LINE__, DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY, "DS", + reinterpret_cast<uint64_t>(dev_data->device), __LINE__, DRAWSTATE_EXTENSION_NOT_ENABLED, "DS", + "%s called with presentMode %s which requires the VK_KHR_shared_presentable_image extension, which has not " + "been enabled.", + func_name, string_VkPresentModeKHR(pCreateInfo->presentMode))) + return true; + } else if (pCreateInfo->minImageCount != 1) { + if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + reinterpret_cast<uint64_t>(dev_data->device), __LINE__, VALIDATION_ERROR_03295, "DS", "%s called with presentMode %s, but minImageCount value is %d. For shared presentable image, minImageCount " - "must be 1.", - func_name, string_VkPresentModeKHR(pCreateInfo->presentMode), pCreateInfo->minImageCount)) + "must be 1. %s", + func_name, string_VkPresentModeKHR(pCreateInfo->presentMode), pCreateInfo->minImageCount, + validation_error_map[VALIDATION_ERROR_03295])) return true; } } @@ -10539,12 +10546,14 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInf vector<VkImageLayout> layouts; if (FindLayouts(dev_data, image, layouts)) { for (auto layout : layouts) { - if (layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) { + if ((layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) && + (!dev_data->device_extensions.khr_shared_presentable_image || + (layout != VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR))) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, reinterpret_cast<uint64_t &>(queue), __LINE__, VALIDATION_ERROR_01964, "DS", "Images passed to present must be in layout " - "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR but is in %s. %s", + "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in %s. %s", string_VkImageLayout(layout), validation_error_map[VALIDATION_ERROR_01964]); } } |
