From 5a26553410dc781b71da75c163400b801dfbf34a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 9 May 2012 12:01:33 +0100 Subject: [PATCH] Ensure feature level 10.0 at minimum. --- apps/d3d11/tri.cpp | 10 ++++++++-- apps/d3d11_1/tri.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/apps/d3d11/tri.cpp b/apps/d3d11/tri.cpp index 1ccf20c..28f9302 100644 --- a/apps/d3d11/tri.cpp +++ b/apps/d3d11/tri.cpp @@ -103,12 +103,18 @@ int main(int argc, char *argv[]){ SwapChainDesc.OutputWindow = hWnd; SwapChainDesc.Windowed = true; + static const D3D_FEATURE_LEVEL FeatureLevels[] = { + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0 + }; + hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */ D3D_DRIVER_TYPE_HARDWARE, NULL, /* Software */ D3D11_CREATE_DEVICE_DEBUG, - NULL, - 0, + FeatureLevels, + sizeof FeatureLevels / sizeof FeatureLevels[0], D3D11_SDK_VERSION, &SwapChainDesc, &g_pSwapChain, diff --git a/apps/d3d11_1/tri.cpp b/apps/d3d11_1/tri.cpp index d3c3bff..bf962fc 100644 --- a/apps/d3d11_1/tri.cpp +++ b/apps/d3d11_1/tri.cpp @@ -105,19 +105,19 @@ int main(int argc, char *argv[]){ SwapChainDesc.OutputWindow = hWnd; SwapChainDesc.Windowed = true; - D3D_FEATURE_LEVEL FeatureLevel = D3D_FEATURE_LEVEL_11_1; + static const D3D_FEATURE_LEVEL FeatureLevels[] = { + D3D_FEATURE_LEVEL_11_1, + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0 + }; hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */ D3D_DRIVER_TYPE_HARDWARE, NULL, /* Software */ D3D11_CREATE_DEVICE_DEBUG, -#if 0 - &FeatureLevel, - 1, -#else - NULL, - 0, -#endif + FeatureLevels, + sizeof FeatureLevels / sizeof FeatureLevels[0], D3D11_SDK_VERSION, &SwapChainDesc, &g_pSwapChain, -- 2.43.0