void testDirect3D11FeatureLevel(const TCHAR *testName, D3D_DRIVER_TYPE driverType) { tcout << _T("\nTesting ") << testName << _T("...\n"); HWND hWnd = CreateWindowEx(0, _T("#32769"), _T("Dummy"), 0, 0, 0, 0, 0, 0, 0, GetModuleHandle(0), 0); if (!hWnd) { tcout << "Cannot create window.\n"; return; } ID3D11Device *device; D3D_FEATURE_LEVEL featureLevel; HRESULT hr = D3D11CreateDevice(0, driverType, 0, 0, 0, 0, D3D11_SDK_VERSION, &device, &featureLevel, 0); if (!SUCCEEDED(hr)) { tcout << "D3D11 device creation failed.\n"; CloseWindow(hWnd); return; } tcout << _T("D3D11 device created.\n"); switch (featureLevel) { case D3D_FEATURE_LEVEL_9_1: tcout << _T("Feature level 9_1 supported, which means we have shaders 2.0.\n"); break; case D3D_FEATURE_LEVEL_9_2: tcout << _T("Feature level 9_2 supported, which means we have shaders 2.0.\n"); break; case D3D_FEATURE_LEVEL_9_3: tcout << _T("Feature level 9_3 supported, which means we have shaders 3.0.\n"); break; case D3D_FEATURE_LEVEL_10_0: tcout << _T("Feature level 10_0 supported, which means we have shaders 4.0.\n"); break; case D3D_FEATURE_LEVEL_10_1: tcout << _T("Feature level 10_1 supported, which means we have shaders 4.0.\n"); break; case D3D_FEATURE_LEVEL_11_0: tcout << _T("Feature level 11_0 supported, which means we have shaders 5.0.\n"); break; } device->Release(); CloseWindow(hWnd); } int _tmain(int argc, _TCHAR* argv[]) { testDirect3D11FeatureLevel(_T("HAL"), D3D_DRIVER_TYPE_HARDWARE); testDirect3D11FeatureLevel(_T("REF"), D3D_DRIVER_TYPE_REFERENCE); testDirect3D11FeatureLevel(_T("WARP"), D3D_DRIVER_TYPE_WARP); return 0; }