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) {