diff --git a/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.h b/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.h index b7409cedb5..5f3c725eef 100644 --- a/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.h +++ b/Source/Core/VideoBackends/D3D12/D3D12PerfQuery.h @@ -17,7 +17,7 @@ public: static PerfQuery* GetInstance() { return static_cast(g_perf_query.get()); } - bool Initialize(); + bool Initialize() override; void ResolveQueries(); void EnableQuery(PerfQueryGroup group) override; diff --git a/Source/Core/VideoBackends/Vulkan/VKMain.cpp b/Source/Core/VideoBackends/Vulkan/VKMain.cpp index a61b9d210a..721887af7a 100644 --- a/Source/Core/VideoBackends/Vulkan/VKMain.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKMain.cpp @@ -239,19 +239,8 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi) auto perf_query = std::make_unique(); auto bounding_box = std::make_unique(); - if (!InitializeShared(std::move(gfx), std::move(vertex_manager), std::move(perf_query), - std::move(bounding_box))) - { - return false; - } - - if (!PerfQuery::GetInstance()->Initialize()) - { - PanicAlertFmt("Failed to initialize PerfQuery"); - return false; - } - - return true; + return !InitializeShared(std::move(gfx), std::move(vertex_manager), std::move(perf_query), + std::move(bounding_box)); } void VideoBackend::Shutdown() diff --git a/Source/Core/VideoBackends/Vulkan/VKPerfQuery.h b/Source/Core/VideoBackends/Vulkan/VKPerfQuery.h index ee4cabd7d6..a8d31f57e8 100644 --- a/Source/Core/VideoBackends/Vulkan/VKPerfQuery.h +++ b/Source/Core/VideoBackends/Vulkan/VKPerfQuery.h @@ -20,7 +20,7 @@ public: static PerfQuery* GetInstance() { return static_cast(g_perf_query.get()); } - bool Initialize(); + bool Initialize() override; void EnableQuery(PerfQueryGroup group) override; void DisableQuery(PerfQueryGroup group) override; diff --git a/Source/Core/VideoCommon/PerfQueryBase.h b/Source/Core/VideoCommon/PerfQueryBase.h index 9671c33ec3..183a27c80c 100644 --- a/Source/Core/VideoCommon/PerfQueryBase.h +++ b/Source/Core/VideoCommon/PerfQueryBase.h @@ -34,6 +34,8 @@ public: PerfQueryBase() : m_query_count(0) {} virtual ~PerfQueryBase() {} + virtual bool Initialize() { return true; } + // Checks if performance queries are enabled in the gameini configuration. // NOTE: Called from CPU+GPU thread static bool ShouldEmulate(); diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index 3814cc3690..5119ba5ed1 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -371,9 +371,9 @@ bool VideoBackendBase::InitializeShared(std::unique_ptr gfx, TMEM::Init(); if (!g_vertex_manager->Initialize() || !g_shader_cache->Initialize() || - !g_renderer->Initialize() || !g_presenter->Initialize() || - !g_framebuffer_manager->Initialize() || !g_texture_cache->Initialize() || - !g_bounding_box->Initialize()) + !g_perf_query->Initialize() || !g_renderer->Initialize() || + !g_presenter->Initialize() || !g_framebuffer_manager->Initialize() || + !g_texture_cache->Initialize() || !g_bounding_box->Initialize()) { PanicAlertFmtT("Failed to initialize renderer classes"); Shutdown();