DXUT11: Filter out "Microsoft Basic Renderer" software device from enum

This commit is contained in:
walbourn_cp 2013-09-13 18:03:32 -07:00
Родитель 3326eb9865
Коммит c56b386c14
2 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -67,7 +67,7 @@
// Direct3D11 includes // Direct3D11 includes
#include <d3dcommon.h> #include <d3dcommon.h>
#include <dxgi.h> #include <dxgi.h>
#include <d3d11.h> #include <d3d11_1.h>
#include <d3dcompiler.h> #include <d3dcompiler.h>
// DirectXMath includes // DirectXMath includes
@ -122,6 +122,7 @@
((DWORD)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) ((DWORD)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
#endif #endif
#define DXUT_VERSION 1103
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
// SAL2 fixups for VS 2010 // SAL2 fixups for VS 2010

Просмотреть файл

@ -139,6 +139,22 @@ HRESULT CD3D11Enumeration::Enumerate( LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE IsD3
if( FAILED( hr ) ) // DXGIERR_NOT_FOUND is expected when the end of the list is hit if( FAILED( hr ) ) // DXGIERR_NOT_FOUND is expected when the end of the list is hit
break; break;
IDXGIAdapter2* pAdapter2 = nullptr;
if ( SUCCEEDED( pAdapter->QueryInterface( __uuidof(IDXGIAdapter2), ( LPVOID* )&pAdapter2 ) ) )
{
// Succeeds on Directx 11.1 Runtime systems
DXGI_ADAPTER_DESC2 desc;
hr = pAdapter2->GetDesc2( &desc );
pAdapter2->Release();
if ( SUCCEEDED(hr) && ( desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE ) )
{
// Skip "always there" Microsoft Basics Display Driver
pAdapter->Release();
continue;
}
}
CD3D11EnumAdapterInfo* pAdapterInfo = new (std::nothrow) CD3D11EnumAdapterInfo; CD3D11EnumAdapterInfo* pAdapterInfo = new (std::nothrow) CD3D11EnumAdapterInfo;
if( !pAdapterInfo ) if( !pAdapterInfo )
{ {