Detect nVidia Nsight debugger presence.

This commit is contained in:
Branimir Karadžić
2025-10-23 10:06:24 -07:00
parent 1bf37c0da2
commit f3cab4d2d8
5 changed files with 19 additions and 3 deletions

View File

@@ -8,6 +8,7 @@
namespace bgfx
{
void* findModule(const char* _name);
void* loadRenderDoc();
void unloadRenderDoc(void*);
void renderDocTriggerCapture();

View File

@@ -1009,6 +1009,11 @@ namespace bgfx { namespace d3d11
}
}
if (NULL != findModule("Nvda.Graphics.Interception.dll") )
{
setGraphicsDebuggerPresent(true);
}
if (BGFX_PCI_ID_NVIDIA != m_dxgi.m_adapterDesc.VendorId)
{
m_nvapi.shutdown();

View File

@@ -733,7 +733,11 @@ namespace bgfx { namespace d3d12
m_renderDocDll = loadRenderDoc();
}
setGraphicsDebuggerPresent(NULL != m_renderDocDll || NULL != m_winPixEvent);
setGraphicsDebuggerPresent(false
|| NULL != m_renderDocDll
|| NULL != m_winPixEvent
|| NULL != findModule("Nvda.Graphics.Interception.dll")
);
m_fbh.idx = kInvalidHandle;
bx::memSet(m_uniforms, 0, sizeof(m_uniforms) );

View File

@@ -3168,7 +3168,10 @@ namespace bgfx { namespace gl
m_maxLabelLen = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 32) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 43) || s_extension[Extension::KHR_debug].m_supported ? uint16_t(glGet(GL_MAX_LABEL_LENGTH) ) : 0;
setGraphicsDebuggerPresent(s_extension[Extension::EXT_debug_tool].m_supported);
setGraphicsDebuggerPresent(false
|| s_extension[Extension::EXT_debug_tool].m_supported
|| NULL != findModule("Nvda.Graphics.Interception.dll")
);
if (NULL == glObjectLabel)
{

View File

@@ -1194,7 +1194,10 @@ VK_IMPORT_DEVICE
m_renderDocDll = loadRenderDoc();
}
setGraphicsDebuggerPresent(NULL != m_renderDocDll);
setGraphicsDebuggerPresent(false
|| NULL != m_renderDocDll
|| NULL != findModule("Nvda.Graphics.Interception.dll")
);
m_vulkan1Dll = bx::dlopen(
#if BX_PLATFORM_WINDOWS