diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-12-25 02:04:31 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-12-31 02:07:33 -0300 |
| commit | bb5903c665383f058f00cea72ed7c7a98e5bbeb1 (patch) | |
| tree | 449c8051b70bc968c040ab36189b1e26e2ba4748 /src/video_core/renderer_vulkan/renderer_vulkan.cpp | |
| parent | d7f0249d2e50864041ddf97a89581957a17acf05 (diff) | |
renderer_vulkan: Catch and report exceptions
Move more Vulkan code to report errors with exceptions and report them
through a log before notifying it with an error boolean for backwards
compatibility. In the future we can replace the rasterizer two-step
initialization to always use exceptions.
Diffstat (limited to 'src/video_core/renderer_vulkan/renderer_vulkan.cpp')
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 8e01dc191d..ccdc86ed77 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -137,7 +137,7 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { render_window.OnFrameDisplayed(); } -bool RendererVulkan::Init() { +bool RendererVulkan::Init() try { library = OpenLibrary(); std::tie(instance, instance_version) = CreateInstance( library, dld, render_window.GetWindowInfo().type, true, Settings::values.renderer_debug); @@ -168,8 +168,11 @@ bool RendererVulkan::Init() { blit_screen = std::make_unique<VKBlitScreen>(cpu_memory, render_window, *rasterizer, *device, *memory_manager, *swapchain, *scheduler, screen_info); - return true; + +} catch (const vk::Exception& exception) { + LOG_ERROR(Render_Vulkan, "Vulkan initialization failed with error: {}", exception.what()); + return false; } void RendererVulkan::ShutDown() { |
