Repository: flutter
Issue: [windows] Multi-engine doesn't work properly
Labels: engine,platform-windows,a: existing-apps,c: rendering,a: desktop,has reproducible steps,P2,found in release: 3.1,found in release: 3.3,team-windows,triaged-windows

<img width="569" alt="Screenshot 2022-08-31 190006" src="https://user-images.githubusercontent.com/26625149/187664216-52eefbd3-bb1f-4c0a-b4ba-0c093ec888c1.png">

## Steps to Reproduce
1. Checkout code: `git@github.com:0xZOne/multi_window_test.git`
2. Execute `flutter run -d windows`

Two windows are created at once as follows:

<img width="733" alt="Screenshot 2022-08-31 191039" src="https://user-images.githubusercontent.com/26625149/187665486-c4fee55d-d5c8-4001-a6c3-5a5d6eb4cc61.png">



<details>
  <summary>flutter doctor -v</summary>

```
[✓] Flutter (Channel main, 3.1.0-0.0.pre.2592, on Microsoft Windows [版本 10.0.19044.1889], locale zh-CN)
    • Flutter version 3.1.0-0.0.pre.2592 on channel main at C:\Users\zero\Dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 069f504297 (10 hours ago), 2022-08-30 18:20:09 -0700
    • Engine revision 0ef08a8525
    • Dart version 2.19.0 (build 2.19.0-152.0.dev)
    • DevTools version 2.16.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32630.192
    • Windows 10 SDK version 10.0.22621.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[✓] VS Code (version 1.70.0)
    • VS Code at C:\Users\zero\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.19044.1889]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 104.0.5112.102
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.70

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
```

</details>

<details>
  <summary>logs in debug mode</summary>

```
$ flutter run --local-engine host_debug_unopt --local-engine-src-path=/c/Users/zero/Dev/engine/src -d windows
Running "flutter pub get" in multi_window_test...                1,008ms
Launching lib\main.dart on Windows in debug mode...
Building Windows application...
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
[INFO:embedder.cc(136)] populate_existing_damage was not defined, disabling partial repaint. If you wish to enable partial repaint, please define this callback.
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
WARN: driver_utils.cpp:281 (GetVendorString):   ! Unimplemented: GetVendorString(../../third_party/angle/src/libANGLE/renderer/driver_utils.cpp:281)
Syncing files to device Windows...                                 169ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on Windows is available at: http://127.0.0.1:53008/vzvxQ7cj0i0=/
The Flutter DevTools debugger and profiler on Windows is available at: http://127.0.0.1:9105?uri=http://127.0.0.1:53008/vzvxQ7cj0i0=/
ERR: StateManager11.cpp:1197 (syncState):       ! Assert failed in syncState (../../third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp:1197): mVertexArray11 == GetImplAs<VertexArray11>(state.getVertexArray())
FATAL: StateManager11.cpp:1197 (syncState):     ! Assert failed in syncState (../../third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp:1197): mVertexArray11 == GetImplAs<VertexArray11>(state.getVertexArray())
Lost connection to device.
```
</details>

Related issue:  https://github.com/flutter/flutter/issues/110311, https://github.com/flutter/flutter/issues/66876