diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-19 06:09:05 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-19 20:31:33 +0100 |
commit | 54747d60bc6cce24b51af737ef2b26b6b120661e (patch) | |
tree | 680d3f9d5d893d676769bd1b409ea67419cc196f /src/video_core/renderer_vulkan/vk_device.cpp | |
parent | vk_device: Add query for RGBA8Uint (diff) | |
download | yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.tar yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.tar.gz yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.tar.bz2 yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.tar.lz yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.tar.xz yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.tar.zst yuzu-54747d60bc6cce24b51af737ef2b26b6b120661e.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_device.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index a57428059..939eebe83 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp @@ -3,12 +3,15 @@ // Refer to the license.txt file included. #include <bitset> +#include <chrono> #include <cstdlib> #include <optional> #include <set> #include <string_view> +#include <thread> #include <vector> #include "common/assert.h" +#include "core/settings.h" #include "video_core/renderer_vulkan/declarations.h" #include "video_core/renderer_vulkan/vk_device.h" @@ -201,6 +204,22 @@ vk::Format VKDevice::GetSupportedFormat(vk::Format wanted_format, return wanted_format; } +void VKDevice::ReportLoss() const { + LOG_CRITICAL(Render_Vulkan, "Device loss occured!"); + + // Wait some time to let the log flush + std::this_thread::sleep_for(std::chrono::seconds{1}); + + if (!nv_device_diagnostic_checkpoints) { + return; + } + + [[maybe_unused]] const std::vector data = graphics_queue.getCheckpointDataNV(dld); + // Catch here in debug builds (or with optimizations disabled) the last graphics pipeline to be + // executed. It can be done on a debugger by evaluating the expression: + // *(VKGraphicsPipeline*)data[0] +} + bool VKDevice::IsOptimalAstcSupported(const vk::PhysicalDeviceFeatures& features, const vk::DispatchLoaderDynamic& dldi) const { // Disable for now to avoid converting ASTC twice. @@ -381,6 +400,8 @@ std::vector<const char*> VKDevice::LoadExtensions(const vk::DispatchLoaderDynami VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, true); Test(extension, ext_subgroup_size_control, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, false); + Test(extension, nv_device_diagnostic_checkpoints, + VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME, true); } if (khr_shader_float16_int8) { |