diff --git a/renderdoc/driver/ihv/nv/nv_d3d11_counters.cpp b/renderdoc/driver/ihv/nv/nv_d3d11_counters.cpp index 7e7058bd1..1e6dccf56 100644 --- a/renderdoc/driver/ihv/nv/nv_d3d11_counters.cpp +++ b/renderdoc/driver/ihv/nv/nv_d3d11_counters.cpp @@ -76,6 +76,9 @@ struct NVD3D11Counters::Impl return true; } + nv::perf::UserLogEnableCustom(NVD3D11Counters::Impl::LogNvPerfAsDebugMessage, (void *)device); + auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); + if(!nv::perf::D3D11LoadDriver()) { Impl::LogDebugMessage("NVD3D11Counters::Impl::TryInitializePerfSDK", @@ -202,9 +205,6 @@ bool NVD3D11Counters::Init(WrappedID3D11Device *device) if(!m_Impl) return false; - nv::perf::UserLogEnableCustom(NVD3D11Counters::Impl::LogNvPerfAsDebugMessage, (void *)device); - auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); - const bool initSuccess = m_Impl->TryInitializePerfSDK(device); if(!initSuccess) { diff --git a/renderdoc/driver/ihv/nv/nv_d3d12_counters.cpp b/renderdoc/driver/ihv/nv/nv_d3d12_counters.cpp index 83de37687..3842fb31b 100644 --- a/renderdoc/driver/ihv/nv/nv_d3d12_counters.cpp +++ b/renderdoc/driver/ihv/nv/nv_d3d12_counters.cpp @@ -79,6 +79,9 @@ struct NVD3D12Counters::Impl return true; } + nv::perf::UserLogEnableCustom(NVD3D12Counters::Impl::LogNvPerfAsDebugMessage, (void *)&device); + auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); + if(!nv::perf::D3D12LoadDriver()) { Impl::LogDebugMessage("NVD3D12Counters::Impl::TryInitializePerfSDK", @@ -182,9 +185,6 @@ bool NVD3D12Counters::Init(WrappedID3D12Device &device) if(!m_Impl) return false; - nv::perf::UserLogEnableCustom(NVD3D12Counters::Impl::LogNvPerfAsDebugMessage, (void *)&device); - auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); - bool initSuccess = m_Impl->TryInitializePerfSDK(device); if(!initSuccess) { diff --git a/renderdoc/driver/ihv/nv/nv_gl_counters.cpp b/renderdoc/driver/ihv/nv/nv_gl_counters.cpp index 4d23c6ffd..5de88bc3c 100644 --- a/renderdoc/driver/ihv/nv/nv_gl_counters.cpp +++ b/renderdoc/driver/ihv/nv/nv_gl_counters.cpp @@ -73,6 +73,9 @@ struct NVGLCounters::Impl return true; } + nv::perf::UserLogEnableCustom(NVGLCounters::Impl::LogNvPerfAsDebugMessage, (void *)driver); + auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); + if(!nv::perf::OpenGLLoadDriver()) { Impl::LogDebugMessage("NVGLCounters::Impl::TryInitializePerfSDK", @@ -198,9 +201,6 @@ bool NVGLCounters::Init(WrappedOpenGL *driver) if(!m_Impl) return false; - nv::perf::UserLogEnableCustom(NVGLCounters::Impl::LogNvPerfAsDebugMessage, (void *)driver); - auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); - const bool initSuccess = m_Impl->TryInitializePerfSDK(driver); if(!initSuccess) { diff --git a/renderdoc/driver/ihv/nv/nv_vk_counters.cpp b/renderdoc/driver/ihv/nv/nv_vk_counters.cpp index 3df69008b..655c86bcb 100644 --- a/renderdoc/driver/ihv/nv/nv_vk_counters.cpp +++ b/renderdoc/driver/ihv/nv/nv_vk_counters.cpp @@ -75,6 +75,9 @@ struct NVVulkanCounters::Impl return true; } + nv::perf::UserLogEnableCustom(NVVulkanCounters::Impl::LogNvPerfAsDebugMessage, (void *)driver); + auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); + if(!nv::perf::VulkanLoadDriver(Unwrap(driver->GetInstance()))) { Impl::LogDebugMessage("NVVulkanCounters::Impl::TryInitializePerfSDK", @@ -182,9 +185,6 @@ bool NVVulkanCounters::Init(WrappedVulkan *driver) if(!m_Impl) return false; - nv::perf::UserLogEnableCustom(NVVulkanCounters::Impl::LogNvPerfAsDebugMessage, (void *)driver); - auto logGuard = nv::perf::ScopeExitGuard([]() { nv::perf::UserLogDisableCustom(); }); - const bool initSuccess = m_Impl->TryInitializePerfSDK(driver); if(!initSuccess) {