Swapchain: Reconcile MD file with Swapchain layer.
Conflicts:
layers/vk_validation_layer_details.md
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index 857a174..4f70f3e 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -359,6 +359,17 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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,