Skip to content

[Windows] Use ANGLE blit extension on GLES 2.0 #170298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Jun 9, 2025

This updates Flutter Windows to fall back to glBlitFramebufferANGLE if glBlitFramebuffer is not available. This makes Flutter Windows work on devices where ANGLE supports only GLES 2.0.

Fixes: #169178

Background

ANGLE only implements GLES 2.0 on some Windows 10+ machines (1, 2).

Flutter Windows 3.27.4 and lower was using glBlitFramebuffer on GLES 2.0 devices, even though that requires GLES 3.0. This magically worked though, thanks to ANGLE.

However in 3.29.0, Impeller was updated to not resolve GLES 3.0 procs on GLES 2.0: flutter/engine#56636. This caused Flutter Windows to crash on GLES 2.0 devices since it was calling glBlitFramebuffer.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added engine flutter/engine repository. See also e: labels. platform-windows Building on or for Windows specifically a: desktop Running on desktop e: impeller Impeller rendering backend issues and features requests labels Jun 9, 2025
@@ -141,6 +141,10 @@ ProcTableGLES::ProcTableGLES( // NOLINT(google-readability-function-size)
DiscardFramebufferEXT.Reset();
}

if (!description_->HasExtension("GL_ANGLE_framebuffer_blit")) {
BlitFramebufferANGLE.Reset();
}
Copy link
Member Author

@loic-sharma loic-sharma Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered only loading this proc if we detect ANGLE, however, the GL_VERSION for the affected devices are 2.0.0, which causes DescriptionGLES::IsANGLE to return false.

@loic-sharma loic-sharma marked this pull request as ready for review June 9, 2025 23:30
Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 12, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jun 13, 2025
Merged via the queue into flutter:master with commit 2e0b9f2 Jun 13, 2025
182 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. platform-windows Building on or for Windows specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows Flutter apps crash silently on some machines after 3.27.4
2 participants