D3D11: return error if D3D feature level < 11.0

We don't support feature level < 11.0 since it doesn't have enough
capabilities to run even Compat Mode.

Bug: 392987592
Change-Id: I0130bc470427209c2d0e4a534854e4e2a5a63c30
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/225814
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
index 2838d74..933046d 100644
--- a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
+++ b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
@@ -218,16 +218,18 @@
     uint32_t maxUAVsPerStage;
     uint32_t maxUAVsPerVertexStage;
 
-    if (mFeatureLevel == D3D_FEATURE_LEVEL_11_1) {
+    if (mFeatureLevel >= D3D_FEATURE_LEVEL_11_1) {
         // In D3D 11.1, max UAV slots are shared between fragment & vertex stage so divide it by 2
         // to get per stage limit.
         maxUAVsAllStages = D3D11_1_UAV_SLOT_COUNT;
         maxUAVsPerStage = maxUAVsAllStages / 2;
         maxUAVsPerVertexStage = maxUAVsPerStage;
     } else {
+        // We don't support feature level < 11.0
+        DAWN_INVALID_IF(mFeatureLevel < D3D_FEATURE_LEVEL_11_0, "Unsupported D3D feature level %u",
+                        mFeatureLevel);
         // In D3D 11.0, only fragment and compute have UAVs. Vertex doesn't have UAV so we don't
         // need to divide the slot count between fragment & vertex.
-        DAWN_ASSERT(mFeatureLevel == D3D_FEATURE_LEVEL_11_0);
         maxUAVsAllStages = D3D11_PS_CS_UAV_REGISTER_COUNT;
         maxUAVsPerStage = maxUAVsAllStages;
         maxUAVsPerVertexStage = 0;