From 6185c081c1a6ec13b54eab6a12ff72814cf3addb Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Tue, 1 Oct 2024 17:08:41 -0700 Subject: Fix vulkan validation error --- src/app.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/app.cpp') diff --git a/src/app.cpp b/src/app.cpp index f48edd9..11a219d 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -4,6 +4,8 @@ #include "imgui_impl_vulkan.h" #include "argparse/argparse.hpp" #include +#include +#include #include #include #include @@ -16,6 +18,7 @@ #include int main(int argc, char** argv) { + spdlog::cfg::load_env_levels(); argparse::ArgumentParser program("Iris Renderer"); program.add_argument("width") .help("display width of the window") @@ -39,9 +42,9 @@ int main(int argc, char** argv) { const char* description = nullptr; glfwGetError(&description); if (description != nullptr) { - std::cerr << "Error: " << description << std::endl; + spdlog::critical("Failed to initialize GLFW: {}", description); } else { - std::cerr << "Failed to initialize GLFW" << std::endl; + spdlog::critical("Failed to initialize GLFW"); } glfwTerminate(); @@ -54,7 +57,7 @@ int main(int argc, char** argv) { glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); auto window = glfwCreateWindow(window_width, window_height, "Iris Renderer", nullptr, nullptr); if (window == nullptr) { - std::cerr << "Failed to create GLFW window" << std::endl; + spdlog::critical("Failed to create GLFW window"); abort(); } @@ -103,6 +106,7 @@ int main(int argc, char** argv) { glfwDestroyWindow(swapchain.window); glfwTerminate(); + swapchain.release(); device.destroy(); return 0; -- cgit v1.2.3-70-g09d2