Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Use glBlitFramebuffer when rendering #53080

Merged
merged 11 commits into from
Jul 18, 2024

Conversation

robert-ancell
Copy link
Contributor

This is much faster than using a shader which is not required currently (we are not doing any transformations).

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

This is much faster than using a shader which is not required currently (we are
not doing any transformations).
@robert-ancell
Copy link
Contributor Author

Done as part of diagnosing flutter/flutter#148653. It hasn't resolved the issue, but has made things simpler (and faster) than before.

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.

seems strictly better, but also blitFramebuffer is an OpenGL 3 proc. I dont know what the minimum gl version the linux embedder requires, but something to keep in mind.

@robert-ancell
Copy link
Contributor Author

seems strictly better, but also blitFramebuffer is an OpenGL 3 proc. I dont know what the minimum gl version the linux embedder requires, but something to keep in mind.

It sounds like practically this will exist, but we should provide a fallback to cover all cases.

@robert-ancell robert-ancell marked this pull request as draft June 5, 2024 04:28
@robert-ancell
Copy link
Contributor Author

Moving this to draft status as I need to think about an appropriate fallback behaviour.

@jonahwilliams
Copy link
Member

If you are on OpenGL 2 or less then I think the current shader based solution is the best you can do. Still, that is an ancient gl version, and I don't know if we actually support it

@robert-ancell
Copy link
Contributor Author

Talking to the OpenGL experts here it seems GLES2 is the minimum we can expect, but practically all systems will have GL3. So we just need to provide some form of fallback for a rare case - i.e. it probably doesn't have to be performant.

@robert-ancell robert-ancell marked this pull request as ready for review July 4, 2024 04:37
Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

LGTM but my understanding of OpenGL is shaky; please also get approval from someone with more experience here like @jonahwilliams.

Also, don't forget to get a test exemption before landing this.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

LGTM stamp from a Japanese personal seal

@chinmaygarde
Copy link
Member

Doesn't this need a fallback for ES2?

@robert-ancell
Copy link
Contributor Author

Doesn't this need a fallback for ES2?

If glBlitFramebuffer it reverts to the current texture rendering - is there something special in ES2 that would stop that working?

@robert-ancell
Copy link
Contributor Author

Requesting a test exemption as this render path is not explicitly checked currently.

@robert-ancell
Copy link
Contributor Author

Added a test, so this no longer requires the exemption.

@robert-ancell robert-ancell merged commit b043fe4 into flutter:main Jul 18, 2024
25 of 26 checks passed
@robert-ancell robert-ancell deleted the linux-blit-render branch July 18, 2024 04:03
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 18, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 18, 2024
…151942)

flutter/engine@e3abca2...b043fe4

2024-07-18 [email protected] Use glBlitFramebuffer when rendering (flutter/engine#53080)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…lutter#151942)

flutter/engine@e3abca2...b043fe4

2024-07-18 [email protected] Use glBlitFramebuffer when rendering (flutter/engine#53080)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#151942)

flutter/engine@e3abca2...b043fe4

2024-07-18 [email protected] Use glBlitFramebuffer when rendering (flutter/engine#53080)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants