diff options
author | Chuyan Zhang <chuyan@ucsb.edu> | 2024-10-01 17:08:41 -0700 |
---|---|---|
committer | Chuyan Zhang <chuyan@ucsb.edu> | 2024-10-01 17:08:41 -0700 |
commit | 6185c081c1a6ec13b54eab6a12ff72814cf3addb (patch) | |
tree | 49d5461e95a9894069bb04c492c2079789636d3f /src/app.cpp | |
parent | e5eed5bdfa01cf549436c6001eaf334d266acc40 (diff) | |
download | iris-6185c081c1a6ec13b54eab6a12ff72814cf3addb.tar.gz iris-6185c081c1a6ec13b54eab6a12ff72814cf3addb.zip |
Fix vulkan validation error
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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 <cstdint> +#include <spdlog/spdlog.h> +#include <spdlog/cfg/env.h> #include <sys/types.h> #include <vk_mem_alloc.h> #include <vulkan/vulkan_core.h> @@ -16,6 +18,7 @@ #include <vector> 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; |