Ensure feature level 10.0 at minimum.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 9 May 2012 11:01:33 +0000 (12:01 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 9 May 2012 11:01:33 +0000 (12:01 +0100)
apps/d3d11/tri.cpp
apps/d3d11_1/tri.cpp

index 1ccf20c090a8b1f5b08f1355bb0aa98af5c36b6a..28f930298e2a30b45d0b442947cfb1f2c2ba77f9 100644 (file)
@@ -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,
index d3c3bff90e664a3ef867da5090d215ffd5207a54..bf962fca9e6349f416d2f43cb60823341415a8c3 100644 (file)
@@ -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,