From bba618beede60ea341d752b0bb20f22f181f4a6b Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 1 Jul 2010 17:46:25 +0000 Subject: [PATCH] GSdx: Improved DX10/11 detection. Fixes crashes using the Configure... button mid-game. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3361 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSDevice11.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 2c5ff1df91..07c5d0ee20 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -97,7 +97,16 @@ static void* GetDX11Proc( const char* methodname ) bool GSUtil::IsDirect3D11Available() { - if( !DXUTDelayLoadDXGI() ) return false; + static bool m_CheckRun = false; + + if (m_CheckRun) return m_D3D11Available; + m_CheckRun = true; + + if( !DXUTDelayLoadDXGI() ) + { + m_D3D11Available = false; + return false; + } CComPtr dev; CComPtr ctx; @@ -107,14 +116,16 @@ bool GSUtil::IsDirect3D11Available() D3D11_SDK_VERSION, &dev, &level, &ctx); m_D3D11Available = !FAILED(hr); - m_HasD3D11Features = (level == D3D_FEATURE_LEVEL_11_0); + m_HasD3D11Features = (level >= D3D_FEATURE_LEVEL_11_0); + + UnloadDynamicLibraries(); return m_D3D11Available; } bool GSUtil::HasD3D11Features() { - return m_D3D11Available && m_HasD3D11Features; + return IsDirect3D11Available() && m_HasD3D11Features; } void GSUtil::UnloadDynamicLibraries()