From 4db9d8adf1f6508d5372d51263e1076c95f45efb Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 19 Mar 2019 01:26:21 -0700 Subject: Fixed issue in hardware adapter enumeration in D3D12 backend --- Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp index cb1fa5ff..6806fafc 100644 --- a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp @@ -76,12 +76,12 @@ public: ISwapChain** ppSwapChain )override final; }; -void GetHardwareAdapter(IDXGIFactory2* pFactory, IDXGIAdapter1** ppAdapter) +static void GetHardwareAdapter(IDXGIFactory2* pFactory, IDXGIAdapter1** ppAdapter) { CComPtr adapter; *ppAdapter = nullptr; - for (UINT adapterIndex = 0; DXGI_ERROR_NOT_FOUND != pFactory->EnumAdapters1(adapterIndex, &adapter); ++adapterIndex) + for (UINT adapterIndex = 0; DXGI_ERROR_NOT_FOUND != pFactory->EnumAdapters1(adapterIndex, &adapter); ++adapterIndex, adapter.Release()) { DXGI_ADAPTER_DESC1 desc; adapter->GetDesc1(&desc); -- cgit v1.2.3