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

Conversation

@matanlurey
Copy link
Contributor

@matanlurey matanlurey commented Oct 24, 2023

Closes flutter/flutter#137093.

This widens supports from Open GLES 3.x to Open GLES 2.x, and uses ARM GPU Best Practices:

Do not use glBlitFramebuffer() to implement a multisample resolve.

This PR:

  • Removes usage of glBlitFramebuffer
  • Adds the capability check, SupportsImplicitResolvingMSAA, which is false outside of GLES
  • Does not discard color attachments resolved by EXT_multisampled_render_to_texture (done implicitly)

I spoke to @jonahwilliams about the changes to the HAL, who I believe also talked to @bdero about it. The short explantation is that, with the EXT_multisampled_render_to_texture, we can be more efficient by letting GLES perform multisampled rendering for us (no per-sample data is written out).

See also https://registry.khronos.org/OpenGL/extensions/EXT/EXT_multisampled_render_to_texture.txt for details.

@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 Hixie or stuartmorgan on 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.

Copy link
Contributor

@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!

//
// In practice, this is used for GLES 2.0 EXT_multisampled_render_to_texture
// https://registry.khronos.org/OpenGL/extensions/EXT/EXT_multisampled_render_to_texture.txt
color0.resolve_texture = color0_msaa_tex;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should technically create some sort of "Wrapped" texture with the same descriptor but with sample count set to 1? We might need to expand on what wrapped means. Though if it doesn't cause any problems as is maybe we just leave it.

@jonahwilliams
Copy link
Contributor

Actually, what you already have will work for desktop GL, so maybe leave the existing code path if there is no implict resolve support?

@chinmaygarde chinmaygarde changed the title Switch from glBlitFramebuffer to implicit MSAA resolution. [Impeller] Switch from glBlitFramebuffer to implicit MSAA resolution. Oct 25, 2023
@matanlurey
Copy link
Contributor Author

Actually, what you already have will work for desktop GL, so maybe leave the existing code path if there is no implict resolve support?

My understanding is this is widely supported.

I'd prefer to go back and evaluate desktop OpenGLES when that's a priority (versus leaving in code that's going to go unused for a while).

@matanlurey
Copy link
Contributor Author

@chinmaygarde Friendly ping, I know I got Jonah's LGTM but I'm changing the HAL and want you review as well.

@jonahwilliams
Copy link
Contributor

Yeah thats fine, but just pointing out the code you added already works

@jonahwilliams
Copy link
Contributor

Actually from talking with @bdero the implicit multisample render to texture might just work on desktop too, so I say rip it out.

@jonahwilliams
Copy link
Contributor

Here is one issue I've found so far, though it exists in both versions and solving it seems out of scope: flutter/flutter#137301

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 30, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 30, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 30, 2023

auto label is removed for flutter/engine/47282, due to - The status or check suite Linux Framework Smoke Tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 30, 2023
…137582)

flutter/engine@4f87c20...64b0e07

2023-10-30 [email protected] Roll Fuchsia Mac SDK from jCjz-imbNBDjiRVa1... to sBjtpAHoetjF77qxg... (flutter/engine#47482)
2023-10-30 [email protected] Roll Dart SDK from 85e149f894df to c8f75afabaf1 (1 revision) (flutter/engine#47479)
2023-10-30 [email protected] Update package:equatable pin (flutter/engine#47475)
2023-10-30 [email protected] [Impeller] Switch from `glBlitFramebuffer` to implicit MSAA resolution. (flutter/engine#47282)

Also rolling transitive DEPS:
  fuchsia/sdk/core/mac-amd64 from jCjz-imbNBDj to sBjtpAHoetjF

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],[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
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Oct 31, 2023
…lutter#137582)

flutter/engine@4f87c20...64b0e07

2023-10-30 [email protected] Roll Fuchsia Mac SDK from jCjz-imbNBDjiRVa1... to sBjtpAHoetjF77qxg... (flutter/engine#47482)
2023-10-30 [email protected] Roll Dart SDK from 85e149f894df to c8f75afabaf1 (1 revision) (flutter/engine#47479)
2023-10-30 [email protected] Update package:equatable pin (flutter/engine#47475)
2023-10-30 [email protected] [Impeller] Switch from `glBlitFramebuffer` to implicit MSAA resolution. (flutter/engine#47282)

Also rolling transitive DEPS:
  fuchsia/sdk/core/mac-amd64 from jCjz-imbNBDj to sBjtpAHoetjF

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],[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

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] OpenGLES MSAA Follow-up: Support < OpenGL 3.0

2 participants