Fix errors from NvPerfUtility displayed when no library present

Errors from NvPerfUtility do not need to be displayed if the Nsight Perf SDK
library is not installed.
This commit is contained in:
Jonathan Glines
2023-01-19 13:46:49 -05:00
committed by Baldur Karlsson
parent 0042f6dfd9
commit 4e02449617
4 changed files with 12 additions and 12 deletions
@@ -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)
{
@@ -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)
{
+3 -3
View File
@@ -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)
{
+3 -3
View File
@@ -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)
{