Skip OpenGL ES backend on Win ASAN

ASAN produces an odr-violation error on a libc++ symbol when loading
libEGL.dll on Windows. Avoid loading libEGL.dll by skipping the GLES
backend in this case.

Bug: 347169607
Change-Id: I417bced3515c2163b2012ad6b3d8c8d4868b95a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/223574
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@google.com>
diff --git a/src/dawn/native/Instance.cpp b/src/dawn/native/Instance.cpp
index 01c75e9..61fb5f4 100644
--- a/src/dawn/native/Instance.cpp
+++ b/src/dawn/native/Instance.cpp
@@ -458,6 +458,16 @@
 
     std::vector<Ref<PhysicalDeviceBase>> discoveredPhysicalDevices;
     for (wgpu::BackendType b : IterateBitSet(backendsToFind)) {
+#if DAWN_PLATFORM_IS(WINDOWS) && defined(__has_feature)
+#if __has_feature(address_sanitizer)
+        if (b == wgpu::BackendType::OpenGLES) {
+            // TODO(crbug.com/347169607): Loading libEGL.dll causes an odr-violation in libc++
+            ConsumedErrorAndWarnOnce(
+                DAWN_INTERNAL_ERROR("OpenGLES backend disabled on Windows ASAN"));
+            continue;
+        }
+#endif
+#endif
         BackendConnection* backend = GetBackendConnection(b);
 
         if (backend != nullptr) {