diff options
| author | Ian Elliott <ianelliott@google.com> | 2016-01-05 17:41:43 -0700 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2016-01-06 12:23:10 -0700 |
| commit | c0a4e7a918754c3cd405c6118f49babfd25b32fd (patch) | |
| tree | f0af1278fe28e1b8434229ce90c0599f6633e7c9 /layers/swapchain.cpp | |
| parent | de5d2cd46d86673545e2abca5a8aee285ea9bcea (diff) | |
| download | usermoji-c0a4e7a918754c3cd405c6118f49babfd25b32fd.tar.xz | |
Swapchain: Reconcile MD file with Swapchain layer.
Conflicts:
layers/vk_validation_layer_details.md
Diffstat (limited to 'layers/swapchain.cpp')
| -rw-r--r-- | layers/swapchain.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
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, |
