Repository: flutter
Issue: Impeller GPU calls fail to render on Windows (GLES)
Labels: c: regression,engine,platform-windows,c: rendering,has reproducible steps,P2,e: impeller,team-engine,triaged-engine,flutter-gpu,found in release: 3.28

### Steps to reproduce

As of a few weeks ago, enabling Impeller and making `flutter_gpu` calls on Windows (OpenGL / GLES) was actually working as desired, despite not yet being listed as a supported platform. This only broke in a recent update to the `main` channel - right now, I'm unable to render anything to a `flutter_gpu` `RenderTarget` and only see a black texture instead.

The bug must have been introduced in revision https://github.com/flutter/flutter/commit/1ef8d512829dad0797ecf5259c508a9f2fa49ad4, as the commit *right before* still works as expected. The following PRs are relevant to the main suspect commit:

- https://github.com/flutter/engine/pull/56597
- https://github.com/flutter/engine/pull/56573
- https://github.com/flutter/engine/pull/56585


### Expected results

I've set up a minimal example, in which a single render pass with a blue clear value should get drawn.

The outlined rectangle container should get painted with the GPU-rendered texture and turn blue.

![image](https://github.com/user-attachments/assets/bd0e2d96-cd4e-4420-895f-1f6d2cd51152)

(Captured on Flutter main channel, revision https://github.com/flutter/flutter/commit/6281dca4508f1fdfc30c6594fcaa5b3f95b13851)

### Actual results

The outlined rectangle container stays black.

![image](https://github.com/user-attachments/assets/8f954f9c-8b9c-42b5-bfcd-55053aacf12a)

(Captured on Flutter main channel, revision https://github.com/flutter/flutter/commit/1ef8d512829dad0797ecf5259c508a9f2fa49ad4)

### Code sample

The minimal example from the screenshots above is available at https://github.com/doodlezucc/flutter_gpu_minimal.git

Rendering **fails only since** commit https://github.com/flutter/flutter/commit/1ef8d512829dad0797ecf5259c508a9f2fa49ad4 of the Flutter main branch. The previous commit https://github.com/flutter/flutter/commit/6281dca4508f1fdfc30c6594fcaa5b3f95b13851 works as expected.

### Screenshots or Video

_No response_

### Logs

<details open><summary>Logs</summary>

```console
Launching lib\main.dart on Windows in debug mode...
√ Built build\windows\x64\runner\Debug\flutter_gpu_minimal.exe
[IMPORTANT:flutter/shell/platform/embedder/embedder_surface_gl_impeller.cc(97)] Using the Impeller rendering backend (OpenGL).
Connecting to VM Service at ws://127.0.0.1:56036/5vXAi2R2xgo=/ws
Connected to the VM Service.
Application finished.

Exited (-1).
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[!] Flutter (Channel [user-branch], 3.27.0-1.0.pre.525, on Microsoft Windows [Version 10.0.19045.5247], locale de-DE)
    ! Flutter version 3.27.0-1.0.pre.525 on channel [user-branch] at C:\Users\[...]\Documents\flutter\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 1ef8d51282 (6 weeks ago), 2024-11-15 21:02:25 -0500
    • Engine revision f649330aff
    • Dart version 3.7.0 (build 3.7.0-153.0.dev)
    • DevTools version 2.41.0-dev.2
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (10 Home 64-bit, 22H2, 2009)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\[...]\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.10.35122.118
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] IntelliJ IDEA Community Edition (version 2024.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2024.1.4
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.96.2)
    • VS Code at C:\Users\[...]\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.102.0

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.5247]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 131.0.6778.205

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>