From 72ab1538aff57dec133c4ad0ed048972297eee88 Mon Sep 17 00:00:00 2001 From: Dev-Taehui Date: Wed, 1 Feb 2023 16:02:50 +0900 Subject: [PATCH 1/2] Set Direct3D feature levels from 11.1 to 9.1 --- winrt/lib/drawing/CanvasDevice.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/winrt/lib/drawing/CanvasDevice.cpp b/winrt/lib/drawing/CanvasDevice.cpp index 7e9f13be1..363c7a3e2 100644 --- a/winrt/lib/drawing/CanvasDevice.cpp +++ b/winrt/lib/drawing/CanvasDevice.cpp @@ -49,14 +49,15 @@ namespace ABI { namespace Microsoft { namespace Graphics { namespace Canvas deviceFlags |= D3D11_CREATE_DEVICE_DEBUG; } + auto featureLevels = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL_9_1 }; ComPtr createdDevice; if (SUCCEEDED(D3D11CreateDevice( NULL, // adapter driverType, NULL, // software handle deviceFlags, - NULL, // feature level array - 0, // feature level count + featureLevels, // feature level array + ARRAYSIZE(featureLevels), // feature level count D3D11_SDK_VERSION, &createdDevice, NULL, From 3f81e1d34cf32fa5b826cfe869ce38458b3d642c Mon Sep 17 00:00:00 2001 From: Dev-Taehui Date: Wed, 15 Mar 2023 08:50:43 +0900 Subject: [PATCH 2/2] Change to array creation --- winrt/lib/drawing/CanvasDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winrt/lib/drawing/CanvasDevice.cpp b/winrt/lib/drawing/CanvasDevice.cpp index 363c7a3e2..61efeed19 100644 --- a/winrt/lib/drawing/CanvasDevice.cpp +++ b/winrt/lib/drawing/CanvasDevice.cpp @@ -49,7 +49,7 @@ namespace ABI { namespace Microsoft { namespace Graphics { namespace Canvas deviceFlags |= D3D11_CREATE_DEVICE_DEBUG; } - auto featureLevels = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL_9_1 }; + D3D_FEATURE_LEVEL featureLevels[7] { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL_9_1 }; ComPtr createdDevice; if (SUCCEEDED(D3D11CreateDevice( NULL, // adapter