layer.second_device_created_during_create_device.dispatch_table.DestroyDevice);
}
- for (auto& created_device : layer.created_devices) {
- if (created_device.device_handle == device) {
- created_device.dispatch_table.DestroyDevice(device, pAllocator);
- break;
- }
+ auto it = std::find_if(std::begin(layer.created_devices), std::end(layer.created_devices),
+ [device](const TestLayer::Device& dev) { return device == dev.device_handle; });
+ if (it != std::end(layer.created_devices)) {
+ it->dispatch_table.DestroyDevice(device, pAllocator);
+ layer.created_devices.erase(it);
}
}
driver.physical_devices.at(0).add_extensions({"VK_KHR_swapchain"});
// Hardware doesn't support the debug extensions
- // // Use getDeviceProcAddr & vary enabling the debug extensions
+ // Use getDeviceProcAddr & vary enabling the debug extensions
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, false, false, false));
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, false, true, false));
- // // Use getInstanceProcAddr & vary enabling the debug extensions
+ // Use getInstanceProcAddr & vary enabling the debug extensions
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, true, false, false));
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, true, true, false));
driver.physical_devices.at(0).add_extensions({"VK_KHR_swapchain"});
// Hardware doesn't support the debug extensions
- // // Use getDeviceProcAddr & vary enabling the debug extensions
+ // Use getDeviceProcAddr & vary enabling the debug extensions
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, false, false, false));
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, false, true, false));
- // // Use getInstanceProcAddr & vary enabling the debug extensions
+ // Use getInstanceProcAddr & vary enabling the debug extensions
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, true, false, false));
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, true, true, false));
.add_injected_instance_extensions({{VK_EXT_DEBUG_REPORT_EXTENSION_NAME}, {VK_EXT_DEBUG_UTILS_EXTENSION_NAME}})
.add_injected_device_extension({VK_EXT_DEBUG_MARKER_EXTENSION_NAME});
- // // Use getDeviceProcAddr & vary enabling the debug extensions
+ // Use getDeviceProcAddr & vary enabling the debug extensions
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, false, false, true));
ASSERT_NO_FATAL_FAILURE(CheckDeviceFunctions(env, false, true, true));