Reorder backend connections so that explicit APIs come first
This makes it so that default adapter discovery finds
Metal/D3D12/Vulkan first.
Change-Id: I3795bcc8a3d47eb3c53881b7fc43e8d56b4b89fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5481
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/Instance.cpp b/src/dawn_native/Instance.cpp
index 6786f7f..9877264 100644
--- a/src/dawn_native/Instance.cpp
+++ b/src/dawn_native/Instance.cpp
@@ -101,15 +101,15 @@
#if defined(DAWN_ENABLE_BACKEND_METAL)
Register(metal::Connect(this), BackendType::Metal);
#endif // defined(DAWN_ENABLE_BACKEND_METAL)
-#if defined(DAWN_ENABLE_BACKEND_NULL)
- Register(null::Connect(this), BackendType::Null);
-#endif // defined(DAWN_ENABLE_BACKEND_NULL)
-#if defined(DAWN_ENABLE_BACKEND_OPENGL)
- Register(opengl::Connect(this), BackendType::OpenGL);
-#endif // defined(DAWN_ENABLE_BACKEND_OPENGL)
#if defined(DAWN_ENABLE_BACKEND_VULKAN)
Register(vulkan::Connect(this), BackendType::Vulkan);
#endif // defined(DAWN_ENABLE_BACKEND_VULKAN)
+#if defined(DAWN_ENABLE_BACKEND_OPENGL)
+ Register(opengl::Connect(this), BackendType::OpenGL);
+#endif // defined(DAWN_ENABLE_BACKEND_OPENGL)
+#if defined(DAWN_ENABLE_BACKEND_NULL)
+ Register(null::Connect(this), BackendType::Null);
+#endif // defined(DAWN_ENABLE_BACKEND_NULL)
mBackendsConnected = true;
}