Skip to content

Commit

Permalink
Merge pull request #5 from kevclarx/destroysurface
Browse files Browse the repository at this point in the history
Destroy surface before instance, validation layer name deprecated
  • Loading branch information
cklosters committed Feb 24, 2021
2 parents 58b9edd + 8f7bf9b commit fa5cfb9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.cpp
Expand Up @@ -40,7 +40,7 @@ const std::set<std::string>& getRequestedLayerNames()
if (layers.empty())
{
layers.emplace("VK_LAYER_NV_optimus");
layers.emplace("VK_LAYER_LUNARG_standard_validation");
layers.emplace("VK_LAYER_KHRONOS_validation");
}
return layers;
}
Expand Down Expand Up @@ -813,11 +813,12 @@ SDL_Window* createWindow()
/**
* Destroys the vulkan instance
*/
void quit(VkInstance instance, VkDevice device, VkDebugReportCallbackEXT callback, VkSwapchainKHR chain)
void quit(VkInstance instance, VkDevice device, VkDebugReportCallbackEXT callback, VkSwapchainKHR chain, VkSurfaceKHR presentation_surface)
{
vkDestroySwapchainKHR(device, chain, nullptr);
vkDestroyDevice(device, nullptr);
destroyDebugReportCallbackEXT(instance, callback, nullptr);
vkDestroySurfaceKHR(instance, presentation_surface, nullptr);
vkDestroyInstance(instance, nullptr);
SDL_Quit();
}
Expand Down Expand Up @@ -913,7 +914,7 @@ int main(int argc, char *argv[])
}

// Destroy Vulkan Instance
quit(instance, device, callback, swap_chain);
quit(instance, device, callback, swap_chain, presentation_surface);

return 1;
}

0 comments on commit fa5cfb9

Please sign in to comment.