Skip to content

Commit

Permalink
Modern tools for debugging Direct3D do not require special actions fo…
Browse files Browse the repository at this point in the history
…r initialization.
  • Loading branch information
intorr committed Feb 15, 2018
1 parent c51814e commit 5aa0dde
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 48 deletions.
16 changes: 0 additions & 16 deletions src/Layers/xrRender/HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,6 @@ void CHW::CreateDevice(HWND m_hWnd, bool move_window)
DevAdapter = D3DADAPTER_DEFAULT;
DevT = Caps.bForceGPU_REF ? D3DDEVTYPE_REF : D3DDEVTYPE_HAL;

#ifndef MASTER_GOLD
// Look for 'NVIDIA NVPerfHUD' adapter
// If it is present, override default settings
for (UINT Adapter = 0; Adapter < pD3D->GetAdapterCount(); Adapter++)
{
D3DADAPTER_IDENTIFIER9 Identifier;
HRESULT Res = pD3D->GetAdapterIdentifier(Adapter, 0, &Identifier);
if (SUCCEEDED(Res) && (xr_strcmp(Identifier.Description, "NVIDIA PerfHUD") == 0))
{
DevAdapter = Adapter;
DevT = D3DDEVTYPE_REF;
break;
}
}
#endif // MASTER_GOLD

// Display the name of video board
D3DADAPTER_IDENTIFIER9 adapterID;
R_CHK(pD3D->GetAdapterIdentifier(DevAdapter, 0, &adapterID));
Expand Down
2 changes: 0 additions & 2 deletions src/Layers/xrRender/HW.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class CHW

D3D_DRIVER_TYPE m_DriverType; // DevT equivalent
DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent
bool m_bUsePerfhud;
D3D_FEATURE_LEVEL FeatureLevel;
#elif defined(USE_DX10)
public:
Expand All @@ -105,7 +104,6 @@ class CHW

D3D10_DRIVER_TYPE m_DriverType; // DevT equivalent
DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent
bool m_bUsePerfhud;
D3D_FEATURE_LEVEL FeatureLevel;
#else
private:
Expand Down
32 changes: 2 additions & 30 deletions src/Layers/xrRenderDX10/dx10HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,10 @@ void CHW::CreateD3D()
*/

IDXGIFactory* pFactory;
R_CHK(CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory)));

m_pAdapter = 0;
m_bUsePerfhud = false;

#ifndef MASTER_GOLD
// Look for 'NVIDIA NVPerfHUD' adapter
// If it is present, override default settings
UINT i = 0;
while (pFactory->EnumAdapters(i, &m_pAdapter) != DXGI_ERROR_NOT_FOUND)
{
DXGI_ADAPTER_DESC desc;
m_pAdapter->GetDesc(&desc);
if (!wcscmp(desc.Description, L"NVIDIA PerfHUD"))
{
m_bUsePerfhud = true;
break;
}
else
{
m_pAdapter->Release();
m_pAdapter = 0;
}
++i;
}
#endif // MASTER_GOLD
R_CHK(CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory)));

if (!m_pAdapter)
pFactory->EnumAdapters(0, &m_pAdapter);
pFactory->EnumAdapters(0, &m_pAdapter);

pFactory->Release();

Expand Down Expand Up @@ -164,9 +139,6 @@ void CHW::CreateDevice(HWND m_hWnd, bool move_window)

m_DriverType = Caps.bForceGPU_REF ? D3D_DRIVER_TYPE_REFERENCE : D3D_DRIVER_TYPE_HARDWARE;

if (m_bUsePerfhud)
m_DriverType = D3D_DRIVER_TYPE_REFERENCE;

// For DirectX 10 adapter is already created in create D3D.
/*
//. #ifdef DEBUG
Expand Down

0 comments on commit 5aa0dde

Please sign in to comment.