mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Load dxgi function at runtime in NvPerfUtility
This is to avoid linking with dxgi at build time.
This commit is contained in:
committed by
Baldur Karlsson
parent
68b33519d1
commit
2bcbdd516e
@@ -176,8 +176,15 @@ namespace nv { namespace perf {
|
||||
{
|
||||
const LUID deviceLuid = pDevice->GetAdapterLuid();
|
||||
|
||||
typedef HRESULT (*PFN_CREATE_DXGI_FACTORY)(REFIID, void **);
|
||||
PFN_CREATE_DXGI_FACTORY pfnCreateDXGIFactory1 = (PFN_CREATE_DXGI_FACTORY)GetProcAddress(GetModuleHandleA("dxgi.dll"), "CreateDXGIFactory1");
|
||||
if (!pfnCreateDXGIFactory1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ComPtr<IDXGIFactory1> pDXGIFactory;
|
||||
HRESULT hr = CreateDXGIFactory1(IID_PPV_ARGS(&pDXGIFactory));
|
||||
HRESULT hr = pfnCreateDXGIFactory1(IID_PPV_ARGS(&pDXGIFactory));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user