diff options
author | bunnei <bunneidev@gmail.com> | 2021-01-06 02:44:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 02:44:56 +0100 |
commit | 275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65 (patch) | |
tree | 75f9aa4727d41015f841ba83f4af36335f83771f /src/video_core/vulkan_common/nsight_aftermath_tracker.cpp | |
parent | Merge pull request #5292 from ReinUsesLisp/empty-set (diff) | |
parent | vulkan_device: Allow creating a device without surface (diff) | |
download | yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.tar yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.tar.gz yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.tar.bz2 yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.tar.lz yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.tar.xz yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.tar.zst yuzu-275b96a0e22e40a0b1d9f49fa8ba3ec07e8dcc65.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/vulkan_common/nsight_aftermath_tracker.cpp (renamed from src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp) | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp b/src/video_core/vulkan_common/nsight_aftermath_tracker.cpp index 5b01020ec..8d10ac29e 100644 --- a/src/video_core/renderer_vulkan/nsight_aftermath_tracker.cpp +++ b/src/video_core/vulkan_common/nsight_aftermath_tracker.cpp @@ -32,20 +32,11 @@ namespace Vulkan { static constexpr char AFTERMATH_LIB_NAME[] = "GFSDK_Aftermath_Lib.x64.dll"; -NsightAftermathTracker::NsightAftermathTracker() = default; - -NsightAftermathTracker::~NsightAftermathTracker() { - if (initialized) { - (void)GFSDK_Aftermath_DisableGpuCrashDumps(); - } -} - -bool NsightAftermathTracker::Initialize() { +NsightAftermathTracker::NsightAftermathTracker() { if (!dl.Open(AFTERMATH_LIB_NAME)) { LOG_ERROR(Render_Vulkan, "Failed to load Nsight Aftermath DLL"); - return false; + return; } - if (!dl.GetSymbol("GFSDK_Aftermath_DisableGpuCrashDumps", &GFSDK_Aftermath_DisableGpuCrashDumps) || !dl.GetSymbol("GFSDK_Aftermath_EnableGpuCrashDumps", @@ -64,27 +55,28 @@ bool NsightAftermathTracker::Initialize() { LOG_ERROR(Render_Vulkan, "Failed to load Nsight Aftermath function pointers"); return false; } - dump_dir = Common::FS::GetUserPath(Common::FS::UserPath::LogDir) + "gpucrash"; - (void)Common::FS::DeleteDirRecursively(dump_dir); + void(Common::FS::DeleteDirRecursively(dump_dir)); if (!Common::FS::CreateDir(dump_dir)) { LOG_ERROR(Render_Vulkan, "Failed to create Nsight Aftermath dump directory"); - return false; + return; } - if (!GFSDK_Aftermath_SUCCEED(GFSDK_Aftermath_EnableGpuCrashDumps( GFSDK_Aftermath_Version_API, GFSDK_Aftermath_GpuCrashDumpWatchedApiFlags_Vulkan, GFSDK_Aftermath_GpuCrashDumpFeatureFlags_Default, GpuCrashDumpCallback, ShaderDebugInfoCallback, CrashDumpDescriptionCallback, this))) { LOG_ERROR(Render_Vulkan, "GFSDK_Aftermath_EnableGpuCrashDumps failed"); - return false; + return; } - LOG_INFO(Render_Vulkan, "Nsight Aftermath dump directory is \"{}\"", dump_dir); - initialized = true; - return true; +} + +NsightAftermathTracker::~NsightAftermathTracker() { + if (initialized) { + (void)GFSDK_Aftermath_DisableGpuCrashDumps(); + } } void NsightAftermathTracker::SaveShader(const std::vector<u32>& spirv) const { |