From c0a4e7a918754c3cd405c6118f49babfd25b32fd Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Tue, 5 Jan 2016 17:41:43 -0700 Subject: Swapchain: Reconcile MD file with Swapchain layer. Conflicts: layers/vk_validation_layer_details.md --- layers/swapchain.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'layers/swapchain.cpp') diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 857a1743..4f70f3e8 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -359,6 +359,17 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( VkResult result = VK_SUCCESS; VkBool32 skipCall = VK_FALSE; layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); + SwpInstance *pInstance = &(my_data->instanceMap[instance]); + + // Validate that the platform extension was enabled: + if (pInstance && !pInstance->SurfaceExtensionEnabled) { + skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, + pInstance, + "VkInstance", + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, + "%s() called even though the %s extension was not enabled for this VkInstance.", + __FUNCTION__, VK_KHR_x_SURFACE_EXTENSION_NAME); + } if (!pCreateInfo) { skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, @@ -398,6 +409,17 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( VkResult result = VK_SUCCESS; VkBool32 skipCall = VK_FALSE; layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); + SwpInstance *pInstance = &(my_data->instanceMap[instance]); + + // Validate that the platform extension was enabled: + if (pInstance && !pInstance->mirSurfaceExtensionEnabled) { + skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, + pInstance, + "VkInstance", + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, + "%s() called even though the %s extension was not enabled for this VkInstance.", + __FUNCTION__, VK_KHR_MIR_SURFACE_EXTENSION_NAME); + } if (!pCreateInfo) { skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, @@ -471,6 +493,17 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( VkResult result = VK_SUCCESS; VkBool32 skipCall = VK_FALSE; layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); + SwpInstance *pInstance = &(my_data->instanceMap[instance]); + + // Validate that the platform extension was enabled: + if (pInstance && !pInstance->waylandSurfaceExtensionEnabled) { + skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, + pInstance, + "VkInstance", + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, + "%s() called even though the %s extension was not enabled for this VkInstance.", + __FUNCTION__, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); + } if (!pCreateInfo) { skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, @@ -544,6 +577,17 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( VkResult result = VK_SUCCESS; VkBool32 skipCall = VK_FALSE; layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); + SwpInstance *pInstance = &(my_data->instanceMap[instance]); + + // Validate that the platform extension was enabled: + if (pInstance && !pInstance->win32SurfaceExtensionEnabled) { + skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, + pInstance, + "VkInstance", + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, + "%s() called even though the %s extension was not enabled for this VkInstance.", + __FUNCTION__, VK_KHR_WIN32_SURFACE_EXTENSION_NAME); + } if (!pCreateInfo) { skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, @@ -616,6 +660,17 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( VkResult result = VK_SUCCESS; VkBool32 skipCall = VK_FALSE; layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); + SwpInstance *pInstance = &(my_data->instanceMap[instance]); + + // Validate that the platform extension was enabled: + if (pInstance && !pInstance->xcbSurfaceExtensionEnabled) { + skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, + pInstance, + "VkInstance", + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, + "%s() called even though the %s extension was not enabled for this VkInstance.", + __FUNCTION__, VK_KHR_XCB_SURFACE_EXTENSION_NAME); + } if (!pCreateInfo) { skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, @@ -690,6 +745,17 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( VkResult result = VK_SUCCESS; VkBool32 skipCall = VK_FALSE; layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); + SwpInstance *pInstance = &(my_data->instanceMap[instance]); + + // Validate that the platform extension was enabled: + if (pInstance && !pInstance->xlibSurfaceExtensionEnabled) { + skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, + pInstance, + "VkInstance", + SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED, + "%s() called even though the %s extension was not enabled for this VkInstance.", + __FUNCTION__, VK_KHR_XLIB_SURFACE_EXTENSION_NAME); + } if (!pCreateInfo) { skipCall |= LOG_ERROR_NULL_POINTER(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, -- cgit v1.2.3