aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layers/swapchain.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index b999d666..a91674b0 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -859,6 +859,14 @@ vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocatio
layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map);
std::unique_lock<std::mutex> lock(global_lock);
SwpSurface *pSurface = &my_data->surfaceMap[surface];
+ 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_SURFACE_EXTENSION_NAME);
+ }
// Regardless of skipCall value, do some internal cleanup:
if (pSurface) {